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

skGeneral.h

00001 /*
00002   Copyright 1996-2003
00003   Simon Whiteside
00004 
00005     This library is free software; you can redistribute it and/or
00006     modify it under the terms of the GNU Lesser General Public
00007     License as published by the Free Software Foundation; either
00008     version 2 of the License, or (at your option) any later version.
00009 
00010     This library is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013     Lesser General Public License for more details.
00014 
00015     You should have received a copy of the GNU Lesser General Public
00016     License along with this library; if not, write to the Free Software
00017     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00018 
00019   $Id: skGeneral_8h-source.html,v 1.5 2003/01/23 15:31:03 simkin_cvs Exp $
00020 */
00021 #ifndef skGENERAL_H
00022 #define skGENERAL_H
00023 
00024 
00025 #if defined(_MSC_VER)
00026    #ifdef _DEBUG
00027       #define MYDEBUG_NEW   new( _NORMAL_BLOCK, __FILE__, __LINE__)
00028        // Replace _NORMAL_BLOCK with _CLIENT_BLOCK if you want the
00029        //allocations to be of _CLIENT_BLOCK type
00030    #else
00031       #define MYDEBUG_NEW
00032    #endif // _DEBUG
00033 #endif
00034 
00035 
00036 
00037 #include <stdlib.h>
00038 
00039 typedef unsigned int USize;
00040 
00041 #ifndef max
00042 #define max(a,b) (((a)>(b))?(a):(b))
00043 #endif
00044 #ifndef min
00045 #define min(a,b) (((a)<(b))?(a):(b))
00046 #endif
00047 
00048 // Windows Specific Thread Control...
00049 // We use this for skInterpreter::getInterpreter()
00050 // What we should do is have a method whereby the curent interpreter is set into each executable
00051 // object, so that it can be reused when that object spawns a new one.
00052 // At present, this only occurs in skTreeNodeObject and skXMLElementObject
00053 // TODO: Define thread control for other platforms!!!
00054 #ifdef ENABLE_WINDOWS_THREAD_SUPPORT
00055 #if defined(_MSC_VER) && (_MSC_VER >= 1200 )
00056 #define THREAD __declspec(thread)
00057 #else
00058 #define THREAD
00059 #endif
00060 #else
00061 #define THREAD
00062 #endif
00063 
00064 // define ENABLE_WINDOWS_DLL_SUPPORT when using a Windows DLL version of Simkin. 
00065 // then define BUILDING_DLL when building the Simkin DLL
00066 
00067 #ifdef ENABLE_WINDOWS_DLL_SUPPORT
00068  #if defined(_MSC_VER)
00069   #define LIBIMPORT       __declspec( dllimport )
00070   #define LIBEXPORT       __declspec( dllexport )
00071   #endif
00072  #if defined(BUILDING_DLL)
00073   #define CLASSEXPORT     LIBEXPORT
00074   #define EXTERN_TEMPLATE
00075  #else
00076   #define CLASSEXPORT     LIBIMPORT
00077   #define EXTERN_TEMPLATE extern
00078  #endif 
00079 #else
00080 // TODO: Dynamic linking declarations for other platforms?
00081  #define LIBIMPORT       
00082  #define LIBEXPORT       
00083  #define CLASSEXPORT
00084  #define EXTERN_TEMPLATE
00085 #endif
00086 
00087 
00088 #if defined(_MSC_VER)
00089 #ifdef _DEBUG
00090 #define _CRTDBG_MAP_ALLOC
00091 #define _INC_MALLOC
00092 #include <crtdbg.h>
00093 #endif
00094 #endif
00095 
00096 
00097 #if defined(_MSC_VER)
00098    #ifdef _DEBUG
00099    #define new MYDEBUG_NEW
00100    #endif
00101 #endif
00102 
00103 // Look out for Windows CE - which doesn't support streams or exceptions or assert!
00104 
00105 #ifndef _WIN32_WCE
00106  #define STREAMS_ENABLED
00107  #define EXCEPTIONS_DEFINED
00108  #include <assert.h>
00109 #else
00110  #include <windows.h>
00111  #include <dbgapi.h>
00112  #define assert ASSERT
00113  #define UNICODE_STRINGS
00114 #endif
00115 
00116 #endif

Generated on Thu Jan 23 15:25:38 2003 for Simkin by doxygen1.3-rc1