# Home    # nevrax.com   
Nevrax
Nevrax.org
#News
#Mailing-list
#Documentation
#CVS
#Bugs
#License
Docs
 
Documentation  
Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages   Search  

types_nl.h

Go to the documentation of this file.
00001 
00017 /* Copyright, 2000 Nevrax Ltd.
00018  *
00019  * This file is part of NEVRAX NEL.
00020  * NEVRAX NEL is free software; you can redistribute it and/or modify
00021  * it under the terms of the GNU General Public License as published by
00022  * the Free Software Foundation; either version 2, or (at your option)
00023  * any later version.
00024 
00025  * NEVRAX NEL is distributed in the hope that it will be useful, but
00026  * WITHOUT ANY WARRANTY; without even the implied warranty of
00027  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
00028  * General Public License for more details.
00029 
00030  * You should have received a copy of the GNU General Public License
00031  * along with NEVRAX NEL; see the file COPYING. If not, write to the
00032  * Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
00033  * MA 02111-1307, USA.
00034  */
00035 
00036 #ifndef NL_TYPES_H
00037 #define NL_TYPES_H
00038 
00039 // nelconfig.h inclusion, file generated by autoconf
00040 #ifdef HAVE_NELCONFIG_H
00041 #  include "nelconfig.h"
00042 #endif // HAVE_NELCONFIG_H
00043 
00044 
00045 // Operating systems definition
00046 
00047 #ifdef WIN32
00048 #  define NL_OS_WINDOWS
00049 #  define NL_LITTLE_ENDIAN
00050 #  define NL_CPU_INTEL
00051 #  ifdef _DEBUG
00052 #    define NL_DEBUG
00053 #    ifndef _STLP_USE_DEBUG_LIB
00054 #      define _STLP_USE_DEBUG_LIB               // we have to put this to include the stlport_debug.lib instead of stlport.lib
00055 #    endif
00056 #  else
00057 #    define NL_RELEASE
00058 #  endif
00059 #else
00060 #  define NL_OS_UNIX
00061 #  ifdef WORDS_BIGENDIAN
00062 #    define NL_BIG_ENDIAN
00063 #  else
00064 #    define NL_LITTLE_ENDIAN
00065 #  endif
00066 #endif
00067 
00068 
00069 // Remove stupid Visual C++ warning
00070 
00071 #ifdef NL_OS_WINDOWS
00072 #  pragma warning (disable : 4503)                      // STL: Decorated name length exceeded, name was truncated
00073 #  pragma warning (disable : 4786)                      // STL: too long indentifier
00074 #  pragma warning (disable : 4290)                      // throw() not implemented warning
00075 #  pragma warning (disable : 4250)                      // inherits via dominance (informational warning).
00076 #endif // NL_OS_UNIX
00077 
00078 
00079 // Standard include
00080 
00081 #include <string>
00082 #include <exception>
00083 
00084 
00085 // Check the STLPort presence
00086 
00087 #ifdef NL_OS_WINDOWS
00088 #ifndef __SGI_STL_PORT
00089 #  error "You need STLPort to compile this project (www.stlport.org)"
00090 #endif // __SGI_STL_PORT
00091 #endif // NL_OS_WINDOWS
00092 
00093 
00094 // Setup extern asm functions.
00095 
00096 #ifndef NL_NO_ASM                                                       // If NL_NO_ASM is externely defined, don't override it.
00097 #  ifndef NL_CPU_INTEL                                          // If not on an Intel compatible plateforme (BeOS, 0x86 Linux, Windows)
00098 #    define NL_NO_ASM                                           // Don't use extern ASM. Full C++ code.
00099 #  endif // NL_CPU_INTEL
00100 #endif // NL_NO_ASM
00101 
00102 
00103 // Define this if you want to use GTK for gtk_displayer
00104 
00105 //#define NL_USE_GTK
00106 #undef NL_USE_GTK
00107 
00108 
00109 // Standard types
00110 
00111 /*
00112  * correct numeric types:       sint8, uint8, sint16, uint16, sint32, uint32, sint64, uint64, sint, uint
00113  * correct char types:          char, string, ucchar, ucstring
00114  * correct misc types:          void, bool, float, double
00115  *
00116  */
00117 
00176 #ifdef NL_OS_WINDOWS
00177 
00178 typedef signed          __int8          sint8;
00179 typedef unsigned        __int8          uint8;
00180 typedef signed          __int16         sint16;
00181 typedef unsigned        __int16         uint16;
00182 typedef signed          __int32         sint32;
00183 typedef unsigned        __int32         uint32;
00184 typedef signed          __int64         sint64;
00185 typedef unsigned        __int64         uint64;
00186 
00187 typedef signed          int                     sint;                   // at least 32bits (depend of processor)
00188 typedef unsigned        int                     uint;                   // at least 32bits (depend of processor)
00189 
00190 #define NL_I64  \
00191                 "I64"
00192 
00193 #elif defined (NL_OS_UNIX)
00194 
00195 #include <sys/types.h>
00196 
00197 typedef int8_t          sint8;
00198 typedef u_int8_t        uint8;
00199 typedef int16_t         sint16;
00200 typedef u_int16_t       uint16;
00201 typedef int32_t         sint32;
00202 typedef u_int32_t       uint32;
00203 typedef int64_t         sint64;
00204 typedef u_int64_t       uint64;
00205 
00206 typedef signed          int                     sint;                   // at least 32bits (depend of processor)
00207 typedef unsigned        int                     uint;                   // at least 32bits (depend of processor)
00208 
00209 #define NL_I64  \
00210                 "ll"
00211 
00212 #endif // NL_OS_UNIX
00213 
00214 
00219 typedef uint16  ucchar;
00220 
00221 
00222 // to define a 64bits constant
00223 #ifdef NL_OS_WINDOWS
00224 #define INT64_CONSTANT(c)  (c) 
00225 #else 
00226 #define INT64_CONSTANT(c)  (c##LL)
00227 #endif
00228 
00229 
00233 #include "nel/memory/memory_manager.h"
00234 
00235 #endif // NL_TYPES_H