home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c083 / 14.ddi / GENINC.PAK / _DEFS.H next >
Encoding:
C/C++ Source or Header  |  1993-12-02  |  4.4 KB  |  172 lines

  1. /*  _defs.h
  2.  
  3.     Common definitions for pointer size and calling conventions.
  4.  
  5.     Calling conventions:
  6.     _RTLENTRY       Specifies the calling convention used by the RTL
  7.  
  8.     _USERENTRY      Specifies the calling convention the RTL expects user
  9.                     compiled functions to use (for callbacks)
  10.  
  11.     Export (and size for DOS) information:
  12.     _EXPCLASS       Exports class if building DLL version of library
  13.                     For DOS16 also provides size information
  14.  
  15.     _EXPDATA        Exports data if building DLL version of library
  16.  
  17.     _EXPFUNC        Exports function if building DLL version of library
  18.                     For DOS16 also provides size information
  19.  
  20.     _FAR            Promotes data pointers to far in DLLs (DOS16 only)
  21.  
  22.     Obsolete versions:
  23.     _Cdecl          Use _RTLENTRY
  24.     _CLASSTYPE      Use _EXPCLASS
  25.     _FARFUNC        Use _EXPFUNC
  26.     _FARCALL        Use _EXPFUNC and declare function explicity __far
  27.  
  28.     Copyright (c) 1991, 1992 by Borland International
  29.     All Rights Reserved.
  30. */
  31.  
  32. #if !defined(___DEFS_H)
  33. #define ___DEFS_H
  34.  
  35. #if defined(__MT__)
  36. #    define _MT
  37. #endif
  38.  
  39. #if defined(__OS2__)
  40. #    define _RTLENTRY  __stdcall
  41. #    define _USERENTRY __stdcall
  42. #elif defined(__WIN32__)
  43. #    define _RTLENTRY  __cdecl
  44. #    define _USERENTRY __cdecl
  45. #else
  46. #    define _RTLENTRY  __cdecl
  47. #    define _USERENTRY __cdecl
  48. #endif
  49.  
  50. #if defined(__PAS__)
  51. #    define _RTLENTRYF __pascal
  52. #else
  53. #    define _RTLENTRYF _RTLENTRY
  54. #endif
  55.  
  56. #if defined(__FLAT__)
  57. #   define _FAR
  58. #   if defined(_BUILDRTLDLL)
  59. #       define _EXPCLASS  __export
  60. #       define _EXPDATA   __export
  61. #       define _EXPFUNC   __export
  62. #   elif defined(_RTLDLL)
  63. #       define _EXPCLASS  __import
  64. #       define _EXPDATA   __import
  65. #       define _EXPFUNC   __import
  66. #   else
  67. #       define _EXPCLASS
  68. #       define _EXPDATA
  69. #       define _EXPFUNC
  70. #   endif
  71. #else
  72. #   if defined(__DLL__)
  73. #       if defined(_BUILDRTLDLL)
  74. #           define _EXPCLASS __export
  75. #       elif defined(_RTLDLL) || defined(_CLASSDLL)
  76. #           define _EXPCLASS __export
  77. #       else
  78. #           define _EXPCLASS __far
  79. #       endif
  80. #       define _FAR __far
  81. #   elif defined(_RTLDLL) || defined(_CLASSDLL)
  82. #       define _EXPCLASS __export
  83. #       define _FAR __far
  84. #   else
  85. #       if   defined(__TINY__) || defined(__SMALL__) || defined(__MEDIUM__)
  86. #           if defined(_RTLFARVTABLE)
  87. #               define _EXPCLASS  __huge
  88. #           else
  89. #               define _EXPCLASS  __near
  90. #           endif
  91. #       elif defined(__COMPACT__) || defined(__LARGE__)
  92. #           if defined(_RTLFARVTABLE)
  93. #               define _EXPCLASS  __huge
  94. #           else
  95. #               define _EXPCLASS  __far
  96. #           endif
  97. #       else
  98. #           define _EXPCLASS  __huge
  99. #       endif
  100. #       define _FAR
  101. #   endif
  102. #   if defined(_BUILDRTLDLL)
  103. #       define _EXPFUNC __export
  104. #   else
  105. #       if defined(_RTLDLL) || defined(_CLASSDLL)
  106. #           define _EXPFUNC __far
  107. #       else
  108. #           define _EXPFUNC
  109. #       endif
  110. #   endif
  111. #   define _EXPDATA
  112. #endif
  113.  
  114.  
  115. #if defined(__FLAT__)
  116. #define _EXPFUNC32  _EXPFUNC
  117. #define _EXPFUNC16
  118. #else
  119. #define _EXPFUNC32
  120. #define _EXPFUNC16  _EXPFUNC
  121. #endif
  122.  
  123.  
  124. #define _Cdecl      _RTLENTRY
  125. #define _CType      _RTLENTRYF
  126. #define _CLASSTYPE  _EXPCLASS
  127. #define _FARFUNC    _EXPFUNC
  128. #define _FARCALL    _EXPFUNC __far
  129.  
  130. #if defined(__FLAT__)
  131. #  define _M_IX86 300
  132. #endif
  133.  
  134. #if !defined(__FLAT__) && defined(__MSC)
  135. #   define __emit db
  136. #   ifdef __SMALL__
  137. #       define _M_I86SM
  138. #   endif
  139. #   ifdef __COMPACT__
  140. #       define _M_I86CM
  141. #   endif
  142. #   ifdef __MEDIUM__
  143. #       define _M_I86MM
  144. #   endif
  145. #   ifdef __LARGE__
  146. #       define _M_I86LM
  147. #   endif
  148. #   ifndef _Windows
  149. #       define _DOS
  150. #   else
  151. #       define _WINDOWS
  152. #   endif
  153. #endif
  154.  
  155. #if defined(__cplusplus)
  156. #   define _PTRDEF(name) typedef name _FAR * P##name;
  157. #   define _REFDEF(name) typedef name _FAR & R##name;
  158. #   define _REFPTRDEF(name) typedef name _FAR * _FAR & RP##name;
  159. #   define _PTRCONSTDEF(name) typedef const name _FAR * PC##name;
  160. #   define _REFCONSTDEF(name) typedef const name _FAR & RC##name;
  161.  
  162. /*********** Obsolete definitions for OWL 1.0 *************/
  163. #   define _CLASSDEF(name) class _EXPCLASS name; \
  164.            _PTRDEF(name) \
  165.            _REFDEF(name) \
  166.            _REFPTRDEF(name) \
  167.            _PTRCONSTDEF(name) \
  168.            _REFCONSTDEF(name)
  169. #endif
  170.  
  171. #endif  /* ___DEFS_H */
  172.