Xwinsock.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /*
  2. Copyright 1996, 1998 The Open Group
  3. Permission to use, copy, modify, distribute, and sell this software and its
  4. documentation for any purpose is hereby granted without fee, provided that
  5. the above copyright notice appear in all copies and that both that
  6. copyright notice and this permission notice appear in supporting
  7. documentation.
  8. The above copyright notice and this permission notice shall be included
  9. in all copies or substantial portions of the Software.
  10. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  11. OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL-
  12. ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
  13. SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABIL-
  14. ITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  15. OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  16. IN THE SOFTWARE.
  17. Except as contained in this notice, the name of The Open Group shall
  18. not be used in advertising or otherwise to promote the sale, use or
  19. other dealings in this Software without prior written authorization from
  20. The Open Group.
  21. */
  22. /*
  23. * This header file has for sole purpose to allow to include winsock.h
  24. * without getting any name conflicts with our code.
  25. * Conflicts come from the fact that including winsock.h actually pulls
  26. * in the whole Windows API...
  27. */
  28. #undef _XFree86Server
  29. #ifdef XFree86Server
  30. # define _XFree86Server
  31. # undef XFree86Server
  32. #endif
  33. /*
  34. * mingw-w64 headers define BOOL as a typedef, protecting against macros
  35. * mingw.org headers define BOOL in terms of WINBOOL
  36. * ... so try to come up with something which works with both :-)
  37. */
  38. #define _NO_BOOL_TYPEDEF
  39. #define BOOL WINBOOL
  40. #define INT32 wINT32
  41. #undef Status
  42. #define Status wStatus
  43. #define ATOM wATOM
  44. #define BYTE wBYTE
  45. #define FreeResource wFreeResource
  46. #include <winsock2.h>
  47. #undef Status
  48. #define Status int
  49. #undef BYTE
  50. #undef BOOL
  51. #undef INT32
  52. #undef ATOM
  53. #undef FreeResource
  54. #undef CreateWindowA
  55. #undef RT_FONT
  56. #undef RT_CURSOR
  57. /*
  58. * Older version of this header used to name the windows API bool type wBOOL,
  59. * rather than more standard name WINBOOL
  60. */
  61. #define wBOOL WINBOOL
  62. #ifdef _XFree86Server
  63. # define XFree86Server
  64. # undef _XFree86Server
  65. #endif