[BACK]Return to endian.h CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / sys / sys

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /src/sys/sys/endian.h between version 1.3 and 1.3.8.2

version 1.3, 2000/03/17 11:47:43 version 1.3.8.2, 2002/06/23 17:51:55
Line 76 
Line 76 
 #ifndef _LOCORE  #ifndef _LOCORE
 /* C-family endian-ness definitions */  /* C-family endian-ness definitions */
   
   #include <sys/ansi.h>
 #include <sys/cdefs.h>  #include <sys/cdefs.h>
 #include <sys/types.h>  #include <sys/types.h>
   
 typedef u_int32_t       in_addr_t;  #ifndef in_addr_t
 typedef u_int16_t       in_port_t;  typedef __in_addr_t     in_addr_t;
   #define in_addr_t       __in_addr_t
   #endif
   
   #ifndef in_port_t
   typedef __in_port_t     in_port_t;
   #define in_port_t       __in_port_t
   #endif
   
 __BEGIN_DECLS  __BEGIN_DECLS
 in_addr_t       htonl __P((in_addr_t)) __attribute__((__const__));  uint32_t        htonl __P((uint32_t)) __attribute__((__const__));
 in_port_t       htons __P((in_port_t)) __attribute__((__const__));  uint16_t        htons __P((uint16_t)) __attribute__((__const__));
 in_addr_t       ntohl __P((in_addr_t)) __attribute__((__const__));  uint32_t        ntohl __P((uint32_t)) __attribute__((__const__));
 in_port_t       ntohs __P((in_port_t)) __attribute__((__const__));  uint16_t        ntohs __P((uint16_t)) __attribute__((__const__));
 __END_DECLS  __END_DECLS
   
 /*  /*
Line 105  __END_DECLS
Line 113  __END_DECLS
   
 #else   /* LITTLE_ENDIAN || !defined(lint) */  #else   /* LITTLE_ENDIAN || !defined(lint) */
   
 #define NTOHL(x)        (x) = ntohl((in_addr_t)(x))  #define NTOHL(x)        (x) = ntohl((uint32_t)(x))
 #define NTOHS(x)        (x) = ntohs((in_port_t)(x))  #define NTOHS(x)        (x) = ntohs((uint16_t)(x))
 #define HTONL(x)        (x) = htonl((in_addr_t)(x))  #define HTONL(x)        (x) = htonl((uint32_t)(x))
 #define HTONS(x)        (x) = htons((in_port_t)(x))  #define HTONS(x)        (x) = htons((uint16_t)(x))
 #endif  /* LITTLE_ENDIAN || !defined(lint) */  #endif  /* LITTLE_ENDIAN || !defined(lint) */
   
 /*  /*

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.3.8.2

CVSweb <webmaster@jp.NetBSD.org>