comparison src/Port.h @ 30:48369c6aeaa0 compile-milestone

brought prof package in
author Robert McIntyre <rlm@mit.edu>
date Sun, 04 Mar 2012 22:32:01 -0600
parents f9f4f1b99eed
children
comparison
equal deleted inserted replaced
29:2fa26addb901 30:48369c6aeaa0
11 #define NULL 0 11 #define NULL 0
12 #endif 12 #endif
13 13
14 typedef unsigned char bool8; 14 typedef unsigned char bool8;
15 15
16 #ifdef HAVE_STDINT_H 16 //#ifdef HAVE_STDINT_H
17 #include <stdint.h> 17 #include <stdint.h>
18
19 // RLM combatibility junk
20
21 typedef uint8_t u8;
22 typedef uint16_t u16;
23 typedef uint32_t u32;
24 typedef uint64_t u64;
25
26 typedef int8_t s8;
27 typedef int16_t s16;
28 typedef int32_t s32;
29 typedef int64_t s64;
30
18 31
19 typedef int8_t int8; 32 typedef int8_t int8;
20 typedef uint8_t uint8; 33 typedef uint8_t uint8;
21 typedef int16_t int16; 34 typedef int16_t int16;
22 typedef uint16_t uint16; 35 typedef uint16_t uint16;
23 typedef int32_t int32; 36 typedef int32_t int32;
24 typedef uint32_t uint32; 37 typedef uint32_t uint32;
25 typedef int64_t int64; 38 typedef int64_t int64;
26 typedef uint64_t uint64; 39 typedef uint64_t uint64;
27 typedef intptr_t pint; 40 typedef intptr_t pint;
28
29 #else /* Don't have stdint.h */
30
31 #ifdef PTR_NOT_INT
32 typedef long pint;
33 #else /* pointer is int */
34 typedef int pint;
35 #endif /* PTR_NOT_INT */
36
37 /* FIXME: Refactor this by moving out the BORLAND part and unifying typedefs */
38 #ifndef WIN32
39 typedef unsigned char uint8;
40 typedef unsigned short uint16;
41 typedef signed char int8;
42 typedef short int16;
43 typedef int int32;
44 typedef unsigned int uint32;
45 # ifdef __GNUC__ /* long long is not part of ISO C++ */
46 __extension__ typedef long long int64;
47 __extension__ typedef unsigned long long uint64;
48 # else
49 typedef long long int64;
50 typedef unsigned long long uint64;
51 # endif
52 #else /* WIN32 */
53
54 # ifdef __BORLANDC__
55 # include <systypes.h>
56 # else
57
58 typedef unsigned char uint8;
59 typedef unsigned short uint16;
60 typedef signed char int8;
61 typedef short int16;
62
63 # ifndef WSAAPI
64 /* winsock2.h typedefs int32 as well. */
65 typedef long int32;
66 # endif
67
68 typedef unsigned int uint32;
69
70 # endif /* __BORLANDC__ */
71
72 typedef __int64 int64;
73 typedef unsigned __int64 uint64;
74
75 #endif /* WIN32 */
76 #endif /* HAVE_STDINT_H */
77 41
78 #ifndef WIN32 42 #ifndef WIN32
79 43
80 #ifndef PATH_MAX 44 #ifndef PATH_MAX
81 #define PATH_MAX 1024 45 #define PATH_MAX 1024
96 #else /* WIN32 */ 60 #else /* WIN32 */
97 #define strcasecmp stricmp 61 #define strcasecmp stricmp
98 #define strncasecmp strnicmp 62 #define strncasecmp strnicmp
99 #endif 63 #endif
100 64
101 typedef uint8 u8;
102 typedef uint16 u16;
103 typedef uint32 u32;
104 typedef uint64 u64;
105 typedef int8 s8;
106 typedef int16 s16;
107 typedef int32 s32;
108 typedef int64 s64;
109 65
110 // for consistency 66 // for consistency
111 static inline u8 swap8(u8 v) 67 static inline u8 swap8(u8 v)
112 { 68 {
113 return v; 69 return v;