Fix build with bleeding edge GLib
[geany-mirror.git] / tagmanager / ctags / general.h
blob3635ade4af5eb31ca08da19e3efc21f28789b32c
1 /*
3 * Copyright (c) 1998-2001, Darren Hiebert
5 * This source code is released for free distribution under the terms of the
6 * GNU General Public License.
8 * Provides the general (non-ctags-specific) environment assumed by all.
9 */
10 #ifndef _GENERAL_H
11 #define _GENERAL_H
14 * INCLUDE FILES
16 #ifdef HAVE_CONFIG_H
17 # include <config.h>
18 #endif
19 #ifdef macintosh
20 # include "mac.h"
21 #endif
23 /* include unistd.h preventively because at least under MacOSX it is needed for off_t */
24 #include <unistd.h>
27 * MACROS
30 /* This is a helpful internal feature of later versions (> 2.7) of GCC
31 * to prevent warnings about unused variables.
33 #if (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)) && !(defined (__APPLE_CC__) || defined (__GNUG__))
34 # define UNUSED __attribute__((unused))
35 # define PRINTF(s,f) __attribute__((format (printf, s, f)))
36 #else
37 # define UNUSED
38 # define PRINTF(s,f)
39 #endif
42 /* MS-DOS doesn't allow manipulation of standard error, so we send it to
43 * stdout instead.
45 #if defined (MSDOS) || defined (WIN32)
46 # define errout stdout
47 #else
48 # define errout stderr
49 #endif
51 #if defined (__CYGWIN__)
52 # define UNIX_PATH_SEPARATOR 1
53 # define MSDOS_STYLE_PATH
54 #endif
56 #if defined (MSDOS) || defined (WIN32)
57 # define CASE_INSENSITIVE_FILENAMES
58 # define MSDOS_STYLE_PATH
59 # define HAVE_DOS_H 1
60 # define HAVE_FCNTL_H 1
61 # define HAVE_IO_H 1
62 # define HAVE_STDLIB_H 1
63 # define HAVE_SYS_STAT_H 1
64 # define HAVE_SYS_TYPES_H 1
65 # define HAVE_TIME_H 1
66 # define HAVE_CLOCK 1
67 # define HAVE_CHSIZE 1
68 # define HAVE_FGETPOS 1
69 # define HAVE_STRICMP 1
70 # define HAVE_STRNICMP 1
71 # define HAVE_STRSTR 1
72 # define HAVE_STRERROR 1
73 # define HAVE_FINDNEXT 1
74 # ifdef __BORLANDC__
75 # define HAVE_DIR_H 1
76 # define HAVE_DIRENT_H 1
77 # define HAVE_FINDFIRST 1
78 # elif defined (_MSC_VER)
79 # define HAVE__FINDFIRST 1
80 # define HAVE_DIRECT_H 1
81 # elif defined (__MINGW32__)
82 # define HAVE_DIR_H 1
83 # define HAVE_DIRENT_H 1
84 # define HAVE__FINDFIRST 1
85 # define ffblk _finddata_t
86 # define FA_DIREC _A_SUBDIR
87 # define ff_name name
88 # endif
89 /* provide the prototype for cross-compiling/Windows */
90 char *lrealpath(const char *filename);
91 #endif
93 #ifndef HAVE_FNMATCH_H
94 /* provide the prototype for cross-compiling/Windows */
95 int fnmatch(const char *pattern, const char *string, int flags);
96 #endif
98 #ifdef DJGPP
99 # define CASE_INSENSITIVE_FILENAMES
100 # define MSDOS_STYLE_PATH
101 # define HAVE_DIR_H 1
102 # define HAVE_SYS_STAT_H 1
103 # define HAVE_SYS_TYPES_H 1
104 # define HAVE_UNISTD_H 1
105 # define HAVE_FGETPOS 1
106 # define HAVE_FINDFIRST 1
107 # define HAVE_TRUNCATE 1
108 #endif
110 #ifdef OS2
111 # define UNIX_PATH_SEPARATOR 1
112 # define CASE_INSENSITIVE_FILENAMES
113 # define HAVE_DIRENT_H 1
114 # define HAVE_FCNTL_H 1
115 # define HAVE_IO_H 1
116 # define HAVE_STDLIB_H 1
117 # define HAVE_SYS_STAT_H 1
118 # define HAVE_SYS_TYPES_H 1
119 # define HAVE_TIME_H 1
120 # define HAVE_UNISTD_H 1
121 # define HAVE_CLOCK 1
122 # define HAVE_CHSIZE 1
123 # define HAVE_FGETPOS 1
124 # define HAVE_FTRUNCATE 1
125 # define HAVE_OPENDIR 1
126 # define HAVE_REGCOMP 1
127 # define HAVE_REMOVE 1
128 # define HAVE_STRERROR 1
129 # define HAVE_STRICMP 1
130 # define HAVE_STRNICMP 1
131 # define HAVE_STRSTR 1
132 # define HAVE_TRUNCATE 1
133 #endif
135 #ifdef AMIGA
136 # define HAVE_STDLIB_H 1
137 # define HAVE_SYS_STAT_H 1
138 # define HAVE_SYS_TYPES_H 1
139 # define HAVE_TIME_H 1
140 # define HAVE_CLOCK 1
141 # define HAVE_FGETPOS 1
142 # define HAVE_STRERROR 1
143 # define HAVE_STRICMP 1
144 # define HAVE_STRNICMP 1
145 #endif
147 #if defined (__MWERKS__) && defined (__MACINTOSH__)
148 # define HAVE_STAT_H 1
149 #endif
151 #ifdef QDOS
152 # define HAVE_DIRENT_H 1
153 # define HAVE_STDLIB_H 1
154 # define HAVE_SYS_STAT_H 1
155 # define HAVE_SYS_TIMES_H 1
156 # define HAVE_SYS_TYPES_H 1
157 # define HAVE_TIME_H 1
158 # define HAVE_UNISTD_H 1
159 # define STDC_HEADERS 1
160 # define HAVE_CLOCK 1
161 # define HAVE_FGETPOS 1
162 # define HAVE_FTRUNCATE 1
163 # define HAVE_OPENDIR 1
164 # define HAVE_PUTENV 1
165 # define HAVE_REMOVE 1
166 # define HAVE_STRERROR 1
167 # define HAVE_STRSTR 1
168 # define HAVE_TIMES 1
169 # define HAVE_TRUNCATE 1
170 # define NON_CONST_PUTENV_PROTOTYPE 1
171 #endif
173 #if defined (__vms) && ! defined (VMS)
174 # define VMS
175 #endif
176 #ifdef VMS
177 # define CASE_INSENSITIVE_FILENAMES 1
178 # define HAVE_STDLIB_H 1
179 # define HAVE_TIME_H 1
180 # ifdef VAXC
181 # define HAVE_STAT_H 1
182 # define HAVE_TYPES_H 1
183 # else
184 # define HAVE_FCNTL_H 1
185 # define HAVE_SYS_STAT_H 1
186 # define HAVE_SYS_TYPES_H 1
187 # endif
188 # define HAVE_CLOCK 1
189 # define HAVE_FGETPOS 1
190 # define HAVE_STRERROR 1
191 # define HAVE_STRSTR 1
192 # define HAVE_UNISTD_H 1
193 #endif
195 #ifdef __FreeBSD__
196 #include <sys/types.h>
197 #endif /* __FreeBSD__ */
199 /* Define regex if supported */
200 #if (defined (HAVE_REGCOMP) && !defined (REGCOMP_BROKEN)) || defined (HAVE_RE_COMPILE_PATTERN)
201 # define HAVE_REGEX 1
202 #endif
205 /* fake debug statement macro */
206 #define DebugStatement(x) ;
207 #define PrintStatus(x) ;
208 /* wrap g_warning so we don't include glib.h for all parsers, to keep compat with CTags */
209 void utils_warn(const char *msg);
210 #define Assert(x) if (!(x)) utils_warn("Assert(" #x ") failed!")
212 * DATA DECLARATIONS
215 #undef FALSE
216 #undef TRUE
217 #ifdef VAXC
218 typedef enum { FALSE, TRUE } booleanType;
219 typedef int boolean;
220 #else
221 # ifdef __cplusplus
222 typedef bool boolean;
223 #define FALSE false
224 #define TRUE true
225 # else
226 typedef enum { FALSE, TRUE } boolean;
227 # endif
228 #endif
230 #if ! defined (HAVE_FGETPOS) && ! defined (fpos_t)
231 # define fpos_t long
232 #endif
234 /* Work-around for broken implementation of fgetpos()/fsetpos() on Mingw32 */
235 #if defined (__MINGW32__) && defined (__MSVCRT__)
236 # undef HAVE_FGETPOS
237 #endif
240 * FUNCTION PROTOTYPES
243 #if defined (NEED_PROTO_REMOVE) && defined (HAVE_REMOVE)
244 extern int remove (const char *);
245 #endif
247 #if defined (NEED_PROTO_UNLINK) && ! defined (HAVE_REMOVE)
248 extern void *unlink (const char *);
249 #endif
251 #ifdef NEED_PROTO_GETENV
252 extern char *getenv (const char *);
253 #endif
255 #endif /* _GENERAL_H */
257 /* vi:set tabstop=8 shiftwidth=4: */