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.

122 lines
2.0 KiB

  1. /***
  2. *stddef.h - definitions/declarations for common constants, types, variables
  3. *
  4. * Copyright (c) 1985-1994, Microsoft Corporation. All rights reserved.
  5. *
  6. *Purpose:
  7. * This file contains definitions and declarations for some commonly
  8. * used constants, types, and variables.
  9. * [ANSI]
  10. *
  11. ****/
  12. #ifndef _INC_STDDEF
  13. #define _INC_STDDEF
  14. #ifdef __cplusplus
  15. extern "C" {
  16. #endif
  17. /* Define _CRTAPI1 (for compatibility with the NT SDK) */
  18. #ifndef _CRTAPI1
  19. #if ( (_MSC_VER >= 800) && (_M_IX86 >= 300) )
  20. #define _CRTAPI1 __cdecl
  21. #else
  22. #define _CRTAPI1
  23. #endif
  24. #endif
  25. /* Define _CRTAPI2 (for compatibility with the NT SDK) */
  26. #ifndef _CRTAPI2
  27. #if ( (_MSC_VER >= 800) && (_M_IX86 >= 300) )
  28. #define _CRTAPI2 __cdecl
  29. #else
  30. #define _CRTAPI2
  31. #endif
  32. #endif
  33. /* Define _CRTIMP */
  34. #ifndef _CRTIMP
  35. #ifdef _NTSDK
  36. /* definition compatible with NT SDK */
  37. #define _CRTIMP
  38. #else /* ndef _NTSDK */
  39. /* current definition */
  40. #ifdef _DLL
  41. #define _CRTIMP __declspec(dllimport)
  42. #else /* ndef _DLL */
  43. #define _CRTIMP
  44. #endif /* _DLL */
  45. #endif /* _NTSDK */
  46. #endif /* _CRTIMP */
  47. /* Define __cdecl for non-Microsoft compilers */
  48. #if ( !defined(_MSC_VER) && !defined(__cdecl) )
  49. #define __cdecl
  50. #endif
  51. /* Define NULL pointer value and the offset() macro */
  52. #ifndef NULL
  53. #ifdef __cplusplus
  54. #define NULL 0
  55. #else
  56. #define NULL ((void *)0)
  57. #endif
  58. #endif
  59. #define offsetof(s,m) (size_t)&(((s *)0)->m)
  60. /* Declare reference to errno */
  61. #ifdef _MT
  62. _CRTIMP extern int * __cdecl _errno(void);
  63. #define errno (*_errno())
  64. #else
  65. _CRTIMP extern int errno;
  66. #endif
  67. /* define the implementation dependent size types */
  68. #ifndef _PTRDIFF_T_DEFINED
  69. typedef int ptrdiff_t;
  70. #define _PTRDIFF_T_DEFINED
  71. #endif
  72. #ifndef _SIZE_T_DEFINED
  73. typedef unsigned int size_t;
  74. #define _SIZE_T_DEFINED
  75. #endif
  76. #ifndef _WCHAR_T_DEFINED
  77. typedef unsigned short wchar_t;
  78. #define _WCHAR_T_DEFINED
  79. #endif
  80. #ifdef _MT
  81. _CRTIMP extern unsigned long __cdecl __threadid(void);
  82. #define _threadid (__threadid())
  83. _CRTIMP extern unsigned long __cdecl __threadhandle(void);
  84. #endif
  85. #ifdef __cplusplus
  86. }
  87. #endif
  88. #endif /* _INC_STDDEF */