gltypes.h

00001 /*
00002 Copyright (c) 2000-2007 Lee Thomason (www.grinninglizard.com)
00003 Grinning Lizard Utilities.
00004 
00005 This software is provided 'as-is', without any express or implied 
00006 warranty. In no event will the authors be held liable for any 
00007 damages arising from the use of this software.
00008 
00009 Permission is granted to anyone to use this software for any 
00010 purpose, including commercial applications, and to alter it and 
00011 redistribute it freely, subject to the following restrictions:
00012 
00013 1. The origin of this software must not be misrepresented; you must 
00014 not claim that you wrote the original software. If you use this 
00015 software in a product, an acknowledgment in the product documentation 
00016 would be appreciated but is not required.
00017 
00018 2. Altered source versions must be plainly marked as such, and 
00019 must not be misrepresented as being the original software.
00020 
00021 3. This notice may not be removed or altered from any source 
00022 distribution.
00023 */
00024 
00025 
00026 
00027 #ifndef GRINLIZ_TYPES_INCLUDED
00028 #define GRINLIZ_TYPES_INCLUDED
00029 
00030 #ifdef GL_NO_SDL
00031         // Typically, this isn't what you want. SDL provides great defaults.
00032         // But if there isn't SDL:
00033         
00034         typedef unsigned char   U8;
00035         typedef signed char         S8;
00036         typedef unsigned short  U16;
00037         typedef signed short    S16;
00038         typedef unsigned long   U32;
00039         typedef long                    S32;
00040         
00041         #ifdef _MSC_VER
00042                 typedef unsigned __int64        U64;
00043                 typedef __int64                         S64;
00044         #else
00045                 typedef unsigned long long      U64;
00046                 typedef long long                       S64;
00047         #endif
00048         
00049 #else
00050         #include "SDL_types.h"
00051         //#include <SDL/SDL_types.h>
00052         
00053         typedef Uint8                   U8;
00054         typedef Sint8               S8;
00055         typedef Uint16                  U16;
00056         typedef Sint16                  S16;
00057         typedef Uint32                  U32;
00058         typedef Sint32                  S32;
00059         
00060         #ifdef SDL_HAS_64BIT_TYPE
00061                 typedef Sint64                          S64;
00062                 typedef Uint64                          U64;
00063         #else
00064                 #error No 64-bit integer.
00065         #endif
00066 #endif
00067 
00068 // Set up for 64 bit pointers.
00069 #if defined(_MSC_VER) && (_MSC_VER >= 1400 )
00070         #include <stdlib.h>
00071         typedef uintptr_t               UPTR;
00072         typedef intptr_t                SPTR;
00073 #elif defined (__GNUC__) && (__GNUC__ >= 3 )
00074         #include <inttypes.h>
00075         typedef uintptr_t               UPTR;
00076         typedef intptr_t                SPTR;
00077 #else
00078         // Assume not 64 bit pointers. Get a new compiler.
00079         typedef U32 UPTR;
00080         typedef S32 SPTR;
00081 #endif
00082 
00083 #endif

Generated on Fri Mar 23 19:36:21 2007 for Lilith3D by  doxygen 1.5.1-p1