My Project
Chargement...
Recherche...
Aucune correspondance
inet.c
Aller à la documentation de ce fichier.
1
3#include <arpa/inet.h>
4
5static inline uint16 htons(uint16 x)
6{
7#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
8 return __builtin_bswap16(x);
9#else
10 return x;
11#endif
12}
13
14static inline uint16 ntohs(uint16 x)
15{
16 return htons(x);
17}
18
19static inline uint32 htonl(uint32 x)
20{
21#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
22 return __builtin_bswap32(x);
23#else
24 return x;
25#endif
26}
27
28static inline uint32 ntohl(uint32 x)
29{
30 return htonl(x);
31}
Définition des fonctions de base.