1 /* Basic types that we use.
2    Copyright 2004 Brian R. Gaeke.
3 
4 This file is part of VMIPS.
5 
6 VMIPS is free software; you can redistribute it and/or modify it
7 under the terms of the GNU General Public License as published by the
8 Free Software Foundation; either version 2 of the License, or (at your
9 option) any later version.
10 
11 VMIPS is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14 for more details.
15 
16 You should have received a copy of the GNU General Public License along
17 with VMIPS; if not, write to the Free Software Foundation, Inc.,
18 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
19 
20 #ifndef _TYPES_H_
21 #define _TYPES_H_
22 
23 /* First of all, pull in answers from autoconfiguration system. */
24 #include "config.h"
25 
26 /* Find me a 64-bit type (the only one that's not strictly necessary.....) */
27 #if SIZEOF_INT == 8
28 typedef unsigned int uint64;
29 typedef int int64;
30 #define HAVE_LONG_LONG 1
31 #elif SIZEOF_LONG == 8
32 typedef unsigned long uint64;
33 typedef long int64;
34 #define HAVE_LONG_LONG 1
35 #elif SIZEOF_LONG_LONG == 8
36 typedef unsigned long long uint64;
37 typedef long long int64;
38 #define HAVE_LONG_LONG 1
39 #endif
40 
41 /* Normal-sized types. */
42 #if SIZEOF_INT == 4
43 typedef unsigned int uint32;
44 typedef int int32;
45 #elif SIZEOF_LONG == 4
46 typedef unsigned long uint32;
47 typedef long int32;
48 #else
49 #error "Can't find a 32-bit type, and I need one."
50 #endif
51 
52 #if SIZEOF_SHORT == 2
53 typedef unsigned short uint16;
54 typedef short int16;
55 #else
56 #error "Can't find a 16-bit type, and I need one."
57 #endif
58 
59 #if SIZEOF_CHAR == 1
60 typedef unsigned char uint8;
61 typedef char int8;
62 #else
63 #error "Can't find an 8-bit type, and I need one."
64 #endif
65 
66 #endif /* _TYPES_H_ */
67