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

ptypes.h

Go to the documentation of this file.
00001 /*
00002  *   P::Classes - Portable C++ Application Framework
00003  *   Copyright (C) 2000-2003  Christian Prochnow <cproch@seculogix.de>
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 
00020 #ifndef _ptypes_h_
00021 #define _ptypes_h_
00022 
00023 #include <pclasses/config.h>
00024 #include <sys/types.h>
00025 #include <stddef.h>
00026 
00027 #ifdef WIN32
00028   typedef int ssize_t;
00029 #endif
00030 
00031 namespace P {
00032 
00033 typedef char int8_t;
00034 typedef unsigned char uint8_t;
00035 
00036 #if SIZEOF_SHORT == 2
00037   typedef short int16_t;
00038   typedef unsigned short uint16_t;
00039 #elif SIZEOF_INT == 2
00040   typedef int int16_t;
00041   typedef unsigned int uint16_t;
00042 #elif SIZEOF_LONG_INT == 2
00043   typedef long int int16_t;
00044   typedef unsigned long int uint16_t;
00045 #endif
00046 
00047 #if SIZEOF_SHORT == 4
00048   typedef short int32_t;
00049   typedef unsigned short uint32_t;
00050 #elif SIZEOF_INT == 4
00051   typedef int int32_t;
00052   typedef unsigned int uint32_t;
00053 #elif SIZEOF_LONG_INT == 4
00054   typedef long int int32_t;
00055   typedef unsigned long int uint32_t;
00056 #endif
00057 
00058 #if SIZEOF_SHORT == 8
00059   typedef short int64_t;
00060   typedef unsigned short uint64_t;
00061   #define HAVE_64BIT_INT 1
00062 #elif SIZEOF_INT == 8
00063   typedef int int64_t;
00064   typedef unsigned int uint64_t;
00065   #define HAVE_64BIT_INT 1
00066 #elif SIZEOF_LONG_INT == 8
00067   typedef long int int64_t;
00068   typedef unsigned long int uint64_t;
00069   #define HAVE_64BIT_INT 1
00070 #elif defined(HAVE___INT64)
00071   typedef __int64 int64_t;
00072   typedef unsigned __int64 uint64_t;
00073   #define HAVE_64BIT_INT 1
00074 #elif defined(HAVE_LONGLONG) && SIZEOF_LONG_LONG == 8
00075   typedef long long int64_t;
00076   typedef unsigned long long uint64_t;
00077   #define HAVE_64BIT_INT 1
00078 #endif
00079 
00080 using ::size_t;
00081 using ::ssize_t;
00082 using ::off_t;
00083 
00084 #ifdef HAVE_LARGEFILE64
00085   typedef uint64_t off64_t;
00086 #endif
00087 
00088 #ifdef _MSC_VER
00089   #define P_64BIT_CONSTANT(x)     x##i64
00090   #define P_U64BIT_CONSTANT(x)    x##ui64
00091 #else
00092   #define P_64BIT_CONSTANT(x)     x##ll
00093   #define P_U64BIT_CONSTANT(x)    x##ull
00094 #endif
00095 
00096 }
00097 
00098 #endif

Generated on Fri Mar 12 21:08:31 2004 for P::Classes by doxygen 1.3.3