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.

391 lines
11 KiB

  1. /***
  2. *switches.hxx - Compile switches for Silver
  3. *
  4. * Copyright (C) 1990, Microsoft Corporation. All Rights Reserved.
  5. * Information Contained Herein Is Proprietary and Confidential.
  6. *
  7. *Purpose:
  8. * This file contains all the conditional compilation switches used
  9. * by Silver. For making version-specific changes, see version.hxx.
  10. *
  11. *Revision History:
  12. *
  13. * 24-Aug-90 petergo: Created
  14. * 10-May-91 ilanc: add ID_TEST
  15. * 14-Jun-91 petergo: Added Kanji/Unicode switches
  16. * 06-Mar-92 tomc: Added several switches, generate switches.inc
  17. * 10-Dec-92 ilanc: Added EI_OB and EI_OLE2.
  18. * 25-Jan-93 jeffrob: Corrected WIN32 HP_I386 and added OE_WIN32MT
  19. * 12-Mar-93 kazusy: Added BLD_FEVER switch
  20. * 05-May-93 jeffrob: Added ID_PROFILE
  21. * 04-Oct-93 w-marioc Added support for MIPS
  22. * 02-Jan-94 gburns: Added EI_VBARUN.
  23. *
  24. *****************************************************************************/
  25. #ifndef SWITCHES_HXX_INCLUDED
  26. #define SWITCHES_HXX_INCLUDED
  27. #define VBA2 1
  28. #include "version.hxx"
  29. // Need to define some constants to 0 that weren't defined or
  30. // mrc will choke on them:
  31. #ifndef BLD_WIN16
  32. #define BLD_WIN16 0
  33. #endif
  34. #ifndef BLD_WIN32
  35. #define BLD_WIN32 0
  36. #endif
  37. #ifndef BLD_MAC
  38. #define BLD_MAC 0
  39. #endif
  40. #ifndef BLD_FEVER
  41. #define BLD_FEVER 0
  42. #endif
  43. #ifndef HE_WIN32
  44. #define HE_WIN32 0 // [jwc] undone: Right now, mac os/2 toolset & NT toolset have
  45. #endif // differences that require source changes. This allows
  46. // coexistance of both builds
  47. // Unlike ID_PROFILE, BLD_PROFILE indicates that the build was built with
  48. // profiling stubs (-Gh cl68 & c8/32) to collecting timing information.
  49. // Currently, this must be set by hand either in a special version.hxx or on the
  50. // compile line.
  51. #ifndef BLD_PROFILE
  52. #define BLD_PROFILE 0
  53. #endif
  54. // ID_TEST - This is used to surround test code that will not be
  55. // part of the released build. This is assumed to be equal ID_DEBUG.
  56. // However, in the test build (twinc7), ID_TEST is turned on, but ID_DEBUG
  57. // is off.
  58. //
  59. #ifndef ID_TEST
  60. #define ID_TEST ID_DEBUG
  61. #endif
  62. // ID_PROFILE - This is used to surround test code that collects profiling
  63. // data. Currently, it is defined to equal ID_DEBUG but could be turned
  64. // on in the release build, if desired.
  65. //
  66. #ifndef ID_PROFILE
  67. #define ID_PROFILE ID_DEBUG
  68. #endif
  69. // ID_SWAPTUNE - This is used to surround code that collects segment swapping info.
  70. // Currently, it is always set off, and must be set on by hand. This need
  71. // not be tied to either debug or release builds, so assume that code under
  72. // this switch could be turned on for either.
  73. #ifndef ID_SWAPTUNE
  74. #define ID_SWAPTUNE 0
  75. #endif
  76. // HC switches: relate to the Host Compiler or Compiler version
  77. // Use this to accomodate syntactic differences between compilers
  78. //
  79. #if defined (_MSC_VER)
  80. #if (_MSC_VER >= 800)
  81. #define HC_MSC8
  82. // Both these are versions of C8 or C9
  83. #ifdef _M_M68K
  84. #define HC_MSC68K
  85. #elif defined (_M_MPPC)
  86. #define HC_MSCPPC
  87. #else
  88. // REVIEW: Probably need to check for C8/32 vs. C8/16
  89. #define HC_MSC832
  90. #endif
  91. #else
  92. #if (_MSC_VER == 700)
  93. #define HC_MSC7
  94. #else
  95. #define HC_MSC6
  96. #endif
  97. #endif
  98. #else
  99. // UNDONE OA95: rc uses a c-preprocessor that doesn't define _MSC_VER...
  100. // need to figure out what to do here.
  101. //#error Unsupported Compiler!
  102. #endif
  103. //OE switches: relate to the Operating Environment, or
  104. //API set used by the program
  105. // If TRUE, OE_WIN indicates we are using one of the variant of the
  106. // Windows API sets. This is set for all of our released versions,
  107. // except the native Mac build.
  108. #if BLD_WIN16 || BLD_WIN32
  109. #define OE_WIN 1
  110. #else
  111. #define OE_WIN 0
  112. #define OE_WIN16 0
  113. #define OE_WIN32 0
  114. #define OE_WIN32S 0
  115. #define OE_WIN32F 0
  116. #define OE_NT 0
  117. #endif
  118. //If OE_WIN is set, exactly one of the following 3 switches is set,
  119. //indicate which variant of the Windows API is being used.
  120. #if OE_WIN
  121. #if BLD_WIN16
  122. #define OE_WIN16 1
  123. //Indicates we are using the Windows 3.0/3.1 API set. Should
  124. //be used when using features specific to Windows 3.0/3.1. You
  125. //can assume protected mode only with this switch; we never have
  126. //and never will support Real mode Windows.
  127. #else
  128. #define OE_WIN16 0
  129. #endif
  130. #if BLD_WIN32
  131. #define OE_WIN32 1
  132. //Indicates we are using the Win32 API set, on either NT or
  133. //DOS. On for both Win32/NT, Win32/DOS, and Win32S.
  134. #else
  135. #define OE_WIN32 0
  136. #endif
  137. #endif
  138. // If OE_WIN32 is set, the following switches indicate which subvariant
  139. // of the Win32 API is being used. These should be rarely needed,
  140. // if at all. NOTE: currently there are no builds which turns these
  141. // on.
  142. #if OE_WIN32
  143. #define OE_WIN32S 0
  144. //Indicates we are using the Win32S API subset.
  145. #define OE_WIN32F 0
  146. //Indicates we are using the full Win32 API, under either
  147. //DOS or NT. Should be used to control use of APIs
  148. //not in the Win32S subset.
  149. #define OE_NT 0
  150. //Indicates we are running under NT, as opposed to Win32/DOS.
  151. //Should be used only to control NT specific features, like
  152. //calling an NT API directly.
  153. #define OE_WIN32MT 0
  154. //Indicates we support multiple WIN32 threads within a single
  155. //process. (Version 1.0 of OB only supports one thread so
  156. //we've optimized some code paths with this in mind.)
  157. #endif
  158. // OE_RISC is used to specify if the portable engine code is to be used
  159. // instead of the intel specific assembly
  160. #ifndef OE_RISC
  161. #define OE_RISC 0
  162. #endif
  163. //OS/2 is no longer a target in any of the builds.
  164. #define OE_OS2 0
  165. // OE_MAC indicates that we are targetting the Macintosh.
  166. #if BLD_MAC
  167. #define OE_MAC 1
  168. #else
  169. #define OE_MAC 0
  170. #endif
  171. #if OE_MAC
  172. // OE_MACAPI indicates that we are using the MacIntosh API. This is
  173. // set whenever we are targetting the Mac and we aren't using WLM.
  174. //
  175. #if BLD_MAC
  176. #define OE_MACAPI 1
  177. #else
  178. #define OE_MACAPI 0
  179. #endif
  180. // Macintosh PowerPC environment is slightly different than the 68k
  181. // environment. You should use this switch to control differences rather
  182. // than HP_POWERPC because they are operating environment differences, not
  183. // true hardware differences (unless, you're talking about asm or something)
  184. // Besides, there is an NT on PowerPC, and then use of HP_POWERPC may be
  185. // a big mistake.
  186. //
  187. // This indicates MAC API and PowerPC runtime environment
  188. #if defined (HC_MSCPPC)
  189. #define OE_MACPPC 1
  190. #define OE_MAC68K 0
  191. #else
  192. #define OE_MACPPC 0
  193. #define OE_MAC68K 1
  194. #endif
  195. #else
  196. #define OE_MACAPI 0
  197. #define OE_MAC68K 0
  198. #define OE_MACPPC 0
  199. #define ID_SWAPPABLE 0
  200. #endif
  201. // OE_DLL: True for versions in which Object Basic code is linked into a DLL.
  202. // When TRUE, host routines are in a separate DLL or EXE. For now,
  203. // this is only TRUE for Windows versions, but future Macintosh
  204. // versions will likely have this set TRUE.
  205. //
  206. #if (BLD_WIN16 || BLD_WIN32 || defined (OE_DLL)) && !defined (VBARUNBLD)
  207. #define OE_DLL 1
  208. #else
  209. #define OE_DLL 0
  210. #endif
  211. #if OE_MAC && !OE_MACPPC
  212. // all mac versions are swappable now
  213. #define ID_SWAPPABLE 1
  214. #endif //OE_MAC
  215. // DOS build. (Probably should be called OE_DOS, but isn't.)
  216. // There is no dos build. This is always off.
  217. #define OE_REALMODE 0
  218. //HP switches: relate to the Hardware Processor.
  219. // The hardware switches indicate what kind of processor we are running
  220. // on. These switches should be used when you need to do specific thing
  221. // depending on the hardware you are running on.
  222. //
  223. // Switches that indicate general characteristic of the processor
  224. //(16bit/32bit, etc).
  225. // HP switches are for Hardware Processor. If possible, do not use
  226. // the specific processor type switches, but instead use the following
  227. // switches pertaining to various characteristic of the processors.
  228. // This makes porting to a new processor easier.
  229. //
  230. // HP_16BIT = Using a 16-bit register processor
  231. // HP_32BIT = Using a 32-bit register processor
  232. // HP_BIGENDIAN = Using a big-endian machine
  233. // least significant byte of a word is
  234. // at the highest byte address.
  235. // HP_MUSTALIGN = Must load/store objects from natural alignments.
  236. // indicates that 2byte words must be read/written
  237. // from a two byte boundary, 4byte words must be
  238. // read/written from a 4 byte boundary, 8 byte word
  239. // must be read/written from an 8 byte boundary.
  240. #if BLD_WIN16
  241. #define HP_16BIT 1
  242. #else
  243. #define HP_16BIT 0
  244. #endif
  245. #if BLD_WIN32 || BLD_MAC
  246. #define HP_32BIT 1
  247. #else
  248. #define HP_32BIT 0
  249. #endif
  250. #if BLD_MAC
  251. #define HP_BIGENDIAN 1
  252. #else
  253. #define HP_BIGENDIAN 0
  254. #endif
  255. #if BLD_MAC
  256. #define HP_MUSTALIGN 0
  257. #endif
  258. // Switches that indicate the exact chip family:
  259. // (It is preferable to use the above switches since they are more
  260. // general than the following switches.)
  261. //
  262. // HP_I286 = Intel 286 AND ABOVE, running in 16 bit mode
  263. // --- -----
  264. // HP_I386 = Intel 386 and above, running in 32 bit mode
  265. // HP_M68000 = Motorola 680x0
  266. // HP_R4000 MIPS = R4000
  267. // HP_ALPHA = DEC/AXP
  268. // HP_POWERPC = Motorola Power PC
  269. //
  270. #define HP_I286 0
  271. #define HP_I386 0
  272. #define HP_M68000 0
  273. #define HP_ALPHA 0
  274. #define HP_R4000 0
  275. #define HP_POWERPC 0
  276. #if BLD_WIN16
  277. #undef HP_I286
  278. #define HP_I286 1
  279. #endif
  280. #if BLD_WIN32
  281. #if defined(_X86_)
  282. #undef HP_I386
  283. #define HP_I386 1
  284. #elif defined(_MIPS_)
  285. #undef HP_R4000
  286. #define HP_R4000 1
  287. #elif defined(_ALPHA_)
  288. #undef HP_ALPHA
  289. #define HP_ALPHA 1
  290. #elif defined(_PPC_)
  291. #undef HP_POWERPC
  292. #define HP_POWERPC 1
  293. #else
  294. #ifndef RC_INVOKED
  295. #error !Unsupported Platform
  296. #endif //RC_INVOKED
  297. #endif //
  298. #endif //BLD_WIN32
  299. #if BLD_MAC
  300. #ifdef _M_MPPC
  301. #undef HP_POWERPC
  302. #define HP_POWERPC 1
  303. #else
  304. #undef HP_M68000
  305. #define HP_M68000 1
  306. #endif
  307. #endif //BLD_MAC
  308. // The following switches distinguish between an OB specific build,
  309. // a build of a run-time only version of OB, and an OLE2 "generic" build.
  310. //
  311. #undef EI_OB
  312. #undef EI_OLE
  313. #undef EI_VBARUN
  314. #define EI_VBA 1 // This differentiates between VBA and hosts which
  315. // may use VBA header files.
  316. // Runtime switches:
  317. #define EI_OB 0
  318. #define EI_OLE 1
  319. #define EI_VBARUN 0
  320. #define EI_VBARUN_VB 0
  321. // Switches for code system.
  322. #define FV_UNICODE 0 // No unicode char set
  323. #define OA3 0 // No old-format dynamic typeinfo stuff
  324. // We now only support ICreateTypeLib2/TypeInfo2 in
  325. // new-format typelibs
  326. #endif // !SWITCHES_HXX_INCLUDED