home *** CD-ROM | disk | FTP | other *** search
/ Beginning C++ Through Gam…rogramming (2nd Edition) / BCGP2E.ISO / bloodshed / devcpp-4.9.9.2_setup.exe / _mingw.h next >
C/C++ Source or Header  |  2005-01-29  |  4KB  |  149 lines

  1. /*
  2.  * _mingw.h
  3.  *
  4.  * Mingw specific macros included by ALL include files. 
  5.  *
  6.  * This file is part of the Mingw32 package.
  7.  *
  8.  * Contributors:
  9.  *  Created by Mumit Khan  <khan@xraylith.wisc.edu>
  10.  *
  11.  *  THIS SOFTWARE IS NOT COPYRIGHTED
  12.  *
  13.  *  This source code is offered for use in the public domain. You may
  14.  *  use, modify or distribute it freely.
  15.  *
  16.  *  This code is distributed in the hope that it will be useful but
  17.  *  WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
  18.  *  DISCLAIMED. This includes but is not limited to warranties of
  19.  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  20.  *
  21.  */
  22.  
  23. #ifndef __MINGW_H
  24. #define __MINGW_H
  25.  
  26. /* These are defined by the user (or the compiler)
  27.    to specify how identifiers are imported from a DLL.
  28.  
  29.    __DECLSPEC_SUPPORTED    Defined if dllimport attribute is supported.
  30.    __MINGW_IMPORT          The attribute definition to specify imported
  31.                            variables/functions. 
  32.    _CRTIMP                 As above.  For MS compatibility.  
  33.    __MINGW32_VERSION       Runtime version.
  34.    __MINGW32_MAJOR_VERSION Runtime major version.
  35.    __MINGW32_MINOR_VERSION Runtime minor version.
  36.    __MINGW32_BUILD_DATE    Runtime build date.
  37.    
  38.    Other macros:
  39.  
  40.    __int64                 define to be long long. Using a typedef doesn't
  41.                            work for "unsigned __int64"
  42.   
  43.    All headers should include this first, and then use __DECLSPEC_SUPPORTED
  44.    to choose between the old ``__imp__name'' style or __MINGW_IMPORT
  45.    style declarations.  */
  46.  
  47. /* Try to avoid problems with outdated checks for GCC __attribute__ support.  */ 
  48. #undef __attribute__
  49.  
  50. #ifndef __GNUC__
  51. # ifndef __MINGW_IMPORT
  52. #  define __MINGW_IMPORT  __declspec(dllimport)
  53. # endif
  54. # ifndef _CRTIMP
  55. #  define _CRTIMP  __declspec(dllimport)
  56. # endif
  57. # define __DECLSPEC_SUPPORTED
  58. # define __attribute__(x) /* nothing */
  59. #else /* __GNUC__ */
  60. # ifdef __declspec
  61. #  ifndef __MINGW_IMPORT
  62.    /* Note the extern. This is needed to work around GCC's
  63.       limitations in handling dllimport attribute.  */
  64. #   define __MINGW_IMPORT  extern __attribute__ ((dllimport))
  65. #  endif
  66. #  ifndef _CRTIMP
  67. #   ifdef __USE_CRTIMP
  68. #    define _CRTIMP  __attribute__ ((dllimport))
  69. #   else  
  70. #    define _CRTIMP
  71. #   endif
  72. #  endif
  73. #  define __DECLSPEC_SUPPORTED
  74. # else /* __declspec */
  75. #  undef __DECLSPEC_SUPPORTED
  76. #  undef __MINGW_IMPORT
  77. #  ifndef _CRTIMP
  78. #   define _CRTIMP
  79. #  endif
  80. # endif /* __declspec */
  81. # ifndef __cdecl
  82. #  define __cdecl __attribute__ ((__cdecl__))
  83. # endif
  84. # ifndef __stdcall
  85. #  define __stdcall __attribute__ ((__stdcall__))
  86. # endif
  87. # ifndef __int64
  88. #  define __int64 long long
  89. # endif
  90. # ifndef __int32
  91. #  define __int32 long
  92. # endif
  93. # ifndef __int16
  94. #  define __int16 short
  95. # endif
  96. # ifndef __int8
  97. #  define __int8 char
  98. # endif
  99. # ifndef __small
  100. #  define __small char
  101. # endif
  102. # ifndef __hyper
  103. #  define __hyper long long
  104. # endif
  105. #endif /* __GNUC__ */
  106.  
  107. #ifdef __cplusplus
  108. #define __CRT_INLINE inline
  109. #else
  110. #define __CRT_INLINE extern __inline__
  111. #endif
  112.  
  113. #ifdef __cplusplus
  114. # define __UNUSED_PARAM(x) 
  115. #else 
  116. # ifdef __GNUC__
  117. #  define __UNUSED_PARAM(x) x __attribute__ ((__unused__))
  118. # else
  119. #  define __UNUSED_PARAM(x) x
  120. # endif
  121. #endif
  122.  
  123. #ifdef __GNUC__
  124. #define __MINGW_ATTRIB_NORETURN __attribute__ ((__noreturn__))
  125. #define __MINGW_ATTRIB_CONST __attribute__ ((__const__))
  126. #else
  127. #define __MINGW_ATTRIB_NORETURN
  128. #define __MINGW_ATTRIB_CONST
  129. #endif
  130.  
  131. #if ( __GNUC__ >= 3)
  132. #define __MINGW_ATTRIB_MALLOC __attribute__ ((__malloc__))
  133. #define __MINGW_ATTRIB_PURE __attribute__ ((__pure__))
  134. #else
  135. #define __MINGW_ATTRIB_MALLOC
  136. #define __MINGW_ATTRIB_PURE
  137. #endif
  138.  
  139. #ifndef __MSVCRT_VERSION__
  140. /*  High byte is the major version, low byte is the minor. */
  141. # define __MSVCRT_VERSION__ 0x0600
  142. #endif
  143.  
  144. #define __MINGW32_VERSION 3.7
  145. #define __MINGW32_MAJOR_VERSION 3
  146. #define __MINGW32_MINOR_VERSION 7
  147.  
  148. #endif /* __MINGW_H */
  149.