home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / som30tk.zip / som30os2.zip / include / somplatf.h < prev    next >
C/C++ Source or Header  |  1996-12-24  |  5KB  |  155 lines

  1. /*
  2.  *    @(#) 1.8 src/somk/intelos2/somplatf.h, somk.api, som3.0 9/4/96 13:59:03 [12/24/96 08:23:20]
  3.  */
  4.  
  5. /*
  6.  * 96F8647, 96F8648, 96F8850 (C) Copyright IBM Corp. 1992, 1994
  7.  * All Rights Reserved
  8.  * Licensed Materials - Property of IBM
  9.  */
  10.  
  11. /*
  12.  *    SOMPLATF.H
  13.  *
  14.  *    Plaform-specific portions of the SOM ABI
  15.  *
  16.  *    Interfaces and typedefs described in this header vary across
  17.  *    platforms.
  18.  *
  19.  */
  20.  
  21. #ifndef somplatf_h
  22. #define somplatf_h
  23.  
  24.  
  25. /*
  26.  * Class Libraries -- Loading and Class Registration
  27.  *
  28.  * This section defines the system-dependent library handle that is
  29.  * passed as an argument to somRegisterLibraryClasses and the
  30.  * userInitTermRoutine.  For OS/2, this is an HMODULE (unsigned long);
  31.  * for AIX, it is a function pointer (void *) for the main entry point
  32.  * of the library.
  33.  */
  34.  
  35. typedef unsigned long somLibraryHandle;
  36.  
  37. /*
  38.  *    This portion was moved from SOMDEFS.H  (formerly SOMLTYPE.H)
  39.  *    Set up the compiler-dependent macro definitions needed by the SOM
  40.  *    header files.  The macro variables defined here are SOMEXTERN,
  41.  *    SOMLINK, SOMDLINK, SOM_DATASEG_PRAGMAS, SOMLEGACY1, SOMLEGACY2
  42.  *
  43.  *    The SOMEXTERN, SOMLINK, and SOMDLINK variables are used to control
  44.  *    the register linkage conventions for all SOM functions, methods,
  45.  *    and external data references.
  46.  *
  47.  *    All SOM functions and external data references are preceded with a
  48.  *    SOMEXTERN macro (SOM methods do not have external names).
  49.  *
  50.  *    All SOM functions and methods are prototyped with a SOMLINK keyword.
  51.  *
  52.  *    All SOM external data references are defined with a SOMDLINK keyword.
  53.  *
  54.  *    The SOM_DATASEG_PRAGMAS variable controls whether or not
  55.  *    #pragma data_seg(segname) directives are passed to the compiler.
  56.  *    This variable is defined only for compilers that recognize and
  57.  *    implement this pragma.  SOM's support for coerced classes makes
  58.  *    use of this pragma to place certain data definitions in specific
  59.  *    data segments.
  60.  *
  61.  *    Users may supply (at their own risk) appropriate definitions for
  62.  *    other compilers using "-DSOMEXTERN=x", "-DSOMLINK=y", "-DSOMDLINK=z",
  63.  *    or "-DSOM_DATASEG_PRAGMAS" arguments on the compiler's command line.
  64.  *    Any such definition is not disturbed by the following code.
  65.  *
  66.  *    assumptions:
  67.  *      (1) __cplusplus is defined when compiling C++ code anywhere
  68.  *      (2) __IBMCPP__ is defined by CSet/2 on OS/2 when compiling C++ code
  69.  *      (3) __IBMC__ is defined by CSet/2 on OS/2 when compiling C code
  70.  *      (4) _CL386 may be defined if not using an IBM compiler
  71.  *      (5) neither _CL386 nor __IBMCPP__ are defined on AIX
  72.  *      (6) the SOMLINK keyword has replaced the use of "#pragma Linkage"
  73.  *          directives in previous releases of SOM
  74.  */
  75.  
  76. /*
  77.  * These definitions are used to select legacy support in
  78.  * our source code. When this header file is ported to other
  79.  * platforms, consideration should be given to the degree of
  80.  * legacy support that is necessary. The file somobj.idl defines
  81.  * similar support.
  82.  */
  83. #define SOMLEGACY1 /* support obsolete apsects of SOM 1.0 */
  84. #define SOMLEGACY2 /* support obsolete apsects of SOM 2.0 */
  85.  
  86.  
  87. #ifndef SOMEXTERN
  88.   #ifdef __cplusplus
  89.     #define SOMEXTERN extern "C"
  90.     #ifdef __STR__
  91.       #undef __STR__
  92.     #endif
  93.   #else
  94.     #define SOMEXTERN extern
  95.   #endif
  96. #endif
  97.  
  98. #ifndef SOMLINK
  99.   #if defined(__IBMCPP__) || defined(__IBMC__)
  100.     #define SOMLINK _System
  101.   #elif defined(__BCPLUSPLUS__) || defined(__BORLANDC__)
  102.     #define SOMLINK _syscall
  103.   #elif defined(__HIGHC__)
  104.     #define SOMLINK _DCC(_DEFAULT_CALLING_CONVENTION &   \
  105.                          ~_SHORT_STRUCTS_IN_REGS & ~_OVERLOADED)
  106.   #else
  107.     #define SOMLINK _System
  108.   #endif
  109. #endif
  110.  
  111. #ifndef SOMDLINK
  112.   #define SOMDLINK
  113. #endif
  114.  
  115. #ifndef SOM_DATASEG_PRAGMAS
  116.   #if defined(__IBMC__)
  117.     #define SOM_DATASEG_PRAGMAS
  118.   #elif defined(__IBMCPP__) && __IBMCPP__ >= 300
  119.     #define SOM_DATASEG_PRAGMAS
  120.   #elif defined(__HIGHC__)
  121.     #define SOM_DATASEG_PRAGMAS
  122.   #elif defined(__WATCOMC__)
  123.     #define SOM_DATASEG_PRAGMAS
  124.   #elif defined(_PPC) && defined(_OS2)
  125.     #define SOM_DATASEG_PRAGMAS
  126.   #endif
  127. #endif
  128.  
  129. /*
  130.  * The following constant is used in the definition of a default
  131.  * method signature within the SOM kernel (somcls.def):
  132.  *   somMethodInfo defaultMethodInfo = {0, SOM_DEFAULT_VASIZE };
  133.  *
  134.  * defaultMethodInfo describes all methods that return a scalar,
  135.  * take no floating arguments, and use a va_list of no greater than
  136.  * SOM_DEFAULT_VASIZE.
  137.  */
  138. /* 21189 */
  139. #ifndef SOM_DEFAULT_VASIZE 
  140. #define SOM_DEFAULT_VASIZE 20
  141. #endif 
  142.  
  143.  
  144. /* Defined for special modifiers needed to import/export
  145.  DLL function/variables */
  146. #ifndef SOMDLLIMPORT
  147. #define SOMDLLIMPORT 
  148. #endif
  149.  
  150. #ifndef SOMDLLEXPORT
  151. #define SOMDLLEXPORT
  152. #endif
  153.  
  154. #endif /* somplatf_h */
  155.