Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | Related Pages

base.h

Go to the documentation of this file.
00001 /***************************************************************************
00002                   base.h  -  Base defines, macros and types
00003                              -------------------
00004     begin                : Tue Oct 30 2001
00005     copyright            : (C) 2001 by Reality Rift Studios
00006     email                : mattias@realityrift.com
00007  ***************************************************************************
00008 
00009  The contents of this file are subject to the Mozilla Public License Version
00010  1.1 (the "License"); you may not use this file except in compliance with
00011  the License. You may obtain a copy of the License at 
00012  http://www.mozilla.org/MPL/
00013 
00014  Software distributed under the License is distributed on an "AS IS" basis,
00015  WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00016  for the specific language governing rights and limitations under the
00017  License.
00018 
00019  The Original Code is the NeoEngine, base.h
00020 
00021  The Initial Developer of the Original Code is Mattias Jansson.
00022  Portions created by Mattias Jansson are Copyright (C) 2001
00023  Reality Rift Studios. All Rights Reserved.
00024 
00025  ***************************************************************************/
00026 
00027 
00028 #if defined(WIN32) && defined(_MSC_VER)
00029 
00030 /* disable warnings on 255 char debug symbols */
00031 #  pragma warning( disable : 4786 )
00032   
00033 /* disable warnings on extern before template instantiation */
00034 #  pragma warning( disable : 4231 )
00035 
00036 #endif
00037 
00038 
00039 #ifndef __NEBASE_H
00040 #define __NEBASE_H
00041 
00042 /*#if defined(WIN32)
00043   #  include "buildconfig-win32.h"
00044   #endif*/
00045 
00046 #if defined( NEOENGINE_INTERNALS ) && defined( HAVE_CONFIG_H )
00047 #  include "buildconfig.h"
00048 #endif
00049 
00050 #if defined( WIN32 )
00051 #  if !defined( NOGDI ) && !defined( NEEDGDI )
00052 #    define NOGDI
00053 #  endif
00054 #  define NOMINMAX
00055 #endif
00056 
00057 /* Default to POSIX if undefined platform */
00058 #if !defined( POSIX ) && !defined( WIN32 ) && !defined( __APPLE__ )
00059 #  define POSIX
00060 #endif
00061 
00062 /* Default to dynamic build */
00063 #if !defined( BUILD_DYNAMIC ) && !defined( BUILD_STATIC )
00064 #  define BUILD_DYNAMIC
00065 #endif
00066 
00067 
00074 #define NEOENGINEVERSION_MAJOR             0
00075 #define NEOENGINEVERSION_MINOR             7
00076 #define NEOENGINEVERSION_REVISION          0
00077 
00078 #define NEOENGINEVERSIONSTRING             "0.7.0"
00079 
00080 #ifdef __APPLE__
00081 
00082    /* Only PPC architectures under Win32 */
00083 #  ifndef ARCH_PPC
00084 #    define ARCH_PPC
00085 #  endif
00086 
00087 #  ifdef ARCH_X86
00088 #    undef  ARCH_X86
00089 #  endif
00090 
00091 #elif WIN32
00092 
00093    /* Only x86 architectures under Win32 */
00094 #  ifndef ARCH_X86
00095 #    define ARCH_X86
00096 #  endif
00097 
00098 #  ifdef ARCH_PPC
00099 #    undef ARCH_PPC
00100 #  endif
00101 
00102 #  ifdef _MSC_VER
00103 
00104     /* MSVC++ */
00105 #    ifdef BUILD_STATIC
00106 #      define NEOENGINE_API
00107 #      define EXPIMP_TEMPLATE
00108 #    else /* BUILD_DYNAMIC */
00109 #      ifdef NEOENGINE_EXPORTS
00110 #        define NEOENGINE_API __declspec(dllexport)
00111 #        define EXPIMP_TEMPLATE
00112 #      else 
00113 #        pragma warning( disable : 4231 )
00114 #        define NEOENGINE_API __declspec(dllimport)
00115 #        define EXPIMP_TEMPLATE extern
00116 #      endif
00117 #    endif
00118 
00119 #    define NEOENGINE_ATTRIBUTE_PACKED
00120 #    define NE_STATIC
00121 
00122 #    ifdef __cplusplus
00123        /* Instantiate class std::vector<classname>
00124           This does not create an object. It only forces the generation of all
00125           of the members of the class.
00126           It exports them from the DLL and imports them into the .exe file. */
00127 
00128        /* disable warnings on non-standard extension bullshit */
00129 #      pragma warning( disable : 4231 )
00130 
00131 #      ifdef BUILD_STATIC
00132 #        define UDTVectorEXPIMP(classname)
00133 #      else // DYNAMIC
00134 #        if (_MSC_VER >= 1300)
00135 #          define UDTVectorEXPIMP(classname) EXPIMP_TEMPLATE template class NEOENGINE_API std::allocator< classname >; EXPIMP_TEMPLATE template class NEOENGINE_API std::vector< classname >
00136 #        else
00137 #          define UDTVectorEXPIMP(classname) EXPIMP_TEMPLATE template class NEOENGINE_API std::vector< classname >
00138 #        endif
00139 #      endif
00140 #    endif /* __cplusplus */
00141 
00142 #    define snprintf _snprintf
00143 #    define vsnprintf _vsnprintf
00144 
00145 #  elif defined __MINGW32__
00146 
00147     /* Dev-C++ and Cygwin */
00148 #    ifndef NOMINMAX
00149 #      define NOMINMAX
00150 #    endif
00151 #    ifndef __need_size_t
00152 #      define __need_size_t
00153 #    endif
00154 
00155 #    include <_mingw.h>
00156 
00157 #    define NEOENGINE_ATTRIBUTE_PACKED
00158 
00159 #    ifndef WIN32
00160 #      define WIN32
00161 #    endif
00162 
00163 #    ifdef BUILD_STATIC
00164 #      define NEOENGINE_API
00165 #      define EXPIMP_TEMPLATE
00166 #      define NEOENGINE_STATIC_API
00167 #    else /* BUILD_DYNAMIC */
00168 #      ifdef NEOENGINE_EXPORTS
00169 #        define NEOENGINE_API __declspec(dllexport)
00170 #        define EXPIMP_TEMPLATE
00171 #      else
00172 #        define NEOENGINE_API __declspec(dllimport)
00173 #        define EXPIMP_TEMPLATE extern
00174 #      endif
00175 #    endif
00176 
00177 #    define NE_STATIC NEOENGINE_API
00178 
00179 #    define UDTVectorEXPIMP(classname)
00180 
00181 #  else
00182 #    error "Unsupported Win32 environment"
00183 #  endif
00184 
00185 #  define NE_CDECL __cdecl
00186 
00187 #else
00188 
00189     /* Default to x86 architextures */
00190 #  if !defined( ARCH_X86 ) && !defined( ARCH_PPC ) && !defined( ARCH_X86_64 )
00191 #    define ARCH_X86
00192 #  endif
00193 
00194     /* Default to Linux platform */
00195 #  if !defined( LINUX ) && !defined( FREEBSD )
00196 #    define LINUX
00197 #    ifndef _GNU_SOURCE
00198 #      define _GNU_SOURCE
00199 #    endif
00200 #  endif
00201 
00202 #endif
00203 
00204 #if defined( POSIX ) || defined( __APPLE__ )
00205 
00206 #  define NEOENGINE_API
00207 #  define NEOENGINE_ATTRIBUTE_PACKED __attribute__((packed))
00208 
00209 #  define NE_STATIC
00210 #  define NE_CDECL
00211 
00212 #elif !defined( WIN32 )
00213 #  error "Platform uninplemented"
00214 #endif
00215 
00216 
00217 #include "basetypes.h"
00218 
00219 /*
00220 #ifdef __APPLE__
00221 #  define sqrtf(f)    sqrt(f)
00222 #  define sinf(f)     sin(f)
00223 #  define cosf(f)     cos(f)
00224 #  define acosf(f)    acos(f)
00225 #  define logf(f)     log(f)
00226 #  define powf(x, y)  pow(x, y)
00227 #endif
00228 */
00229 
00230 #endif /* __NEBASE_H */
00231 
00232 
00233 #if defined( WIN32 ) && !defined( BUILD_STATIC )
00234 
00235 #ifdef __NEED_VECTOR_STRING
00236 #  ifndef __HAVE_VECTOR_STRING
00237 #    include <vector>
00238 #    include <string>
00239 #    ifdef _MSC_VER
00240 #      pragma warning( disable : 4231 )
00241 #    endif
00242 UDTVectorEXPIMP( std::string );
00243 #    define __HAVE_VECTOR_STRING
00244 #  endif
00245 #endif
00246 
00247 #ifdef __NEED_VECTOR_INTPTR
00248 #  ifndef __HAVE_VECTOR_INTPTR
00249 #    include <vector>
00250 #    ifdef _MSC_VER
00251 #      pragma warning( disable : 4231 )
00252 #    endif
00253 UDTVectorEXPIMP( int* );
00254 #    define __HAVE_VECTOR_INTPTR
00255 #  endif
00256 #endif
00257 
00258 #ifdef __NEED_VECTOR_INT
00259 #  ifndef __HAVE_VECTOR_INT
00260 #    include <vector>
00261 #    ifdef _MSC_VER
00262 #      pragma warning( disable : 4231 )
00263 #    endif
00264 UDTVectorEXPIMP( int );
00265 #    define __HAVE_VECTOR_INT
00266 #  endif
00267 #endif
00268 
00269 #ifdef __NEED_VECTOR_UNSIGNED_INT
00270 #  ifndef __HAVE_VECTOR_UNSIGNED_INT
00271 #    include <vector>
00272 #    ifdef _MSC_VER
00273 #      pragma warning( disable : 4231 )
00274 #    endif
00275 UDTVectorEXPIMP( unsigned int );
00276 #    define __HAVE_VECTOR_UNSIGNED_INT
00277 #  endif
00278 #endif
00279 
00280 #ifdef __NEED_VECTOR_FLOATPTR
00281 #  ifndef __HAVE_VECTOR_FLOATPTR
00282 #    include <vector>
00283 #    ifdef _MSC_VER
00284 #      pragma warning( disable : 4231 )
00285 #    endif
00286 UDTVectorEXPIMP( float* );
00287 #    define __HAVE_VECTOR_FLOATPTR
00288 #  endif
00289 #endif
00290 
00291 #ifdef __NEED_VECTOR_FLOAT
00292 #  ifndef __HAVE_VECTOR_FLOAT
00293 #    include <vector>
00294 #    ifdef _MSC_VER
00295 #      pragma warning( disable : 4231 )
00296 #    endif
00297 UDTVectorEXPIMP( float );
00298 #    define __HAVE_VECTOR_FLOAT
00299 #  endif
00300 #endif
00301 
00302 #ifdef __NEED_VECTOR_CHARPTR
00303 #  ifndef __HAVE_VECTOR_CHARPTR
00304 #    include <vector>
00305 #    ifdef _MSC_VER
00306 #      pragma warning( disable : 4231 )
00307 #    endif
00308 UDTVectorEXPIMP( char* );
00309 #    define __HAVE_VECTOR_CHARPTR
00310 #  endif
00311 #endif
00312 
00313 
00314 #endif
00315 
00316 

Generated on Wed Jan 21 14:21:06 2004 for NeoEngine by doxygen 1.3.5