comparison gpf/INC/typedefs.h @ 0:509db1a7b7b8

initial import: leo2moko-r1
author Space Falcon <falcon@ivan.Harhan.ORG>
date Mon, 01 Jun 2015 03:24:05 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:509db1a7b7b8
1 /*
2 +------------------------------------------------------------------------------
3 | File: typedefs.h
4 +------------------------------------------------------------------------------
5 | Copyright 2002 Texas Instruments Berlin, AG
6 | All rights reserved.
7 |
8 | This file is confidential and a trade secret of Texas
9 | Instruments Berlin, AG
10 | The receipt of or possession of this file does not convey
11 | any rights to reproduce or disclose its contents or to
12 | manufacture, use, or sell anything it may describe, in
13 | whole, or in part, without the specific written consent of
14 | Texas Instruments Berlin, AG.
15 +-----------------------------------------------------------------------------
16 | Purpose : Standard definitions.
17 +-----------------------------------------------------------------------------
18 */
19
20 #ifndef __TYPEDEFS_H__
21 #define __TYPEDEFS_H__
22
23 /*===== Include operating system specific type definitions ========*/
24 #ifdef _VXWORKS_
25 #include <vxWorks.h>
26 #endif
27
28 #ifdef PSOS
29 #include <stdio.h>
30 #endif
31
32 /*==== CONSTANTS ==================================================*/
33
34 #ifndef __INCvxWorksh
35 #define IMPORT EXTERN
36 #endif
37
38 #ifndef __cplusplus
39 #define EXTERN extern
40 #else
41 #define EXTERN extern "C"
42 #endif
43 #define LOCAL static
44 #define GLOBAL
45 #define EXPORT GLOBAL
46
47 /*lint -e723 supress Info -- Suspicious use of = */
48 #define EQ ==
49 /*lint +e723 */
50 #define NEQ !=
51 #define AND &&
52 #define OR ||
53 #define XOR(A,B) ((!(A) AND (B)) OR ((A) AND !(B)))
54
55 #ifndef FALSE
56 #define FALSE 0
57 #endif
58
59 #ifndef TRUE
60 #define TRUE 1
61 #endif
62
63 #ifndef NULL
64 #define NULL 0
65 #endif
66
67 /*==== TYPES ======================================================*/
68 #ifndef STDDEFS_H
69 typedef unsigned char U8;
70 typedef signed char S8;
71 typedef unsigned short U16;
72 typedef signed short S16;
73 typedef unsigned long U32;
74 typedef signed long S32;
75 typedef U32 MEMHANDLE;
76 /*
77 * UINT16 added for TI include files, to be removed ASAP
78 */
79
80 #ifndef GENERAL_H /* rivera include definitions are as ours */
81 #ifndef __INCvxTypesOldh
82 #if !defined NUCLEUS || !defined PLUS_VERSION_COMP
83 /* UINT16 is already defined in the nucleus.h for the arm9 */
84 typedef unsigned short UINT16;
85 #endif
86 #endif
87
88
89 typedef unsigned char UBYTE;
90 typedef short SHORT;
91 typedef UBYTE BYTE;
92
93 #if !defined (NUCLEUS)
94 typedef char CHAR;
95 #endif
96
97 /* the following construction assumes that we are on I86 using Windows.
98 It is introduced to avoid using WIN32 in GPF but keeping the compatibility with the
99 protocol stack
100 */
101 #if defined WIN32 || defined _WIN32
102 typedef int BOOL;
103 #else
104 #ifdef _VXWORKS_
105 #ifndef __INCvxTypesOldh
106 typedef int BOOL;
107 #endif
108 #else
109 typedef UBYTE BOOL;
110 #endif
111 #endif
112
113
114 #ifndef _TYPES_H
115 #ifndef __INCvxTypesOldh
116 typedef unsigned char UCHAR;
117 typedef unsigned short USHORT;
118 typedef unsigned long ULONG;
119 typedef unsigned int UINT;
120 #endif
121 #endif
122
123 #endif /* rivera include definitions are as ours */
124
125 typedef long LONG;
126
127 typedef unsigned long T_VOID_STRUCT;
128
129 typedef unsigned long T_ENUM;
130
131 #endif
132
133
134 /*==== EXPORT =====================================================*/
135
136 #define MAXIMUM(A,B) (((A)>(B))?(A):(B))
137
138 #define MINIMUM(A,B) (((A)<(B))?(A):(B))
139
140 /*
141 * NOTE: This is necessary until all occurences of Sprintf() in the
142 * protocol stack (GSM and GPRS) have been replaced with sprintf().
143 */
144 #define Sprintf sprintf
145
146
147 /*
148 * NOTE: The following macros redefine the predefined macros of
149 * the TMS470 compiler. This is usefull for creating binary
150 * equivalent object files. These files can be used for the
151 * comparison of to builds e.g. BUSYB and g23.pl.
152 *
153 * This approach may not work with other compilers.
154 */
155 #define TMS470_CDS "__NO_DATE__"
156 #define TMS470_CTS "__NO_TIME__"
157 #define TMS470_CFS "__NO_FILE__"
158
159 #endif
160