home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 9 Archive / 09-Archive.zip / unzip531.zip / os2 / os2cfg.h < prev    next >
C/C++ Source or Header  |  1997-02-20  |  3KB  |  128 lines

  1. /*---------------------------------------------------------------------------
  2.     OS/2 specific configuration section:
  3.   ---------------------------------------------------------------------------*/
  4.  
  5. #ifndef __os2cfg_h
  6. #define __os2cfg_h
  7.  
  8. #ifdef MSDOS
  9. #  include <dos.h>           /* for REGS macro (TC) or _dos_setftime (MSC) */
  10. #  ifdef __TURBOC__          /* includes Power C */
  11. #    include <sys/timeb.h>   /* for structure ftime */
  12. #    ifndef __BORLANDC__     /* there appears to be a bug (?) in Borland's */
  13. #      include <mem.h>       /*  MEM.H related to __STDC__ and far poin-   */
  14. #    endif                   /*  ters. (dpk)  [mem.h included for memcpy]  */
  15. #  endif
  16. #endif /* MSDOS */
  17.  
  18. #ifdef __IBMC__
  19. #  define S_IFMT 0xF000
  20. #  define timezone _timezone
  21. #  define PIPE_ERROR (errno == EERRSET || errno == EOS2ERR)
  22. #endif /* __IBMC__ */
  23.  
  24. #ifdef __WATCOMC__
  25. #  ifdef __386__
  26. #    ifndef WATCOMC_386
  27. #      define WATCOMC_386
  28. #    endif
  29. #    define __32BIT__
  30. #    undef far
  31. #    define far
  32. #    undef near
  33. #    define near
  34.  
  35. /* Get asm routines to link properly without using "__cdecl": */
  36. #    ifndef USE_ZLIB
  37. #      pragma aux crc32         "_*" parm caller [] value [eax] modify [eax]
  38. #      pragma aux get_crc_table "_*" parm caller [] value [eax] \
  39.                                       modify [eax ecx edx]
  40. #    endif /* !USE_ZLIB */
  41. #  else /* !__386__ */
  42. #    ifndef USE_ZLIB
  43. #      pragma aux crc32         "_*" parm caller [] value [ax dx] \
  44.                                       modify [ax cx dx bx]
  45. #      pragma aux get_crc_table "_*" parm caller [] value [ax] \
  46.                                       modify [ax cx dx bx]
  47. #    endif /* !USE_ZLIB */
  48. #  endif /* ?__386__ */
  49.  
  50. #  ifndef EPIPE
  51. #    define EPIPE -1
  52. #  endif
  53. #  define PIPE_ERROR (errno == EPIPE)
  54. #endif /* __WATCOMC__ */
  55.  
  56. #ifdef __EMX__
  57. #  ifndef __32BIT__
  58. #    define __32BIT__
  59. #  endif
  60. #  define far
  61. #endif
  62.  
  63. #ifndef __32BIT__
  64. #  define __16BIT__
  65. #endif
  66.  
  67. #ifdef MSDOS
  68. #  undef MSDOS
  69. #endif
  70.  
  71. #if defined(M_I86CM) || defined(M_I86LM)
  72. #  define MED_MEM
  73. #endif
  74. #if (defined(__COMPACT__) || defined(__LARGE__) || defined(__HUGE__))
  75. #  define MED_MEM
  76. #endif
  77. #ifdef __16BIT__
  78. #  ifndef MED_MEM
  79. #    define SMALL_MEM
  80. #  endif
  81. #endif
  82.  
  83. #ifdef __16BIT__
  84. # if defined(MSC) || defined(__WATCOMC__)
  85. #   include <malloc.h>
  86. #   define nearmalloc _nmalloc
  87. #   define nearfree _nfree
  88. # endif
  89. # if defined(__TURBOC__) && defined(DYNALLOC_CRCTAB)
  90. #   if defined(__COMPACT__) || defined(__LARGE__) || defined(__HUGE__)
  91. #     undef DYNALLOC_CRCTAB
  92. #   endif
  93. # endif
  94. # ifndef nearmalloc
  95. #   define nearmalloc malloc
  96. #   define nearfree free
  97. # endif
  98. # if (defined(USE_ZLIB) && !defined(USE_OWN_CRCTAB))
  99. #   define USE_OWN_CRCTAB
  100. # endif
  101. #endif
  102.  
  103. #ifdef isupper
  104. #  undef isupper
  105. #endif
  106. #ifdef tolower
  107. #  undef tolower
  108. #endif
  109. #ifndef OS2_EAS
  110. #  define OS2_EAS    /* for -l and -v listings (list.c) */
  111. #endif
  112. #define isupper(x)   IsUpperNLS((unsigned char)(x))
  113. #define tolower(x)   ToLowerNLS((unsigned char)(x))
  114. #define USETHREADID
  115.  
  116. /* handlers for OEM <--> ANSI string conversions */
  117. #ifndef _OS2_ISO_ANSI
  118.    /* use home_brewed conversion functions; internal charset is OEM */
  119. #  ifdef CRTL_CP_IS_ISO
  120. #    undef CRTL_CP_IS_ISO
  121. #  endif
  122. #  ifndef CRTL_CP_IS_OEM
  123. #    define CRTL_CP_IS_OEM
  124. #  endif
  125. #endif
  126.  
  127. #endif /* !__os2cfg_h */
  128.