home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / blt2_214.zip / src / platform.h < prev    next >
C/C++ Source or Header  |  1996-10-16  |  3KB  |  100 lines

  1.  
  2. /*
  3.  *
  4.  * platform.h -  12-Oct-1996 Cornel Huth
  5.  * This is included by all bd*.c
  6.  *
  7.  * Purpose is to select the platform the compile is for, and
  8.  * also includes needed header files (standard ones, too).
  9.  * I put all this in here just to make the bd_* files less
  10.  * cluttered, and is meant for use only with the bd_* project.
  11.  *
  12.  * See bullet_2.h for more on Bullet-only issues.
  13.  *
  14.  */
  15.  
  16. #define ON_DOSX32 3
  17. #define ON_OS2    4
  18. #define ON_WIN32  5
  19.  
  20. // * * *  SELECT ONE  * * *  of the three below ***
  21.  
  22. #ifndef PLATFORM
  23. // #define PLATFORM ON_DOSX32
  24. // #define PLATFORM ON_OS2
  25. // #define PLATFORM ON_WIN32
  26. #endif
  27.  
  28. #if PLATFORM == ON_DOSX32
  29.    #include <dos.h>                 // for _harderr
  30.    typedef unsigned long HANDLE;
  31.    typedef unsigned long TID;
  32.    #define USE_ANSI 0               // set to 1 if ANSI screen control wanted
  33.    #define HANDLES_WANTED 255       // limited to FILES= in config.sys
  34.    #define FOR_WINDOWS 0
  35.  
  36. #elif PLATFORM == ON_OS2
  37.    #define INCL_DOSPROCESS          // for OS/2 threads
  38.    #define INCL_DOSMISC             // for DosError()
  39.    #include <os2.h>
  40.    typedef unsigned long HANDLE;
  41.    #define USE_ANSI 1
  42.    #define HANDLES_WANTED 1030
  43.    #define FOR_WINDOWS 0
  44.  
  45. #elif PLATFORM == ON_WIN32
  46.    // set FOR_WINDOWS==1 if doing a windowed app (win32s target) or 0 if a console app
  47.    #ifndef FOR_WINDOWS
  48.     #define FOR_WINDOWS 0
  49.    #endif
  50.    #if FOR_WINDOWS == 1
  51.     #define Q_INS 200   // deal with message queue at least every 200 inserts
  52.     #define Q_ADD 1000  // every 1000 adds
  53.     #define Q_UPD 150   // every 150 updates
  54.     #define Q_GET 750   // every 750 get key+record accesses
  55.     #define Q_KEY 1000  // every 1000 get key accesses
  56.    #endif
  57.  
  58.    #define WIN32_LEAN_AND_MEAN
  59.    #include <windows.h>
  60.    typedef DWORD TID;
  61.    #define USE_ANSI 0
  62.    #define HANDLES_WANTED 1030
  63.  
  64. #else
  65.    #error No PLATFORM defined in platform.h
  66.    #error ---------------------------------
  67.  
  68. #endif
  69.  
  70. #include <conio.h>
  71. #include <stdio.h>
  72. #include <stdlib.h>
  73. #include <time.h>
  74. #include <string.h>
  75.  
  76.  
  77. // bullet_2.h requires PLATFORM defined
  78.  
  79. #include "bullet_2.h"   
  80.  
  81.  
  82. // DOSX32 and OS/2 use OEM character set, Windows the Windows character set (aka 'ANSI').
  83. // ccdosfn.c shows both OEM and ANSI character set tables.
  84. // DOSX32 and OS/2 do not generally have or use an ANSI character set, only OEM.
  85. // Windows generally uses the ANSI char set, but may also use an OEM char set.
  86. // If neither is specific (CIP.sortFunction), USE_OEM_CHARSET is used by default (needed
  87. // only if an NLS_SORT or a custom sort-compare).
  88.  
  89. #if PLATFORM == ON_DOSX32
  90.    #define SORT_SET  USE_OEM_CHARSET
  91.  
  92. #elif PLATFORM == ON_OS2
  93.    #define SORT_SET  USE_OEM_CHARSET
  94.  
  95. #elif PLATFORM == ON_WIN32
  96.    #define SORT_SET  USE_ANSI_CHARSET
  97.  
  98. #endif
  99.  
  100.