Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

skGeneral.h

00001 /*
00002   Copyright 1996-2001
00003   Simon Whiteside
00004 
00005   $Id: skGeneral.h,v 1.14 2001/11/05 17:48:22 sdw Exp $
00006 */
00007 #ifndef skGENERAL_H
00008 #define skGENERAL_H
00009 
00010 // Look out for Windows CE - which doesn't support streams or exceptions or assert!
00011 
00012 #ifndef _WIN32_WCE
00013  #define STREAMS_ENABLED
00014  #define EXCEPTIONS_DEFINED
00015  #include <assert.h>
00016 #else
00017  #define assert(exp) ((void)0)
00018  #define UNICODE_STRINGS
00019 #endif
00020 
00021 #include <stdlib.h>
00022 
00023 typedef unsigned int USize;
00024  
00025 #ifndef max
00026 #define max(a,b) (((a)>(b))?(a):(b))
00027 #endif
00028 #ifndef min
00029 #define min(a,b) (((a)<(b))?(a):(b))
00030 #endif
00031 
00032 // Windows Specific Thread Control...
00033 // We use this for skInterpreter::getInterpreter()
00034 // What we should do is have a method whereby the curent interpreter is set into each executable
00035 // object, so that it can be reused when that object spawns a new one.
00036 // At present, this only occurs in skTreeNodeObject and skXMLElementObject
00037 // TODO: Define thread control for other platforms!!!
00038 #ifdef ENABLE_WINDOWS_THREAD_SUPPORT
00039 #if defined(_MSC_VER) && (_MSC_VER >= 1200 )
00040 #define THREAD __declspec(thread)
00041 #else
00042 #define THREAD
00043 #endif
00044 #else
00045 #define THREAD
00046 #endif
00047 
00048 // define ENABLE_WINDOWS_DLL_SUPPORT when using a Windows DLL version of Simkin. 
00049 // then define BUILDING_DLL when building the Simkin DLL
00050 
00051 #ifdef ENABLE_WINDOWS_DLL_SUPPORT
00052  #if defined(_MSC_VER)
00053   #define LIBIMPORT       __declspec( dllimport )
00054   #define LIBEXPORT       __declspec( dllexport )
00055   #endif
00056  #if defined(BUILDING_DLL)
00057   #define CLASSEXPORT     LIBEXPORT
00058   #define EXTERN_TEMPLATE
00059  #else
00060   #define CLASSEXPORT     LIBIMPORT
00061   #define EXTERN_TEMPLATE extern
00062  #endif 
00063 #else
00064 // TODO: Dynamic linking declarations for other platforms?
00065  #define LIBIMPORT       
00066  #define LIBEXPORT       
00067  #define CLASSEXPORT
00068  #define EXTERN_TEMPLATE
00069 #endif
00070 
00071 
00072 #ifdef EXCEPTIONS_DEFINED
00073 #  ifdef __AFX_H__  // this is intended to resolve clashes with MFC's THROW()
00074 #  undef THROW
00075 #  endif
00076 #define THROW(x,c) throw x;
00077 #else
00078 #include <windows.h>
00079 #define THROW(x,c) RaiseException(c,0,0,0)
00080 #endif
00081 
00082 #endif

Generated on Tue Nov 20 17:56:21 2001 for Simkin by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001