/[hurd]/hurd/libstore/nbd.c
ViewVC logotype

Diff of /hurd/libstore/nbd.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.16 by roland, Mon Dec 31 08:07:23 2001 UTC revision 1.17 by roland, Wed Jan 2 02:25:29 2002 UTC
# Line 72  struct nbd_reply Line 72  struct nbd_reply
72    
73  /* i/o functions.  */  /* i/o functions.  */
74    
 static inline uint64_t  
 htonll (uint64_t x)  
 {  
75  #if BYTE_ORDER == BIG_ENDIAN  #if BYTE_ORDER == BIG_ENDIAN
76    return x;  # define htonll(x)      (x)
77  #elif BYTE_ORDER == LITTLE_ENDIAN  #elif BYTE_ORDER == LITTLE_ENDIAN
78    union { uint64_t ll; uint32_t l[2]; } u;  # include <byteswap.h>
79    u.l[0] = htonl ((uint32_t) (x >> 32));  # define htonll(x)      (bswap_64 (x))
   u.l[1] = htonl ((uint32_t) x);  
   return u.ll;  
80  #else  #else
81  # error what endian?  # error what endian?
82  #endif  #endif
 }  
83  #define ntohll htonll  #define ntohll htonll
84    
85    

Legend:
Removed from v.1.16  
changed lines
  Added in v.1.17

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26