inaddr.h 807 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /**
  2. * This file has no copyright assigned and is placed in the Public Domain.
  3. * This file is part of the mingw-w64 runtime package.
  4. * No warranty is given; refer to the file DISCLAIMER.PD within this package.
  5. */
  6. #ifndef s_addr
  7. #ifdef __LP64__
  8. #pragma push_macro("u_long")
  9. #undef u_long
  10. #define u_long __ms_u_long
  11. #endif
  12. #include <_bsd_types.h>
  13. typedef struct in_addr {
  14. union {
  15. struct { u_char s_b1, s_b2, s_b3, s_b4; } S_un_b;
  16. struct { u_short s_w1, s_w2; } S_un_w;
  17. u_long S_addr;
  18. } S_un;
  19. } IN_ADDR, *PIN_ADDR, *LPIN_ADDR;
  20. #define s_addr S_un.S_addr
  21. #define s_host S_un.S_un_b.s_b2
  22. #define s_net S_un.S_un_b.s_b1
  23. #define s_imp S_un.S_un_w.s_w2
  24. #define s_impno S_un.S_un_b.s_b4
  25. #define s_lh S_un.S_un_b.s_b3
  26. #ifdef __LP64__
  27. #pragma pop_macro("u_long")
  28. #endif
  29. #endif /* s_addr */