-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypes.h
94 lines (74 loc) · 1.89 KB
/
types.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#ifndef __TYPE_H__
#define __TYPE_H__
/********************************************************************
* Elementary data types
********************************************************************/
/*
* This Cygwin patch is due to Isaac Salzman
*/
#ifdef __CYGWIN
# include <sys/param.h>
# define __LITTLE_ENDIAN LITTLE_ENDIAN
# define __BIG_ENDIAN BIG_ENDIAN
# define __BYTE_ORDER BYTE_ORDER
#elif sun
# include <sys/isa_defs.h>
#else
# include <endian.h>
#endif /* __CYGWIN */
#ifdef sun
# include <sys/int_limits.h>
#else
# include <stdint.h>
#endif
/*
* This O_BINARY patch was inspired by Mark Contois
*/
#ifndef O_BINARY
# define O_BINARY 0
#endif /* O_BINARY */
/*Groan: some machines don't define these */
#ifndef __LITTLE_ENDIAN
# define __LITTLE_ENDIAN 1234
#endif
#ifndef __BIG_ENDIAN
# define __BIG_ENDIAN 4321
#endif
#ifndef __PDP_ENDIAN
# define __PDP_ENDIAN 3412
#endif
#ifndef __BYTE_ORDER
# ifdef _LITTLE_ENDIAN
# define __BYTE_ORDER __LITTLE_ENDIAN
# endif
# ifdef _BIG_ENDIAN
# define __BYTE_ORDER __BIG_ENDIAN
# endif
# ifdef _PDP_ENDIAN
# define __BYTE_ORDER __PDP_ENDIAN
# endif
#endif
#define CPU_ENDIAN_LITTLE __LITTLE_ENDIAN
#define CPU_ENDIAN_BIG __BIG_ENDIAN
#define CPU_ENDIAN_PDP __PDP_ENDIAN
#define CPU_ENDIAN __BYTE_ORDER
#ifndef NULL
# define NULL 0
#endif // NULL
// Fixed size data types
typedef signed char Int8;
typedef signed short Int16;
typedef signed long Int32;
typedef unsigned char UInt8;
typedef unsigned short UInt16;
typedef unsigned long UInt32;
// Logical data types
typedef unsigned char Boolean;
typedef char Char;
typedef UInt16 WChar; // 'wide' int'l character type.
typedef UInt16 Err;
typedef UInt32 LocalID; // local (card relative) chunk ID
typedef Int16 Coord; // screen/window coordinate
typedef void * MemPtr; // global pointer
typedef struct _opaque* MemHandle; // global handle
#endif // __TYPE_H__