Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

147 lines
4.7 KiB

  1. /***
  2. *cruntime.h - definitions specific to the target operating system and hardware
  3. *
  4. * Copyright (c) 1990-2001, Microsoft Corporation. All rights reserved.
  5. *
  6. *Purpose:
  7. * This header file contains widely used definitions specific to the
  8. * host operating system and hardware. It is included by every C source
  9. * and most every other header file.
  10. *
  11. * [Internal]
  12. *
  13. *Revision History:
  14. * 02-27-90 GJF File created
  15. * 03-06-90 GJF Added register macros (REG1,...,etc.)
  16. * 04-11-90 GJF Set _CALLTYPE1 and _CALLTYPE4 to _stdcall.
  17. * 10-30-90 GJF Added macros defining variable args interface.
  18. * 10-31-90 GJF Added definition of _JBLEN (from setjmp.h).
  19. * 11-13-90 GJF Revised #ifdef-s, now use symbolic constants
  20. * representing target OS and target processor, with
  21. * #error directives for unsupported targets. Note the
  22. * general grouping of only OS-dependent definitions
  23. * followed by OS and processor dependent definitions.
  24. * 02-25-91 SRW Move _JBLEN definition back to setjmp.h [_WIN32_]
  25. * 04-09-91 PNT Added _MAC_ definitions
  26. * 05-09-91 GJF Restored _JBLEN definitions. Also fixed the macros
  27. * defining the target processor so both Stevewo's stuff
  28. * and mine would work.
  29. * 05-13-91 GJF Changed _CALLTYPE1 and _CALLTYPE4 to _cdecl for
  30. * Cruiser (_CRUISER_).
  31. * 08-28-91 JCR ANSI keywords
  32. * 11-01-91 GDP _JBLEN back to setjmp.h, stdarg macros back to stdarg.h
  33. * 03-30-92 DJM POSIX support.
  34. * 08-07-92 GJF Revised various macros.
  35. * 09-08-92 GJF Restored definition of _MIPS_ (temporarily).
  36. * 11-09-92 GJF Revised preprocessing conditionals for MIPS.
  37. * 01-09-93 SRW Remove usage of MIPS and ALPHA to conform to ANSI
  38. * Use _MIPS_ and _ALPHA_ instead.
  39. * 02-01-93 GJF Removed support for C6-386.
  40. * 04-06-93 SKS Remove support for OS/2, MAC, POSIX, MIPS, etc.
  41. * 11-11-93 GJF Merged in NT SDK version. Note that having
  42. * definitions for the variable-argument access macros
  43. * in this file is probably obsolete - this needs to be
  44. * checked.
  45. * 10-02-94 BWT Add PPC support.
  46. * 10-09-94 BWT Unknown platform changes from John Morgan.
  47. * 12-15-94 XY merged with mac header
  48. * 02-14-95 CFW Clean up Mac merge.
  49. * 03-29-95 CFW Add error message to internal headers.
  50. * 12-14-95 JWM Add "#pragma once".
  51. * 02-24-97 GJF Detab-ed.
  52. * 10-07-97 RDL Added IA64.
  53. * 05-17-99 PML Remove all Macintosh support.
  54. * 11-03-99 PML Remove _VA_LIST_T
  55. * 03-18-01 PML Define _USE_OLD_STDCPP when compiling with stdcpp64
  56. * and stdhpp64, for the Win64 system CRTs.
  57. *
  58. ****/
  59. #if _MSC_VER > 1000 /*IFSTRIP=IGN*/
  60. #pragma once
  61. #endif
  62. #ifndef _INC_CRUNTIME
  63. #define _INC_CRUNTIME
  64. #ifndef _CRTBLD
  65. /*
  66. * This is an internal C runtime header file. It is used when building
  67. * the C runtimes only. It is not to be used as a public header file.
  68. */
  69. #error ERROR: Use of C runtime library internal header file.
  70. #endif /* _CRTBLD */
  71. #if defined(_SYSCRT) && defined(_WIN64)
  72. #define _USE_OLD_STDCPP 1
  73. #endif
  74. #if defined(_AMD64_) || defined(_M_MRX000) || defined(_M_ALPHA) || defined(_M_PPC) || defined(_M_IA64)
  75. #define UNALIGNED __unaligned
  76. #else
  77. #define UNALIGNED
  78. #endif
  79. #ifdef _M_IX86
  80. /*
  81. * 386/486
  82. */
  83. #define REG1 register
  84. #define REG2 register
  85. #define REG3 register
  86. #define REG4
  87. #define REG5
  88. #define REG6
  89. #define REG7
  90. #define REG8
  91. #define REG9
  92. #elif ( defined(_M_AMD64) || defined(_M_MRX000) || defined(_M_ALPHA) || defined(_M_PPC) || defined(_M_IA64) )
  93. /*
  94. * MIPS, ALPHA, or PPC
  95. */
  96. #define REG1 register
  97. #define REG2 register
  98. #define REG3 register
  99. #define REG4 register
  100. #define REG5 register
  101. #define REG6 register
  102. #define REG7 register
  103. #define REG8 register
  104. #define REG9 register
  105. #else
  106. #pragma message ("Machine register set not defined")
  107. /*
  108. * Unknown machine
  109. */
  110. #define REG1
  111. #define REG2
  112. #define REG3
  113. #define REG4
  114. #define REG5
  115. #define REG6
  116. #define REG7
  117. #define REG8
  118. #define REG9
  119. #endif
  120. /*
  121. * Are the macro definitions below still needed in this file? Are they even
  122. * correct for MIPS (probably not).
  123. */
  124. #if defined(_POSIX_) && !defined(_M_ALPHA)
  125. #define _INTSIZEOF(n) ( (sizeof(n) + sizeof(int) - 1) & ~(sizeof(int) - 1) )
  126. #define _VA_START(ap,v) ap = (va_list)&v + _INTSIZEOF(v)
  127. #define _VA_ARG(ap,t) ( *(t *)((ap += _INTSIZEOF(t)) - _INTSIZEOF(t)) )
  128. #define _VA_END(ap) ap = (va_list)0
  129. #endif
  130. #endif /* _INC_CRUNTIME */