common_types.h

Go to the documentation of this file.
00001 /*
00002  *  Copyright (C) 2000-2001  The Exult Team
00003  *  Copyright (C) 2003-2004  The Pentagram Team
00004  *
00005  *  This program is free software; you can redistribute it and/or modify
00006  *  it under the terms of the GNU General Public License as published by
00007  *  the Free Software Foundation; either version 2 of the License, or
00008  *  (at your option) any later version.
00009  *
00010  *  This program 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
00013  *  GNU General Public License for more details.
00014  *
00015  *  You should have received a copy of the GNU General Public License
00016  *  along with this program; if not, write to the Free Software
00017  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00018  */
00019 
00020 #ifndef COMMON_TYPES_H
00021 #define COMMON_TYPES_H
00022 
00023 //
00024 // {s,u}int{8,16,32,ptr}
00025 //
00026 #ifndef BASIC_TYPES_DEFINED
00027 #define BASIC_TYPES_DEFINED
00028 
00029 #ifndef EX_TYPE_INT8
00030 #  define EX_TYPE_INT8 char /* guaranteed by ISO */
00031 #endif
00032 
00033 #ifndef EX_TYPE_INT16
00034 #  if (SIZEOF_SHORT == 2)
00035 #    define EX_TYPE_INT16 short
00036 #  elif (SIZEOF_INT == 2)
00037 #    define EX_TYPE_INT16 int
00038 #  else
00039 #    error "Please make sure a 16 bit type is provided by common_types.h"
00040 #  endif
00041 #endif /* !EX_TYPE_INT16 */
00042 
00043 
00044 #ifndef EX_TYPE_INT32
00045 #  if (SIZEOF_INT == 4)
00046 #    define EX_TYPE_INT32 int
00047 #  elif (SIZEOF_LONG == 4)
00048 #    define EX_TYPE_INT32 long
00049 #  elif (SIZEOF_LONG_LONG == 4)
00050 #    define EX_TYPE_INT32 long long
00051 #  else
00052 #    error "Please make sure a 32 bit type is provided by common_types.h"
00053 #  endif
00054 #endif /* !EX_TYPE_INT32 */
00055 
00056 #ifndef EX_TYPE_INTPTR
00057 #  if (SIZEOF_INTP == SIZEOF_INT)
00058 #    define EX_TYPE_INTPTR int
00059 #  elif (SIZEOF_INTP == SIZEOF_LONG)
00060 #    define EX_TYPE_INTPTR long
00061 #  elif (SIZEOF_INTP == SIZEOF_LONG_LONG)
00062 #    define EX_TYPE_INTPTR long long
00063 #  else
00064 #    error "Size of pointer type not equal to int, long or long long"
00065 #  endif
00066 #endif
00067 
00068 typedef unsigned EX_TYPE_INT8   uint8;
00069 typedef unsigned EX_TYPE_INT16  uint16;
00070 typedef unsigned EX_TYPE_INT32  uint32;
00071 
00072 typedef signed EX_TYPE_INT8             sint8;
00073 typedef signed EX_TYPE_INT16    sint16;
00074 typedef signed EX_TYPE_INT32    sint32;
00075 
00076 typedef unsigned EX_TYPE_INTPTR uintptr;
00077 typedef signed EX_TYPE_INTPTR sintptr;
00078 
00079 #endif
00080 
00081 // ObjId and ProcId
00082 
00084 typedef uint16 ObjId;
00085 
00087 typedef uint16 ProcId;
00088 
00089 #endif
00090 

Generated on Fri Jul 27 22:27:10 2007 for pentagram by  doxygen 1.4.7