home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / metkit / k4conf.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-06-07  |  5.8 KB  |  203 lines

  1. //  Copyright (C) 1996, 1997 Meta Four Software.  All rights reserved.
  2. //
  3. //  This is the simplified header for use with the MetaKit library.
  4. //
  5. //  There is no point in exporting the bulky and complex conditional header
  6. //  structure used within the library itself, but the definitions below will
  7. //  have to be changed substantially to support new compilers, etc.
  8. //
  9. //! rev="$Id: k4conf.h,v 1.20 1997/06/06 15:08:23 jcw Rel $"
  10.  
  11. #ifndef __K4CONF_H__
  12. #define __K4CONF_H__
  13.  
  14.     // Microsoft C++ prefers MFC, everyone else defaults to Universal version
  15. #if !_MSC_VER && !q4_MFC && !q4_STD && !defined (q4_UNIV)
  16.     #define q4_UNIV 1
  17. #endif
  18.  
  19.     // by default, if MFC is linked as a DLL, then so is MetaKit
  20. #if defined (_AFXDLL) && !defined (q4_KITDLL)
  21.     #define q4_KITDLL _AFXDLL
  22. #endif
  23.  
  24.     // omit floating point in small model 16-bit Intel builds
  25. #if defined (_DOS) && defined (_M_I86SM) && !defined (q4_TINY)
  26.     #define q4_TINY 1
  27. #endif
  28.  
  29.     // and here's the other end of the scale... Alpha has 64-bit longs
  30. #if defined (__alpha) && !defined (q4_LONG64)
  31.     #define q4_LONG64 1
  32. #endif
  33.  
  34. /////////////////////////////////////////////////////////////////////////////
  35.  
  36.     // Borland C++ and C++ Builder
  37. #if defined (__BORLANDC__)
  38.         // by default, if runtime is linked as a DLL, then so is MetaKit
  39.     #if defined (_RTLDLL) && !defined (q4_KITDLL)
  40.         #define q4_KITDLL 1
  41.     #endif
  42.  
  43.         // use explicit import specifier if MetaKit is in a DLL
  44.     #if q4_KITDLL && !defined (q4_EXPORT)
  45.         #define q4_EXPORT 1
  46.         #define d4_DLLSPEC(t) t // only class _import in BC 4.52 (?)
  47.     #endif
  48.  
  49.         // Borland 5.0 supports the bool datatype
  50.     #if __BORLANDC__ >= 0x500
  51.         #define q4_BOOL 1
  52.     #endif
  53. #endif
  54.  
  55.     // Metrowerks CodeWarrior
  56. #if defined (__MWERKS__)
  57.     #if __option(bool)
  58.         #define q4_BOOL 1       // bool datatype is optionally supported
  59.             // undef, these conflict with c4_Storage::c4_Storage overloading
  60.         #undef bool
  61.         #undef true
  62.         #undef false
  63.     #endif
  64. #endif
  65.  
  66.     // Microsoft Visual C++
  67. #if defined (_MSC_VER)
  68.         // MSVC 4.0 can specify the library it needs to link here
  69.     #if _MSC_VER >= 1000 && !defined(_MAC)
  70.         #if q4_STD
  71.             #if q4_KITDLL
  72.                 #ifdef _DEBUG
  73.                     #pragma comment(lib, "mk4nvsyd.lib")
  74.                 #else
  75.                     #pragma comment(lib, "mk4nvsy.lib")
  76.                 #endif
  77.             #else
  78.                 #ifdef _DEBUG
  79.                     #pragma comment(lib, "mk4nvssd.lib")
  80.                 #else
  81.                     #pragma comment(lib, "mk4nvss.lib")
  82.                 #endif
  83.             #endif
  84.         #elif q4_UNIV
  85.             #if q4_KITDLL
  86.                 #ifdef _DEBUG
  87.                     #pragma comment(lib, "mk4nvuyd.lib")
  88.                 #else
  89.                     #pragma comment(lib, "mk4nvuy.lib")
  90.                 #endif
  91.             #else
  92.                 #ifdef _DEBUG
  93.                     #pragma comment(lib, "mk4nvusd.lib")
  94.                 #else
  95.                     #pragma comment(lib, "mk4nvus.lib")
  96.                 #endif
  97.             #endif
  98.         #else // q4_MFC
  99.             #if q4_KITDLL
  100.                 #ifdef _DEBUG
  101.                     #pragma comment(lib, "mk4nvmxd.lib")
  102.                 #else
  103.                     #pragma comment(lib, "mk4nvmx.lib")
  104.                 #endif
  105.             #else
  106.                 #ifdef _DEBUG
  107.                     #pragma comment(lib, "mk4nvmsd.lib")
  108.                 #else
  109.                     #pragma comment(lib, "mk4nvms.lib")
  110.                 #endif
  111.             #endif
  112.         #endif
  113.     #endif
  114.  
  115.         // MSVC 5.0 supports the bool datatype, MSVC 4.x has no namespaces
  116.     #if _MSC_VER >= 1100
  117.         #define q4_BOOL 1
  118.     #else
  119.         #define q4_NO_NS 1
  120.     #endif
  121. #endif
  122.  
  123. /////////////////////////////////////////////////////////////////////////////
  124. // Other definitions needed by the public MetaKit library header files
  125.  
  126. #if !q4_BOOL && !q4_STD            // define a bool datatype
  127.     #define false 0
  128.     #define true 1
  129.     #define bool int
  130. #endif
  131.  
  132. #if q4_EXPORT                   // add declaration specifiers
  133.     #include "k4dll.h"
  134. #endif
  135.  
  136. #if q4_INLINE                   // enable inline expansion
  137.     #define d4_inline inline
  138. #else
  139.     #define d4_inline
  140. #endif
  141.  
  142. #if q4_NO_NS                    // don't use namespaces
  143.     #define d4_std
  144. #else
  145.     #define d4_std std
  146. #endif
  147.  
  148. typedef unsigned char t4_byte;  // create typedefs for t4_byte, etc.
  149. #if q4_LONG64
  150.     typedef int t4_i32;             // if longs are 64b, then int must be 32b
  151.     typedef unsigned t4_u32;
  152. #else
  153.     typedef long t4_i32;            // if longs aren't 64b, then they are 32b
  154.     typedef unsigned long t4_u32;
  155. #endif
  156.  
  157. /////////////////////////////////////////////////////////////////////////////
  158. // Framework classes
  159.  
  160. #if q4_STD                        // STL and standard strings
  161.  
  162.     #include "m4wrap.h"
  163.  
  164.     typedef c4_ArrayT<void*> c4_PtrArray;
  165.  
  166.     #include <stdio.h>
  167.     typedef FILE c4_File;
  168.  
  169. #elif q4_UNIV                    // Universal replacement classes
  170.  
  171.     #ifdef _MSC_VER
  172.         #pragma warning(disable: 4100 4127 4135 4244 4511 4512 4514)
  173.     #endif
  174.  
  175.     #include "m4string.h"
  176.     #include "m4coll.h"
  177.  
  178.     #include <stdio.h>
  179.     typedef FILE c4_File;
  180.  
  181. #else // q4_MFC                    // Microsoft Foundation Classes
  182.     
  183.     #ifdef _WINDOWS
  184.         #include <afxwin.h>
  185.     #else
  186.         #include <afxcoll.h>
  187.     #endif
  188.  
  189.     typedef class CFile         c4_File;
  190.     typedef class CString       c4_String;
  191.     typedef class CPtrArray     c4_PtrArray;
  192.  
  193.         // MSVC 1.52 thinks a typedef has no constructor, use define instead
  194.     #if _MSC_VER == 800
  195.         #define c4_String CString
  196.     #endif
  197.  
  198. #endif
  199.  
  200. /////////////////////////////////////////////////////////////////////////////
  201.  
  202. #endif
  203.