Golem  v0.1.1
Generic Operating system Libraries for Embedded Multitasking
 All Data Structures Files Functions Variables Pages
/home/ruud/Engineering/software/projects/golem-project-code/trunk/glm_intbase.h
Go to the documentation of this file.
1 
17 #ifndef _GLM_INTBASE_H_
18 #define _GLM_INTBASE_H_
19 
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23 
24 
25 /* INCLUDES *******************************************************************/
26 #include <stdint.h>
27 #include "glm_conf.h"
28 
29 
30 /* TYPES **********************************************************************/
31 
32 // Platform-dependant base types
33 #ifdef CORE_64BIT
34 
35 typedef uint64_t uint_base_t;
36 typedef int64_t int_base_t;
37 
38 #define UINT_BASE_MAX UINT64_MAX
39 #define INT_BASE_MIN INT64_MIN
40 #define INT_BASE_MAX INT64_MAX
41 
42 #elif defined CORE_32BIT
43 
44 typedef uint32_t uint_base_t;
45 typedef int32_t int_base_t;
46 
47 #define UINT_BASE_MAX UINT32_MAX
48 #define INT_BASE_MIN INT32_MIN
49 #define INT_BASE_MAX INT32_MAX
50 
51 
52 #elif defined CORE_16BIT
53 
54 typedef uint16_t uint_base_t;
55 typedef int16_t int_base_t;
56 
57 #define UINT_BASE_MAX UINT16_MAX
58 #define INT_BASE_MIN INT16_MIN
59 #define INT_BASE_MAX INT16_MAX
60 
61 #elif defined CORE_8BIT
62 
63 typedef uint8_t uint_base_t;
64 typedef int8_t int_base_t;
65 
66 #define UINT_BASE_MAX UINT8_MAX
67 #define INT_BASE_MIN INT8_MIN
68 #define INT_BASE_MAX INT8_MAX
69 
70 #else
71  #error "Please specify the target integer bit-width (8/16/32/64)"
72 #endif
73 
74 
75 #ifdef __cplusplus
76 }
77 #endif
78 
79 #endif /* _GLM_INTBASE_H_ */
80