libsmbios_c library
types.h
Go to the documentation of this file.
1 // vim:expandtab:autoindent:tabstop=4:shiftwidth=4:filetype=c:
2 /*
3  * Copyright (C) 2005 Dell Inc.
4  * by Michael Brown <Michael_E_Brown@dell.com>
5  * Licensed under the Open Software License version 2.1
6  *
7  * Alternatively, you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published
9  * by the Free Software Foundation; either version 2 of the License,
10  * or (at your option) any later version.
11 
12  * This program is distributed in the hope that it will be useful, but
13  * WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15  * See the GNU General Public License for more details.
16  */
17 
18 
19 #ifndef TYPES_H
20 #define TYPES_H
21 
22 // compat header should always be first header
23 #include "smbios/compat.h"
24 
25 #ifndef TYPE_DEFINED_U8
26 #define TYPE_DEFINED_U8
27 typedef unsigned char u8;
28 #endif
29 #ifndef TYPE_DEFINED_U16
30 #define TYPE_DEFINED_U16
31 typedef unsigned short u16;
32 #endif
33 #ifndef TYPE_DEFINED_U32
34 #define TYPE_DEFINED_U32
35 typedef unsigned int u32;
36 #endif
37 
38 
39 #ifndef TYPE_DEFINED_S8
40 #define TYPE_DEFINED_S8
41 typedef signed char s8;
42 #endif
43 #ifndef TYPE_DEFINED_S16
44 #define TYPE_DEFINED_S16
45 typedef signed short s16;
46 #endif
47 #ifndef TYPE_DEFINED_S32
48 #define TYPE_DEFINED_S32
49 typedef signed int s32;
50 #endif
51 
52 #ifndef TYPE_DEFINED_U64
53 #define TYPE_DEFINED_U64
54 #if defined(LIBSMBIOS_HAS_LONG_LONG)
55 typedef unsigned long long u64;
56 #elif defined(LIBSMBIOS_HAS_MS_INT64)
57 typedef unsigned __int64 u64;
58 #else
59 #error "No LONG LONG or __INT64 support. Current compiler config is not supported."
60 #endif
61 #endif
62 
63 #ifndef TYPE_DEFINED_S64
64 #define TYPE_DEFINED_S64
65 #if defined(LIBSMBIOS_HAS_LONG_LONG)
66 typedef signed long long s64;
67 #elif defined(LIBSMBIOS_HAS_MS_INT64)
68 typedef signed __int64 s64;
69 #else
70 #error "No LONG LONG or __INT64 support. Current compiler config is not supported."
71 #endif
72 #endif
73 
74 #endif /* TYPES_H */