home *** CD-ROM | disk | FTP | other *** search
/ PC Format (South-Africa) 2001 May / PCFMay2001.iso / Xenon / C++ / FreeCommandLineTools.exe / Include / Rw / stdwind.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-01-31  |  7.5 KB  |  210 lines

  1. #ifndef __STDWIND_H
  2. #define __STDWIND_H
  3. #pragma option push -b -a8 -pc -Vx- -Ve- -w-inl -w-aus -w-sig
  4. #ifndef __RWSTDWIND_H__
  5. #define __RWSTDWIND_H__
  6.  
  7. /***************************************************************************
  8.  *
  9.  * stdwind.h - Microsoft Windows related directives.
  10.  *
  11.  * $Id: stdwind.h,v 1.19 1996/09/24 19:42:16 smithey Exp $
  12.  *
  13.  ***************************************************************************
  14.  *
  15.  * Copyright (c) 1994-1999 Rogue Wave Software, Inc.  All Rights Reserved.
  16.  *
  17.  * This computer software is owned by Rogue Wave Software, Inc. and is
  18.  * protected by U.S. copyright laws and other laws and by international
  19.  * treaties.  This computer software is furnished by Rogue Wave Software,
  20.  * Inc. pursuant to a written license agreement and may be used, copied,
  21.  * transmitted, and stored only in accordance with the terms of such
  22.  * license and with the inclusion of the above copyright notice.  This
  23.  * computer software or any other copies thereof may not be provided or
  24.  * otherwise made available to any other person.
  25.  *
  26.  * U.S. Government Restricted Rights.  This computer software is provided
  27.  * with Restricted Rights.  Use, duplication, or disclosure by the
  28.  * Government is subject to restrictions as set forth in subparagraph (c)
  29.  * (1) (ii) of The Rights in Technical Data and Computer Software clause
  30.  * at DFARS 252.227-7013 or subparagraphs (c) (1) and (2) of the
  31.  * Commercial Computer Software รป Restricted Rights at 48 CFR 52.227-19,
  32.  * as applicable.  Manufacturer is Rogue Wave Software, Inc., 5500
  33.  * Flatiron Parkway, Boulder, Colorado 80301 USA.
  34.  *
  35.  **************************************************************************/
  36.  
  37. /*
  38.  * Special stuff for 16-bit Windows (__WIN16__)
  39.  * and Windows NT / Win32s (__WIN32__).
  40.  *
  41.  * Under Windows, these header files can be used in two different modes:
  42.  * as part of a DLL, or as part of a regular (static) library.
  43.  * For each of these two ways, we can either be COMPILING the library,
  44.  * or USING the library.  This makes a matrix of four possible situations.
  45.  *
  46.  *************************************************************************
  47.  ******************************  DLL *************************************
  48.  *************************************************************************
  49.  *
  50.  *                         Creating a DLL
  51.  *
  52.  * The macro __DLL__ should be define when compiling to create a DLL.
  53.  *
  54.  *     The Borland compilers automatically do this if either the -WD or
  55.  *     -WDE switch is being used.  In this situation, the macro
  56.  *     _RWSTDExport expands to _export.
  57.  *
  58.  *     For other compilers, we must define __DLL__ where appropriate
  59.  *     if the compiler doesn't.  See the example for Microsoft below.
  60.  *
  61.  *     _RWSTDExport expands to _export by default.  Massage as
  62.  *     necessary for your compiler; again see below for the Microsoft
  63.  *     specific directives.
  64.  *
  65.  *                       Using the resultant DLL
  66.  *
  67.  * In order to use the resultant DLL, you must define the macro _RWSTDDLL
  68.  * when compiling.  This will communicate to the Rogue Wave header files
  69.  * your intention to use a DLL version of the Rogue Wave library.
  70.  *
  71.  * If you intend to use a DLL version of the Borland RTL as well, then you
  72.  * should also define the macro _RTLDLL, as per Borland's instructions.
  73.  *
  74.  * You must also specify the -WS switch ("smart callbacks") for the 
  75.  * Borland Compiler.
  76.  *
  77.  *
  78.  *************************************************************************
  79.  ***********************  Static Windows Library **************************
  80.  *************************************************************************
  81.  *
  82.  *
  83.  *                Creating a _RW static Windows library
  84.  *
  85.  * If your intention is to create a Rogue Wave library to be used as 
  86.  * as a static Windows library, then one of the macros __WIN16__ or __WIN32__
  87.  * must have been defined in compiler.h (or by the compiler directly).
  88.  *
  89.  * Borland:    __WIN16__ will be defined if both _Windows and __MSDOS__ 
  90.  *              is defined.  _Windows will be defined automatically if 
  91.  *              any -W switch is used.  Borland defines __WIN32__ automatically
  92.  *              in their 32-bit compiler for Windows NT / Win32s.
  93.  *
  94.  * Microsoft:    Microsoft automatically defines _WINDOWS if you use the
  95.  *        /GA (preferred) or /GW switch. 
  96.  *              __WIN32__ will only be defined if either it, or WIN32,
  97.  *              is _EXPLICITly defined on the cl command line.
  98.  *
  99.  * 
  100.  *                 Using a _RW static Windows library
  101.  *
  102.  * Nothing special needs to be done.  Just link compile with the appropriate
  103.  * compile switches and link in the _RW static Windows library.
  104.  *
  105.  */
  106. /*
  107.  * Check for Microsoft C/C++ and massage as necessary.
  108.  */
  109. #if defined(_MSC_VER)
  110. #  if defined(_WINDLL) && !defined(__DLL__)
  111. #    define __DLL__ 1
  112. #  endif
  113. #  if !defined(_export)
  114. #    define _export __export
  115. #  endif
  116. #endif
  117.  
  118. #ifdef  __TURBOC__
  119. #  if __TURBOC__ > 0x468
  120. #    define _RWSTD_EXPORT_TEMPLATE
  121. #  endif
  122. #endif
  123. /* For backwards compatibility: */
  124. #if defined(_RWSTDCLASSDLL) && !defined(_RWSTDDLL)
  125. # define _RWSTDDLL 1
  126. #endif
  127.  
  128. #if defined(_RWSTDDLL)
  129. #  if !defined(__LARGE__) && !defined(__WIN32__)
  130. #    error   Must use large or flat memory model when compiling or using the Standard Library DLL!
  131. #  endif
  132. #  if defined(_MSC_VER) || ( defined(__TURBOC__) && __TURBOC__ >= 0x0530 )
  133. #    define _RWSTD_USE_DECLSPEC
  134. #  endif
  135. #  if defined(_RWSTDBUILDDLL)
  136.      // Compiling the DLL.
  137. #    ifndef _RWSTD_USE_DECLSPEC
  138. #      define _RWSTDExport __declspec(dllexport)    /* Mark classes as exported */
  139. #      if defined (__WIN16__)
  140. #        define _RWSTDHuge huge
  141. #      else
  142. #        define _RWSTDHuge
  143. #      endif
  144. #      ifdef _RWSTD_EXPORT_TEMPLATE
  145. #        define _RWSTDExportTemplate  __declspec(dllexport)    /* Mark template insts as exported */
  146. #      else
  147. #        define _RWSTDExportTemplate 
  148. #      endif
  149. #    else /* Microsoft and recent Borland: */
  150. #      define _RWSTDExport __declspec(dllexport)
  151. #ifdef __BORLANDC__
  152. #      define _RWSTDExportTemplate __declspec(dllexport)
  153. #else
  154. #      define _RWSTDExportTemplate
  155. #endif
  156. #      define _RWSTDHuge
  157. #    endif
  158. #  else
  159.      // Using the DLL.
  160. #    if defined(__WIN16__)
  161. #      define _RWSTDExport huge     /* Mark classes as huge  */
  162. #      define _RWSTDHuge huge
  163. #    else
  164. #      ifndef _RWSTD_USE_DECLSPEC
  165. #        define _RWSTDExport  __declspec(dllimport)
  166. #        ifdef _RWSTD_EXPORT_TEMPLATE
  167. #          define _RWSTDExportTemplate _import
  168. #        else
  169. #          define _RWSTDExportTemplate
  170. #        endif
  171. #      else
  172. #        define _RWSTDExport __declspec(dllimport)
  173. #ifdef __BORLANDC__
  174. #        define _RWSTDExportTemplate __declspec(dllimport)
  175. #else
  176. #        define _RWSTDExportTemplate
  177. #endif
  178. #      endif
  179. #      define _RWSTDHuge
  180. #    endif
  181.  
  182. #  endif
  183. #else
  184.    // Neither compiling, nor using the  DLL.
  185. #  define _RWSTDExport
  186. #  define _RWSTDExportTemplate
  187. #  define _RWSTDHuge
  188. #endif
  189. // Borland likes static members of exported template classes to be exported.
  190. // Microsoft forbids it ...
  191.  
  192. #ifdef __BORLANDC__
  193. #  define _RWSTDExportStatic _RWSTDExport
  194. #else
  195. #  define _RWSTDExportStatic
  196. #endif
  197.  
  198. //
  199. // Different compilers expect exported functions defined in different ways.
  200. //
  201. #if defined(_MSC_VER) && !defined(__BORLANDC__)
  202. #define _RWSTDExportFunc(ReturnType) _RWSTDExport ReturnType
  203. #else
  204. #define _RWSTDExportFunc(ReturnType) ReturnType _RWSTDExport
  205. #endif
  206.  
  207. #endif // __RWSTDWIND_H__
  208. #pragma option pop
  209. #endif /* __STDWIND_H */
  210.