socket.h 696 B

123456789101112131415161718192021222324252627282930313233
  1. /*
  2. * src/include/port/win32/sys/socket.h
  3. */
  4. #ifndef WIN32_SYS_SOCKET_H
  5. #define WIN32_SYS_SOCKET_H
  6. /*
  7. * Unfortunately, <wingdi.h> of VC++ also defines ERROR.
  8. * To avoid the conflict, we include <windows.h> here and undefine ERROR
  9. * immediately.
  10. *
  11. * Note: Don't include <wingdi.h> directly. It causes compile errors.
  12. */
  13. #include <winsock2.h>
  14. #include <ws2tcpip.h>
  15. #include <windows.h>
  16. #undef ERROR
  17. #undef small
  18. /* Restore old ERROR value */
  19. #ifdef PGERROR
  20. #define ERROR PGERROR
  21. #endif
  22. /*
  23. * we can't use the windows gai_strerror{AW} functions because
  24. * they are defined inline in the MS header files. So we'll use our
  25. * own
  26. */
  27. #undef gai_strerror
  28. #endif /* WIN32_SYS_SOCKET_H */