need_errno.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. /***
  2. * errno.h - system wide error numbers (set by system calls)
  3. *
  4. * Copyright (c) 1985-1997, Microsoft Corporation. All rights reserved.
  5. *
  6. * Purpose:
  7. * This file defines the system-wide error numbers (set by
  8. * system calls). Conforms to the XENIX standard. Extended
  9. * for compatibility with Uniforum standard.
  10. * [System V]
  11. *
  12. * [Public]
  13. *
  14. ****/
  15. #if _MSC_VER > 1000
  16. #pragma once
  17. #endif
  18. #if !defined(_INC_ERRNO)
  19. #define _INC_ERRNO
  20. #if !defined(_WIN32)
  21. #error ERROR: Only Win32 targets supported!
  22. #endif
  23. #include <winsock.h>
  24. #if defined(__cplusplus)
  25. extern "C" {
  26. #endif
  27. /* Define _CRTIMP */
  28. #ifndef _CRTIMP
  29. #if defined(_DLL)
  30. #define _CRTIMP __declspec(dllimport)
  31. #else /* ndef _DLL */
  32. #define _CRTIMP
  33. #endif /* _DLL */
  34. #endif /* _CRTIMP */
  35. /* Define __cdecl for non-Microsoft compilers */
  36. #if ( !defined(_MSC_VER) && !defined(__cdecl) )
  37. #define __cdecl
  38. #endif
  39. /* Define _CRTAPI1 (for compatibility with the NT SDK) */
  40. #if !defined(_CRTAPI1)
  41. #if _MSC_VER >= 800 && _M_IX86 >= 300
  42. #define _CRTAPI1 __cdecl
  43. #else
  44. #define _CRTAPI1
  45. #endif
  46. #endif
  47. #if !defined(PTW32_STATIC_LIB)
  48. # if defined(PTW32_BUILD)
  49. # define PTW32_DLLPORT __declspec (dllexport)
  50. # else
  51. # define PTW32_DLLPORT __declspec (dllimport)
  52. # endif
  53. #else
  54. # define PTW32_DLLPORT
  55. #endif
  56. /* declare reference to errno */
  57. #if (defined(_MT) || defined(_MD) || defined(_DLL)) && !defined(_MAC)
  58. PTW32_DLLPORT int * __cdecl _errno(void);
  59. #define errno (*_errno())
  60. #else /* ndef _MT && ndef _MD && ndef _DLL */
  61. _CRTIMP extern int errno;
  62. #endif /* _MT || _MD || _DLL */
  63. /* Error Codes */
  64. #define EPERM 1
  65. #define ENOENT 2
  66. #define ESRCH 3
  67. #define EINTR 4
  68. #define EIO 5
  69. #define ENXIO 6
  70. #define E2BIG 7
  71. #define ENOEXEC 8
  72. #define EBADF 9
  73. #define ECHILD 10
  74. #define EAGAIN 11
  75. #define ENOMEM 12
  76. #define EACCES 13
  77. #define EFAULT 14
  78. #define EBUSY 16
  79. #define EEXIST 17
  80. #define EXDEV 18
  81. #define ENODEV 19
  82. #define ENOTDIR 20
  83. #define EISDIR 21
  84. #define EINVAL 22
  85. #define ENFILE 23
  86. #define EMFILE 24
  87. #define ENOTTY 25
  88. #define EFBIG 27
  89. #define ENOSPC 28
  90. #define ESPIPE 29
  91. #define EROFS 30
  92. #define EMLINK 31
  93. #define EPIPE 32
  94. #define EDOM 33
  95. #define ERANGE 34
  96. #define EDEADLK 36
  97. /* defined differently in winsock.h on WinCE */
  98. #if !defined(ENAMETOOLONG)
  99. #define ENAMETOOLONG 38
  100. #endif
  101. #define ENOLCK 39
  102. #define ENOSYS 40
  103. /* defined differently in winsock.h on WinCE */
  104. #if !defined(ENOTEMPTY)
  105. #define ENOTEMPTY 41
  106. #endif
  107. #define EILSEQ 42
  108. /* POSIX 2008 - robust mutexes */
  109. #define EOWNERDEAD 43
  110. #define ENOTRECOVERABLE 44
  111. /*
  112. * Support EDEADLOCK for compatibiity with older MS-C versions.
  113. */
  114. #define EDEADLOCK EDEADLK
  115. #if defined(__cplusplus)
  116. }
  117. #endif
  118. #endif /* _INC_ERRNO */