Whamcloud - gitweb
LU-5577 libcfs: fix warnings in libcfs/curproc.h
[fs/lustre-release.git] / libcfs / include / libcfs / user-tcpip.h
index 17a30e6..9812fb9 100644 (file)
@@ -1,6 +1,4 @@
-/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
- * vim:expandtab:shiftwidth=8:tabstop=8:
- *
+/*
  * GPL HEADER START
  *
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -44,6 +42,7 @@
 #ifndef __KERNEL__
 
 #include <sys/uio.h>
+#include <endian.h>
 
 /*
  * Functions to get network interfaces info
@@ -99,13 +98,13 @@ int libcfs_sock_create(cfs_socket_t **sockp, int *fatal,
         ((unsigned char *)&addr)[2], \
         ((unsigned char *)&addr)[3]
 
-#if defined(__LITTLE_ENDIAN) || defined(_LITTLE_ENDIAN)
+#if __BYTE_ORDER == __LITTLE_ENDIAN
 #define HIPQUAD(addr)                \
         ((unsigned char *)&addr)[3], \
         ((unsigned char *)&addr)[2], \
         ((unsigned char *)&addr)[1], \
         ((unsigned char *)&addr)[0]
-#elif defined(__BIG_ENDIAN) || defined(_BIG_ENDIAN)
+#elif __BYTE_ORDER == __BIG_ENDIAN
 #define HIPQUAD NIPQUAD
 #else
 #error "Undefined byteorder??"