home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / include / errno.h < prev    next >
C/C++ Source or Header  |  1998-06-16  |  3KB  |  122 lines

  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.  
  16. #if     _MSC_VER > 1000
  17. #pragma once
  18. #endif
  19.  
  20. #ifndef _INC_ERRNO
  21. #define _INC_ERRNO
  22.  
  23. #if     !defined(_WIN32) && !defined(_MAC)
  24. #error ERROR: Only Mac or Win32 targets supported!
  25. #endif
  26.  
  27.  
  28. #ifdef  __cplusplus
  29. extern "C" {
  30. #endif
  31.  
  32.  
  33.  
  34. /* Define _CRTIMP */
  35.  
  36. #ifndef _CRTIMP
  37. #ifdef  _DLL
  38. #define _CRTIMP __declspec(dllimport)
  39. #else   /* ndef _DLL */
  40. #define _CRTIMP
  41. #endif  /* _DLL */
  42. #endif  /* _CRTIMP */
  43.  
  44.  
  45. /* Define __cdecl for non-Microsoft compilers */
  46.  
  47. #if     ( !defined(_MSC_VER) && !defined(__cdecl) )
  48. #define __cdecl
  49. #endif
  50.  
  51. /* Define _CRTAPI1 (for compatibility with the NT SDK) */
  52.  
  53. #ifndef _CRTAPI1
  54. #if    _MSC_VER >= 800 && _M_IX86 >= 300
  55. #define _CRTAPI1 __cdecl
  56. #else
  57. #define _CRTAPI1
  58. #endif
  59. #endif
  60.  
  61.  
  62. /* declare reference to errno */
  63.  
  64. #if     (defined(_MT) || defined(_DLL)) && !defined(_MAC)
  65. _CRTIMP extern int * __cdecl _errno(void);
  66. #define errno   (*_errno())
  67. #else   /* ndef _MT && ndef _DLL */
  68. _CRTIMP extern int errno;
  69. #endif  /* _MT || _DLL */
  70.  
  71. /* Error Codes */
  72.  
  73. #define EPERM           1
  74. #define ENOENT          2
  75. #define ESRCH           3
  76. #define EINTR           4
  77. #define EIO             5
  78. #define ENXIO           6
  79. #define E2BIG           7
  80. #define ENOEXEC         8
  81. #define EBADF           9
  82. #define ECHILD          10
  83. #define EAGAIN          11
  84. #define ENOMEM          12
  85. #define EACCES          13
  86. #define EFAULT          14
  87. #define EBUSY           16
  88. #define EEXIST          17
  89. #define EXDEV           18
  90. #define ENODEV          19
  91. #define ENOTDIR         20
  92. #define EISDIR          21
  93. #define EINVAL          22
  94. #define ENFILE          23
  95. #define EMFILE          24
  96. #define ENOTTY          25
  97. #define EFBIG           27
  98. #define ENOSPC          28
  99. #define ESPIPE          29
  100. #define EROFS           30
  101. #define EMLINK          31
  102. #define EPIPE           32
  103. #define EDOM            33
  104. #define ERANGE          34
  105. #define EDEADLK         36
  106. #define ENAMETOOLONG    38
  107. #define ENOLCK          39
  108. #define ENOSYS          40
  109. #define ENOTEMPTY       41
  110. #define EILSEQ          42
  111.  
  112. /*
  113.  * Support EDEADLOCK for compatibiity with older MS-C versions.
  114.  */
  115. #define EDEADLOCK       EDEADLK
  116.  
  117. #ifdef  __cplusplus
  118. }
  119. #endif
  120.  
  121. #endif  /* _INC_ERRNO */
  122.