Panda3D

numeric_types.h

00001 // Filename: numeric_types.h
00002 // Created by:  drose (06Jun00)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) Carnegie Mellon University.  All rights reserved.
00008 //
00009 // All use of this software is subject to the terms of the revised BSD
00010 // license.  You should have received a copy of this license along
00011 // with this source code in a file named "LICENSE."
00012 //
00013 ////////////////////////////////////////////////////////////////////
00014 
00015 #ifndef NUMERIC_TYPES_H
00016 #define NUMERIC_TYPES_H
00017 
00018 #include "dtoolbase.h"
00019 
00020 // This header file defines a number of typedefs that correspond to
00021 // the various numeric types for unsigned and signed numbers of
00022 // various widths.
00023 
00024 #if defined(WIN32_VC) && !defined(CPPPARSER)
00025 typedef signed __int8  PN_int8;
00026 typedef signed __int16 PN_int16;
00027 typedef signed __int32 PN_int32;
00028 typedef signed __int64 PN_int64;
00029 
00030 typedef unsigned __int8  PN_uint8;
00031 typedef unsigned __int16 PN_uint16;
00032 typedef unsigned __int32 PN_uint32;
00033 typedef unsigned __int64 PN_uint64;
00034 
00035 #elif defined(PHAVE_STDINT_H)
00036 
00037 #include <stdint.h>
00038 
00039 typedef int8_t  PN_int8;
00040 typedef int16_t PN_int16;
00041 typedef int32_t PN_int32;
00042 typedef int64_t PN_int64;
00043 
00044 typedef uint8_t  PN_uint8;
00045 typedef uint16_t PN_uint16;
00046 typedef uint32_t PN_uint32;
00047 typedef uint64_t PN_uint64;
00048 
00049 #else
00050 
00051 // This is risky, but we have no other choice.
00052 typedef signed char PN_int8;
00053 typedef short int PN_int16;
00054 typedef int PN_int32;
00055 #if NATIVE_WORDSIZE == 64
00056 typedef long int PN_int64;
00057 #else
00058 typedef long long int PN_int64;
00059 #endif
00060 
00061 typedef unsigned char PN_uint8;
00062 typedef unsigned short int PN_uint16;
00063 typedef unsigned int PN_uint32;
00064 #if NATIVE_WORDSIZE == 64
00065 typedef unsigned long int PN_uint64;
00066 #else
00067 typedef unsigned long long int PN_uint64;
00068 #endif
00069 
00070 #endif
00071 
00072 typedef double PN_float64;
00073 typedef float PN_float32;
00074 
00075 #endif
00076 
 All Classes Functions Variables Enumerations