home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / crt / src / errno.h < prev    next >
C/C++ Source or Header  |  1998-06-17  |  3KB  |  136 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  /* _MSC_VER > 1000 */
  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  /* !defined (_WIN32) && !defined (_MAC) */
  26.  
  27. #ifndef _CRTBLD
  28. /* This version of the header files is NOT for user programs.
  29.  * It is intended for use when building the C runtimes ONLY.
  30.  * The version intended for public use will not have this message.
  31.  */
  32. #error ERROR: Use of C runtime library internal header file.
  33. #endif  /* _CRTBLD */
  34.  
  35. #ifdef __cplusplus
  36. extern "C" {
  37. #endif  /* __cplusplus */
  38.  
  39. #ifndef _INTERNAL_IFSTRIP_
  40. #include <cruntime.h>
  41. #endif  /* _INTERNAL_IFSTRIP_ */
  42.  
  43.  
  44. /* Define _CRTIMP */
  45.  
  46. #ifndef _CRTIMP
  47. #ifdef CRTDLL
  48. #define _CRTIMP __declspec(dllexport)
  49. #else  /* CRTDLL */
  50. #ifdef _DLL
  51. #define _CRTIMP __declspec(dllimport)
  52. #else  /* _DLL */
  53. #define _CRTIMP
  54. #endif  /* _DLL */
  55. #endif  /* CRTDLL */
  56. #endif  /* _CRTIMP */
  57.  
  58.  
  59. /* Define __cdecl for non-Microsoft compilers */
  60.  
  61. #if (!defined (_MSC_VER) && !defined (__cdecl))
  62. #define __cdecl
  63. #endif  /* (!defined (_MSC_VER) && !defined (__cdecl)) */
  64.  
  65. /* Define _CRTAPI1 (for compatibility with the NT SDK) */
  66.  
  67. #ifndef _CRTAPI1
  68. #if _MSC_VER >= 800 && _M_IX86 >= 300
  69. #define _CRTAPI1 __cdecl
  70. #else  /* _MSC_VER >= 800 && _M_IX86 >= 300 */
  71. #define _CRTAPI1
  72. #endif  /* _MSC_VER >= 800 && _M_IX86 >= 300 */
  73. #endif  /* _CRTAPI1 */
  74.  
  75.  
  76. /* declare reference to errno */
  77.  
  78. #if (defined (_MT) || defined (_DLL)) && !defined (_MAC)
  79. _CRTIMP extern int * __cdecl _errno(void);
  80. #define errno   (*_errno())
  81. #else  /* (defined (_MT) || defined (_DLL)) && !defined (_MAC) */
  82. _CRTIMP extern int errno;
  83. #endif  /* (defined (_MT) || defined (_DLL)) && !defined (_MAC) */
  84.  
  85. /* Error Codes */
  86.  
  87. #define EPERM           1
  88. #define ENOENT          2
  89. #define ESRCH           3
  90. #define EINTR           4
  91. #define EIO             5
  92. #define ENXIO           6
  93. #define E2BIG           7
  94. #define ENOEXEC         8
  95. #define EBADF           9
  96. #define ECHILD          10
  97. #define EAGAIN          11
  98. #define ENOMEM          12
  99. #define EACCES          13
  100. #define EFAULT          14
  101. #define EBUSY           16
  102. #define EEXIST          17
  103. #define EXDEV           18
  104. #define ENODEV          19
  105. #define ENOTDIR         20
  106. #define EISDIR          21
  107. #define EINVAL          22
  108. #define ENFILE          23
  109. #define EMFILE          24
  110. #define ENOTTY          25
  111. #define EFBIG           27
  112. #define ENOSPC          28
  113. #define ESPIPE          29
  114. #define EROFS           30
  115. #define EMLINK          31
  116. #define EPIPE           32
  117. #define EDOM            33
  118. #define ERANGE          34
  119. #define EDEADLK         36
  120. #define ENAMETOOLONG    38
  121. #define ENOLCK          39
  122. #define ENOSYS          40
  123. #define ENOTEMPTY       41
  124. #define EILSEQ          42
  125.  
  126. /*
  127.  * Support EDEADLOCK for compatibiity with older MS-C versions.
  128.  */
  129. #define EDEADLOCK       EDEADLK
  130.  
  131. #ifdef __cplusplus
  132. }
  133. #endif  /* __cplusplus */
  134.  
  135. #endif  /* _INC_ERRNO */
  136.