Mon, 17 Jan 2005 22:02:09 +0100
trunk: changeset 1934
Fixed everything that requires locale stuff to check CF_NO_LOCALE.
58 | 1 | /* |
2 | * libtu/types.h | |
3 | * | |
4 | * Copyright (c) Tuomo Valkonen 1999-2002. | |
5 | * | |
6 | * You may distribute and modify this library under the terms of either | |
7 | * the Clarified Artistic License or the GNU LGPL, version 2.1 or later. | |
8 | */ | |
9 | ||
10 | #ifndef LIBTU_TYPES_H | |
11 | #define LIBTU_TYPES_H | |
12 | ||
13 | #include <sys/types.h> | |
14 | ||
15 | #ifndef TRUE | |
16 | #define TRUE 1 | |
17 | #endif | |
18 | ||
19 | #ifndef FALSE | |
20 | #define FALSE 0 | |
21 | #endif | |
22 | ||
23 | #ifndef NULL | |
24 | #define NULL ((void*)0) | |
25 | #endif | |
26 | ||
27 | #ifndef LIBTU_TYPEDEF_UXXX | |
28 | ||
29 | /* All systems seem to define these whichever way they want to | |
30 | * despite -D_*_SOURCE etc. so there is no easy way to know whether | |
31 | * they can be typedef'd or not. Unless you want to go through using | |
32 | * autoconf or similar methods. ==> Just stick to #define. :-( | |
33 | */ | |
34 | ||
35 | #ifndef uchar | |
36 | #define uchar unsigned char | |
37 | #endif | |
38 | ||
39 | #ifndef ushort | |
40 | #define ushort unsigned short | |
41 | #endif | |
42 | ||
43 | #ifndef uint | |
44 | #define uint unsigned int | |
45 | #endif | |
46 | ||
47 | #ifndef ulong | |
48 | #define ulong unsigned long | |
49 | #endif | |
50 | ||
51 | #else /* LIBTU_TYPEDEF_UXXX */ | |
52 | ||
53 | #ifndef uchar | |
54 | typedef unsigned char uchar; | |
55 | #endif | |
56 | ||
57 | #ifndef ushort | |
58 | typedef unsigned short ushort; | |
59 | #endif | |
60 | ||
61 | #ifndef uint | |
62 | typedef unsigned int uint; | |
63 | #endif | |
64 | ||
65 | #ifndef ulong | |
66 | typedef unsigned long ulong; | |
67 | #endif | |
68 | ||
69 | #endif /* LIBTU_TYPEDEF_UXXX */ | |
70 | ||
71 | ||
72 | #ifndef LIBTU_TYPEDEF_BOOL | |
73 | ||
74 | #ifndef bool | |
75 | #define bool int | |
76 | #endif | |
77 | ||
78 | #else /* LIBTU_TYPEDEF_BOOL */ | |
79 | ||
80 | #ifndef bool | |
81 | typedef int bool; | |
82 | #endif | |
83 | ||
84 | #endif /* LIBTU_TYPEDEF_BOOL */ | |
85 | ||
86 | #endif /* LIBTU_TYPES_H */ |