home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1998 May / Pcwk5b98.iso / Borland / Cplus45 / BC45 / INC.PAK / _DEFS.H next >
C/C++ Source or Header  |  1995-08-29  |  5KB  |  177 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.  
  29. /*
  30.  *      C/C++ Run Time Library - Version 6.5
  31.  *
  32.  *      Copyright (c) 1991, 1994 by Borland International
  33.  *      All Rights Reserved.
  34.  *
  35.  */
  36.  
  37. #if !defined(___DEFS_H)
  38. #define ___DEFS_H
  39.  
  40. #if defined(__MT__)
  41. #    define _MT
  42. #endif
  43.  
  44. #if defined(__OS2__)
  45. #    define _RTLENTRY  __stdcall
  46. #    define _USERENTRY __stdcall
  47. #elif defined(__WIN32__)
  48. #    define _RTLENTRY  __cdecl
  49. #    define _USERENTRY __cdecl
  50. #else
  51. #    define _RTLENTRY  __cdecl
  52. #    define _USERENTRY __cdecl
  53. #endif
  54.  
  55. #if defined(__PAS__)
  56. #    define _RTLENTRYF __pascal
  57. #else
  58. #    define _RTLENTRYF _RTLENTRY
  59. #endif
  60.  
  61. #if defined(__FLAT__)
  62. #   define _FAR
  63. #   if defined(_BUILDRTLDLL)
  64. #       define _EXPCLASS  __export
  65. #       define _EXPDATA   __export
  66. #       define _EXPFUNC   __export
  67. #   elif defined(_RTLDLL) && !defined(__OS2__)
  68. #       define _EXPCLASS  __import
  69. #       define _EXPDATA   __import
  70. #       define _EXPFUNC   __import
  71. #   else
  72. #       define _EXPCLASS
  73. #       define _EXPDATA
  74. #       define _EXPFUNC
  75. #   endif
  76. #else
  77. #   if defined(__DLL__)
  78. #       if defined(_BUILDRTLDLL)
  79. #           define _EXPCLASS __export
  80. #       elif defined(_RTLDLL) || defined(_CLASSDLL)
  81. #           define _EXPCLASS __export
  82. #       else
  83. #           define _EXPCLASS __far
  84. #       endif
  85. #       define _FAR __far
  86. #   elif defined(_RTLDLL) || defined(_CLASSDLL)
  87. #       define _EXPCLASS __export
  88. #       define _FAR __far
  89. #   else
  90. #       if   defined(__TINY__) || defined(__SMALL__) || defined(__MEDIUM__)
  91. #           if defined(_RTLFARVTABLE)
  92. #               define _EXPCLASS  __huge
  93. #           else
  94. #               define _EXPCLASS  __near
  95. #           endif
  96. #       elif defined(__COMPACT__) || defined(__LARGE__)
  97. #           if defined(_RTLFARVTABLE)
  98. #               define _EXPCLASS  __huge
  99. #           else
  100. #               define _EXPCLASS  __far
  101. #           endif
  102. #       else
  103. #           define _EXPCLASS  __huge
  104. #       endif
  105. #       define _FAR
  106. #   endif
  107. #   if defined(_BUILDRTLDLL)
  108. #       define _EXPFUNC __export
  109. #   else
  110. #       if defined(_RTLDLL) || defined(_CLASSDLL)
  111. #           define _EXPFUNC __far
  112. #       else
  113. #           define _EXPFUNC
  114. #       endif
  115. #   endif
  116. #   define _EXPDATA
  117. #endif
  118.  
  119.  
  120. #if defined(__FLAT__)
  121. #define _EXPFUNC32  _EXPFUNC
  122. #define _EXPFUNC16
  123. #else
  124. #define _EXPFUNC32
  125. #define _EXPFUNC16  _EXPFUNC
  126. #endif
  127.  
  128.  
  129. #define _Cdecl      _RTLENTRY
  130. #define _CType      _RTLENTRYF
  131. #define _CLASSTYPE  _EXPCLASS
  132. #define _FARFUNC    _EXPFUNC
  133. #define _FARCALL    _EXPFUNC __far
  134.  
  135. #if defined(__FLAT__)
  136. #  define _M_IX86 300
  137. #endif
  138.  
  139. #if !defined(__FLAT__) && defined(__MSC)
  140. #   define __emit db
  141. #   ifdef __SMALL__
  142. #       define _M_I86SM
  143. #   endif
  144. #   ifdef __COMPACT__
  145. #       define _M_I86CM
  146. #   endif
  147. #   ifdef __MEDIUM__
  148. #       define _M_I86MM
  149. #   endif
  150. #   ifdef __LARGE__
  151. #       define _M_I86LM
  152. #   endif
  153. #   ifndef _Windows
  154. #       define _DOS
  155. #   else
  156. #       define _WINDOWS
  157. #   endif
  158. #endif
  159.  
  160. #if defined(__cplusplus)
  161. #   define _PTRDEF(name) typedef name _FAR * P##name;
  162. #   define _REFDEF(name) typedef name _FAR & R##name;
  163. #   define _REFPTRDEF(name) typedef name _FAR * _FAR & RP##name;
  164. #   define _PTRCONSTDEF(name) typedef const name _FAR * PC##name;
  165. #   define _REFCONSTDEF(name) typedef const name _FAR & RC##name;
  166.  
  167. /*********** Obsolete definitions for OWL 1.0 *************/
  168. #   define _CLASSDEF(name) class _EXPCLASS name; \
  169.            _PTRDEF(name) \
  170.            _REFDEF(name) \
  171.            _REFPTRDEF(name) \
  172.            _PTRCONSTDEF(name) \
  173.            _REFCONSTDEF(name)
  174. #endif
  175.  
  176. #endif  /* ___DEFS_H */
  177.