home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / C / BC_502 / SERVICES.PAK / MSC.H < prev    next >
Encoding:
C/C++ Source or Header  |  1997-05-06  |  5.5 KB  |  179 lines

  1. //----------------------------------------------------------------------------
  2. // Borland Services Library
  3. // Copyright (c) 1995, 1997 by Borland International, All Rights Reserved
  4. //
  5. //$Revision:   5.11  $
  6. //
  7. // Compiler-specific defines for Microsoft Visual C/C++. Included only by
  8. // defs.h
  9. //
  10. //----------------------------------------------------------------------------
  11. #if !defined(SERVICES_MSC_H)
  12. #define SERVICES_MSC_H
  13.  
  14. //----------------------------------------------------------------------------
  15. //  OS-specific flags defined here for DOS, Win16, Win32 & OS/2
  16. //----------------------------------------------------------------------------
  17.  
  18. //
  19. //  Define a platform flag.
  20. //
  21. //      BI_PLAT_MSW         Microsoft Windows, all versions including console
  22. //      BI_PLAT_OS2         IBM OS/2
  23. //      BI_PLAT_DOS         DOS
  24. //
  25. #if defined(_Windows) || defined(_WINDOWS) || defined(_WIN32)
  26. # define BI_PLAT_MSW
  27. #elif defined(__OS2__)
  28. # define BI_PLAT_OS2
  29. #else
  30. # define BI_PLAT_DOS
  31. #endif
  32.  
  33. //
  34. //  Specify the Windows API if we're compiling for Windows. Must
  35. //  define one of:
  36. //
  37. //      BI_PLAT_WIN16       Microsoft Windows 16
  38. //      BI_PLAT_WIN32       Microsoft Win32
  39. //
  40. #if defined(BI_PLAT_MSW)
  41. # if defined(_WIN32) || defined(__FLAT__)
  42. #   define BI_PLAT_WIN32
  43. # else
  44. #   define BI_PLAT_WIN16
  45. # endif
  46. #endif
  47.  
  48. //
  49. //  Define the memory model when compiling for Windows 16 or DOS. Must
  50. //  define one of:
  51. //
  52. //      BI_MODEL_TINY       DOS/Windows tiny model
  53. //      BI_MODEL_SMALL      DOS/Windows small model
  54. //      BI_MODEL_COMPACT    DOS/Windows compact model
  55. //      BI_MODEL_MEDIUM     DOS/Windows medium model
  56. //      BI_MODEL_LARGE      DOS/Windows large model
  57. //      BI_MODEL_HUGE       DOS/Windows huge model
  58. //
  59. #if defined( BI_PLAT_WIN16 ) || defined( BI_PLAT_DOS )
  60. # if defined( __TINY__ )
  61. #   define BI_MODEL_TINY
  62. # elif defined( __SMALL__ )
  63. #   define BI_MODEL_SMALL
  64. # elif defined( __COMPACT__ )
  65. #   define BI_MODEL_COMPACT
  66. # elif defined( __MEDIUM__ )
  67. #   define BI_MODEL_MEDIUM
  68. # elif defined( __LARGE__ )
  69. #   define BI_MODEL_LARGE
  70. # elif defined( __HUGE__ )
  71. #   define BI_MODEL_HUGE
  72. # endif
  73. #endif
  74.  
  75. //
  76. //  Define the pointer size. Must define one of:
  77. //
  78. //      BI_PTR_16_16        Intel 16:16 pointer
  79. //      BI_PTR_0_32         32-bit flat pointer (including Intel 0:32)
  80. //
  81. #if defined(__FLAT__) || defined(BI_PLAT_WIN32) || defined(BI_PLAT_OS2)
  82. # define BI_PTR_0_32
  83. #else
  84. # define BI_PTR_16_16
  85. #endif
  86.  
  87. //  Specify the size of data pointers and code
  88. //  pointers if applicable. Must define one of:
  89. //
  90. //      BI_DATA_NEAR        16-bit pointer in 16:16 models
  91. //      BI_DATA_FAR         32-bit pointer in 16:16 models
  92. //      BI_DATA_HUGE        32-bit huge pointer in 16:16 models
  93. //
  94. //  Must also define one of:
  95. //
  96. //      BI_CODE_NEAR        16-bit pointer in 16:16 models
  97. //      BI_CODE_FAR         32-bit pointer in 16:16 models
  98. //
  99. #if defined(BI_PTR_16_16)
  100. # if defined(BI_MODEL_TINY) || defined(BI_MODEL_SMALL) || defined(BI_MODEL_MEDIUM)
  101. #   define BI_DATA_NEAR
  102. # elif defined(BI_MODEL_COMPACT) || defined(BI_MODEL_LARGE)
  103. #   define BI_DATA_FAR
  104. # else
  105. #   define BI_DATA_HUGE
  106. # endif
  107. # if defined(BI_MODEL_TINY) || defined(BI_MODEL_SMALL) || defined(BI_MODEL_COMPACT)
  108. #   define BI_CODE_NEAR
  109. # else
  110. #   define BI_CODE_FAR
  111. # endif
  112. #endif
  113.  
  114. //
  115. //  Define the type of application being built. Must be one of:
  116. //
  117. //      BI_APP_EXECUTABLE
  118. //      BI_APP_DLL
  119. //
  120. #if defined(__DLL__) || defined(_DLL)
  121. # define BI_APP_DLL
  122. #else
  123. # define BI_APP_EXECUTABLE
  124. #endif
  125.  
  126. //
  127. //  Only enable multi-thread classes when the OS supports them, and/or when the
  128. //  runtime library support them
  129. //
  130. #if defined(BI_PLAT_WIN32) || defined(BI_PLAT_OS2)
  131. # define BI_MULTI_THREAD
  132. #endif
  133. #if defined(_MT)
  134. # define BI_MULTI_THREAD_RTL
  135. #endif
  136.  
  137. //----------------------------------------------------------------------------
  138. //  Compiler-specific flags.
  139. //----------------------------------------------------------------------------
  140.  
  141. //
  142. // Specific name of compiler, BI_COMP_xxxx
  143. //
  144. #define BI_COMP_MSC
  145.  
  146. #define BI_NO_OBJ_STREAMING
  147.  
  148. //
  149. //  C++ language features
  150. //
  151. //  When compiling with a compiler that doesn't support these
  152. //  features directly, remove the // from the appropriate
  153. //  #define below or define the macro in the build environment.
  154. //
  155.  
  156. //
  157. //  Language feature:          Description                  SERVICES header
  158. //  ~~~~~~~~~~~~~~~~           ~~~~~~~~~~~~~~~~~~~~~~~~~~   ~~~~~~~~~~~~~~~
  159. #define BI_NO_ARRAYNEW      // operators new[] & delete[]   -
  160. #define BI_NO_BOOL          // Standard bool type           DEFS.H
  161. #define BI_NO_COVAR_RET     // Covariant returns in overrides -
  162. #define BI_NO_MUTABLE       // Mutable keyword              DEFS.H
  163. #define BI_NO_NEW_CASTS     // New style casts              CASTABLE.H
  164. #define BI_NO_NAMESPACE     // Namespaces
  165. #define BI_NO_RTTI          // RTTI and __rtti keyword      DEFS.H
  166. #define BI_NO_THROWSPEC     // Function throw specifiers    EXCEPT.H
  167. #define BI_NO_LVAL_CASTS    // Can cast lvalues
  168.  
  169. //
  170. // Disale some MSC warnings, & move some to level 4 since they really are OK
  171. //
  172. #pragma warning(disable:4068)  // unknown pragma, compiler should ignore
  173. #pragma warning(disable:4514)  // unreferenced inline, compiler internal noise
  174. #pragma warning(disable:4201)  // complains about valid anonymouse unions!
  175. #pragma warning(4:4355)        // 'this' used in base member initializer list
  176. #pragma warning(4:4250)        // inherits <base> via dominance
  177.  
  178. #endif  // SERVICES_MSC_H
  179.