stdint/numeric_types stuff, let's follow the standards

This commit is contained in:
rdb 2010-03-29 15:38:40 +00:00
parent 05c8023f55
commit 2a6974eec2
11 changed files with 70 additions and 45 deletions

View File

@ -278,6 +278,9 @@
// Do we have <linux/input.h> ? This enables us to use raw mouse input.
#define PHAVE_LINUX_INPUT_H
// Do we have <stdint.h>?
#define PHAVE_STDINT_H 1
// Do we have RTTI (and <typeinfo>)?
#define HAVE_RTTI 1

View File

@ -137,6 +137,9 @@
// interface)?
#define PHAVE_SYS_SOUNDCARD_H
// Do we have <stdint.h>?
#define PHAVE_STDINT_H
// Do we have RTTI (and <typeinfo>)?
#define HAVE_RTTI 1

View File

@ -324,6 +324,9 @@
// Do we have RTTI (and <typeinfo>)?
#define HAVE_RTTI 1
// Do we have <stdint.h>?
#define PHAVE_STDINT_H 1
// We need 64-bit file i/o
#define __USE_LARGEFILE64 1

View File

@ -281,6 +281,9 @@
// definitions.
#define USE_STL_ALLOCATOR 1
// Do we have <stdint.h>?
#define PHAVE_STDINT_H 1
// The dynamic library file extension (usually .so .dll or .dylib):
#define DYNAMIC_LIB_EXT .dylib
#define STATIC_LIB_EXT .a

View File

@ -157,6 +157,9 @@
// Do we have RTTI (and <typeinfo>)?
#define HAVE_RTTI 1
// Do we have <stdint.h>?
#define PHAVE_STDINT_H
// MSVC7 does support the latest STL allocator definitions.
#define USE_STL_ALLOCATOR 1

View File

@ -626,6 +626,9 @@ $[cdefine PHAVE_UCONTEXT_H]
/* Do we have <linux/input.h> ? This enables us to use raw mouse input. */
$[cdefine PHAVE_LINUX_INPUT_H]
/* Do we have <stdint.h>? */
$[cdefine PHAVE_STDINT_H]
/* Do we have RTTI (and <typeinfo>)? */
$[cdefine HAVE_RTTI]

View File

@ -162,6 +162,10 @@
#include <sys/time.h>
#endif
#ifdef PHAVE_STDINT_H
#include <stdint.h>
#endif
#ifdef CPPPARSER
#include <stdtypedefs.h>
#endif
@ -289,7 +293,9 @@
/* Try to determine if we're compiling in a 64-bit mode. */
#if defined(_LP64)
#ifdef __WORDSIZE
#define NATIVE_WORDSIZE __WORDSIZE
#elif defined(_LP64)
#define NATIVE_WORDSIZE 64
#else
#define NATIVE_WORDSIZE 32

View File

@ -21,47 +21,56 @@
// the various numeric types for unsigned and signed numbers of
// various widths.
#if defined(_LP64)
// A 64-bit environment.
typedef signed char PN_int8;
typedef short PN_int16;
typedef int PN_int32;
typedef unsigned char PN_uint8;
typedef unsigned short PN_uint16;
typedef unsigned int PN_uint32;
typedef long PN_int64;
typedef unsigned long PN_uint64;
typedef double PN_float64;
typedef float PN_float32;
#else // _LP64
// A 32-bit environment.
typedef signed char PN_int8;
typedef short PN_int16;
typedef int PN_int32;
typedef unsigned char PN_uint8;
typedef unsigned short PN_uint16;
typedef unsigned int PN_uint32;
#ifdef WIN32_VC
typedef __int64 PN_int64;
typedef signed __int8 PN_int8;
typedef signed __int16 PN_int16;
typedef signed __int32 PN_int32;
typedef signed __int64 PN_int64;
typedef unsigned __int8 PN_uint8;
typedef unsigned __int16 PN_uint16;
typedef unsigned __int32 PN_uint32;
typedef unsigned __int64 PN_uint64;
#elif defined(PHAVE_STDINT_H)
#include <stdint.h>
typedef int8_t PN_int8;
typedef int16_t PN_int16;
typedef int32_t PN_int32;
typedef int64_t PN_int64;
typedef uint8_t PN_uint8;
typedef uint16_t PN_uint16;
typedef uint32_t PN_uint32;
typedef uint64_t PN_uint64;
#else
typedef long long PN_int64;
typedef unsigned long long PN_uint64;
// This is risky, but we have no other choice.
typedef signed char PN_int8;
typedef short int PN_int16;
typedef int PN_int32;
#if NATIVE_WORDSIZE == 64
typedef long int PN_int64;
#else
typedef long long int PN_int64;
#endif
typedef unsigned char PN_uint8;
typedef unsigned short int PN_uint16;
typedef unsigned int PN_uint32;
#if NATIVE_WORDSIZE == 64
typedef unsigned long int PN_uint64;
#else
typedef unsigned long long int PN_uint64;
#endif
#endif
typedef double PN_float64;
typedef float PN_float32;
#endif // _LP64
#endif

View File

@ -1,6 +1,6 @@
#define INSTALL_PARSER_INC \
algorithm deque ft2build.h hash_map hash_set iostream list map memory \
pair pthread.h queue set stack stdcompare.h stdtypedefs.h \
pair pthread.h queue set stack stdcompare.h stdtypedefs.h stdint.h \
string vector windows.h winsock2.h zlib.h files.h hex.h \
math.h md5.h evp.h bits/pthreadtypes.h \
openssl/md5.h openssl/evp.h openssl/rand.h openssl/ssl.h \

View File

@ -38,15 +38,6 @@ typedef unsigned long ulong;
typedef unsigned short ushort;
typedef unsigned char uchar;
typedef unsigned char uint8_t;
typedef char int8_t;
typedef unsigned short uint16_t;
typedef short int16_t;
typedef unsigned int uint32_t;
typedef int int32_t;
typedef unsigned long long uint64_t;
typedef long long int64_t;
#define NULL ((void *)0)
typedef int fd_set;

View File

@ -1305,6 +1305,7 @@ DTOOL_CONFIG=[
("PHAVE_DIRENT_H", 'UNDEF', '1'),
("PHAVE_SYS_SOUNDCARD_H", 'UNDEF', '1'),
("PHAVE_UCONTEXT_H", 'UNDEF', '1'),
("PHAVE_STDINT_H", 'UNDEF', '1'),
("HAVE_RTTI", '1', '1'),
("HAVE_X11", 'UNDEF', '1'),
("HAVE_XRANDR", 'UNDEF', '1'),