[no comment]
[ti-x.git] / src / prefix.h
bloba9915ba7d5299289f0198006c4bfded909cf58d3
1 /* the ti-x embed operation system
2 *
3 * it is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * it is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with it; If not, see <a href="http://www.gnu.org/licenses/">http://www.gnu.org/licenses/</a>
16 * Copyright (C) 2009, Ruki All rights reserved.
17 * Home: <a href="http://www.xxx.org">http://www.xxx.org</a>
19 * \author ruki
20 * \date 09.11.21
21 * \file prefix.h
22 * \brief the prefix file of ti-x
25 #ifndef TI_PREFIX_H
26 #define TI_PREFIX_H
28 /* ////////////////////////////////////////////////////////////////////////
29 * includes
32 // config
33 #include "config/config.h"
35 // types
36 #if defined(TI_CONFIG_ARCH_ARM)
37 # ifdef TI_CONFIG_CPU_S3C2440
38 # include "arch/arm/cpu-s3c2440/type.h"
39 # else
40 # error unknown cpu
41 # endif
42 #elif defined(TI_CONFIG_ARCH_LINUX_x86)
43 # include "arch/linux_x86/lib/type.h"
44 #else
45 # error unknown architecture
46 #endif
49 /* ////////////////////////////////////////////////////////////////////////
50 * the basic macros
52 // invalidate handle value
53 #define TI_INVALID_HANDLE ((ti_handle_t)(-1))
55 // return value
56 #define TI_TRUE ((ti_bool_t)(1))
57 #define TI_FALSE ((ti_bool_t)(0))
59 // NULL
60 #define TI_NULL ((void*)0)
62 /* ////////////////////////////////////////////////////////////////////////
63 * the gcc version
66 #define TI_GCC_VERSION_MAJOR (__GNUC__)
67 #define TI_GCC_VERSION_MINOR (__GNUC_MINOR__)
69 #if __GNUC__ == 2
71 # if __GNUC_MINOR__ < 95
72 # define TI_GCC_VERSION_STRING "GNU C/C++ <2.95"
73 # elif __GNUC_MINOR__ == 95
74 # define TI_GCC_VERSION_STRING "GNU C/C++ 2.95"
75 # elif __GNUC_MINOR__ == 96
76 # define TI_GCC_VERSION_STRING "GNU C/C++ 2.96"
77 # else
78 # define TI_GCC_VERSION_STRING "GNU C/C++ >2.96&&<3.0"
79 # endif
81 #elif __GNUC__ == 3
83 # if __GNUC_MINOR__ == 2
84 # define TI_GCC_VERSION_STRING "GNU C/C++ 3.2"
85 # elif __GNUC_MINOR__ == 3
86 # define TI_GCC_VERSION_STRING "GNU C/C++ 3.3"
87 # elif __GNUC_MINOR__ == 4
88 # define TI_GCC_VERSION_STRING "GNU C/C++ 3.4"
89 # else
90 # define TI_GCC_VERSION_STRING "GNU C/C++ >3.4&&<4.0"
91 # endif
93 #elif __GNUC__ == 4
95 # if __GNUC_MINOR__ == 1
96 # define TI_GCC_VERSION_STRING "GNU C/C++ 4.1"
97 # elif __GNUC_MINOR__ == 2
98 # define TI_GCC_VERSION_STRING "GNU C/C++ 4.2"
99 # elif __GNUC_MINOR__ == 3
100 # define TI_GCC_VERSION_STRING "GNU C/C++ 4.3"
101 # elif __GNUC_MINOR__ == 4
102 # define TI_GCC_VERSION_STRING "GNU C/C++ 4.4"
103 # endif
105 #else
106 # error Unknown GNU C/C++ Compiler Version
107 #endif
113 // TI_PREFIX_H
114 #endif