comparison src/cs/drivers/drv_core/general.h @ 0:92470e5d0b9e

src: partial import from FC Selenite
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 15 May 2020 01:28:16 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:92470e5d0b9e
1 /****************************************************************************/
2 /* */
3 /* Name general.h */
4 /* */
5 /* Function this file contains common data type definitions used */
6 /* throughout the SWE */
7 /* */
8 /* Date Modification */
9 /* ----------------------- */
10 /* 3/12/99 Create */
11 /* **************************************************************************/
12 /* 10/27/1999 David Lamy-Charrier: remove declaration of ntohs, htons, */
13 /* ntohl, htonl in order to avoid conflict */
14 /* with winsock.h */
15 /* */
16 /* 11/30/1999 Pascal Pompei: 'string.h' included in order to define memcmp,*/
17 /* memset and memcpy functions. */
18 /* */
19 /* */
20 /****************************************************************************/
21
22 #ifndef GENERAL_H
23 #define GENERAL_H
24
25 #ifdef _WINDOWS
26 #include <string.h>
27 #endif
28
29 /* WINDOWS */
30 #ifdef _WINDOWS
31 typedef unsigned short UINT16;
32 typedef unsigned int UINT32;
33 typedef unsigned char UBYTE;
34 typedef short SHORT;
35 typedef int BOOL;
36
37 /* BOARD */
38 #else
39 #ifndef __TYPEDEFS_H__ /* This #define allows to Condat to use general.h without conflict */
40 typedef unsigned short UINT16;
41 typedef unsigned char UBYTE;
42 typedef short SHORT;
43 typedef signed char BYTE;
44 #if !defined (BOOL_FLAG)
45 #define BOOL_FLAG
46 typedef unsigned char BOOL;
47 #endif
48 typedef unsigned short USHORT;
49 typedef unsigned int ULONG;
50 #endif
51 typedef unsigned long UINT32;
52 #endif
53
54 typedef unsigned char UINT8;
55 typedef signed char INT8;
56 typedef short INT16;
57 typedef int INT32;
58 typedef unsigned char BOOLEAN;
59
60 typedef void (*FUNC)(void); /* pointer to a function */
61
62 #define OK 1
63
64 #ifndef NULL
65 #define NULL 0
66 #endif
67
68 #ifndef TRUE
69 #define TRUE 1
70 #endif
71
72 #ifndef FALSE
73 #define FALSE 0
74 #endif
75
76
77 #define htons ntohs
78 #define htonl ntohl
79
80
81 #if !defined(_WIN32)
82 #define ntohs(n) (n)
83 #define ntohl(n) (n)
84 #define ntoh6(n) (n)
85 #endif
86
87 #endif /* #ifndef GENERAL_H */