windows_common.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. /*
  2. +----------------------------------------------------------------------+
  3. | PHP Version 5 |
  4. +----------------------------------------------------------------------+
  5. | Copyright (c) 1997-2016 The PHP Group |
  6. +----------------------------------------------------------------------+
  7. | This source file is subject to version 3.01 of the PHP license, |
  8. | that is bundled with this package in the file LICENSE, and is |
  9. | available through the world-wide-web at the following url: |
  10. | http://www.php.net/license/3_01.txt |
  11. | If you did not receive a copy of the PHP license and are unable to |
  12. | obtain it through the world-wide-web, please send a note to |
  13. | license@php.net so we can mail you a copy immediately. |
  14. +----------------------------------------------------------------------+
  15. */
  16. #ifndef WINDOWS_COMMON_H
  17. #define WINDOWS_COMMON_H
  18. #include <Winsock2.h>
  19. #define NTDDI_XP NTDDI_WINXP /* bug in SDK */
  20. #include <IPHlpApi.h> /* conflicting definition of CMSG_DATA */
  21. #undef NTDDI_XP
  22. #define HAVE_IF_NAMETOINDEX 1
  23. #define IS_INVALID_SOCKET(a) (a->bsd_socket == INVALID_SOCKET)
  24. #ifdef errno
  25. # undef errno
  26. #endif
  27. #define errno WSAGetLastError()
  28. #define h_errno WSAGetLastError()
  29. #define set_errno(a) WSASetLastError(a)
  30. #define close(a) closesocket(a)
  31. #ifdef ENETUNREACH /* errno.h probably included */
  32. # undef EWOULDBLOCK
  33. # undef EINPROGRESS
  34. # undef EALREADY
  35. # undef ENOTSOCK
  36. # undef EDESTADDRREQ
  37. # undef EMSGSIZE
  38. # undef EPROTOTYPE
  39. # undef ENOPROTOOPT
  40. # undef EPROTONOSUPPORT
  41. # undef ESOCKTNOSUPPORT
  42. # undef EOPNOTSUPP
  43. # undef EPFNOSUPPORT
  44. # undef EAFNOSUPPORT
  45. # undef EADDRINUSE
  46. # undef EADDRNOTAVAIL
  47. # undef ENETDOWN
  48. # undef ENETUNREACH
  49. # undef ENETRESET
  50. # undef ECONNABORTED
  51. # undef ECONNRESET
  52. # undef ENOBUFS
  53. # undef EISCONN
  54. # undef ENOTCONN
  55. # undef ESHUTDOWN
  56. # undef ETOOMANYREFS
  57. # undef ETIMEDOUT
  58. # undef ECONNREFUSED
  59. # undef ELOOP
  60. # undef ENAMETOOLONG
  61. # undef EHOSTDOWN
  62. # undef EHOSTUNREACH
  63. # undef ENOTEMPTY
  64. # undef EPROCLIM
  65. # undef EUSERS
  66. # undef EDQUOT
  67. # undef ESTALE
  68. # undef EREMOTE
  69. # undef EAGAIN
  70. #endif
  71. /* section disabled in WinSock2.h */
  72. #define EWOULDBLOCK WSAEWOULDBLOCK
  73. #define EINPROGRESS WSAEINPROGRESS
  74. #define EALREADY WSAEALREADY
  75. #define ENOTSOCK WSAENOTSOCK
  76. #define EDESTADDRREQ WSAEDESTADDRREQ
  77. #define EMSGSIZE WSAEMSGSIZE
  78. #define EPROTOTYPE WSAEPROTOTYPE
  79. #define ENOPROTOOPT WSAENOPROTOOPT
  80. #define EPROTONOSUPPORT WSAEPROTONOSUPPORT
  81. #define ESOCKTNOSUPPORT WSAESOCKTNOSUPPORT
  82. #define EOPNOTSUPP WSAEOPNOTSUPP
  83. #define EPFNOSUPPORT WSAEPFNOSUPPORT
  84. #define EAFNOSUPPORT WSAEAFNOSUPPORT
  85. #define EADDRINUSE WSAEADDRINUSE
  86. #define EADDRNOTAVAIL WSAEADDRNOTAVAIL
  87. #define ENETDOWN WSAENETDOWN
  88. #define ENETUNREACH WSAENETUNREACH
  89. #define ENETRESET WSAENETRESET
  90. #define ECONNABORTED WSAECONNABORTED
  91. #define ECONNRESET WSAECONNRESET
  92. #define ENOBUFS WSAENOBUFS
  93. #define EISCONN WSAEISCONN
  94. #define ENOTCONN WSAENOTCONN
  95. #define ESHUTDOWN WSAESHUTDOWN
  96. #define ETOOMANYREFS WSAETOOMANYREFS
  97. #define ETIMEDOUT WSAETIMEDOUT
  98. #define ECONNREFUSED WSAECONNREFUSED
  99. #define ELOOP WSAELOOP
  100. #define ENAMETOOLONG WSAENAMETOOLONG
  101. #define EHOSTDOWN WSAEHOSTDOWN
  102. #define EHOSTUNREACH WSAEHOSTUNREACH
  103. #define ENOTEMPTY WSAENOTEMPTY
  104. #define EPROCLIM WSAEPROCLIM
  105. #define EUSERS WSAEUSERS
  106. #define EDQUOT WSAEDQUOT
  107. #define ESTALE WSAESTALE
  108. #define EREMOTE WSAEREMOTE
  109. /* and an extra one */
  110. #define EAGAIN WSAEWOULDBLOCK
  111. #endif