chiark / gitweb /
Add __oop-read-copy.c
[innduct.git] / include / inn / defines.h
1 /*  $Id: defines.h 6124 2003-01-14 06:03:29Z rra $
2 **
3 **  Portable defines used by other INN header files.
4 **
5 **  In order to make the libraries built by INN usable by other software,
6 **  INN needs to install several header files.  Installing autoconf-
7 **  generated header files, however, is a bad idea, since the defines will
8 **  conflict with other software that uses autoconf.
9 **
10 **  This header contains common definitions, such as internal typedefs and
11 **  macros, common to INN's header files but not based on autoconf probes.
12 **  As such, it's limited in what it can do; if compiling software against
13 **  INN's header files on a system not supporting basic ANSI C features
14 **  (such as const) or standard types (like size_t), the software may need
15 **  to duplicate the tests that INN itself performs, generate a config.h,
16 **  and make sure that config.h is included before any INN header files.
17 */
18
19 #ifndef INN_DEFINES_H
20 #define INN_DEFINES_H 1
21
22 #include <inn/system.h>
23
24 /* BEGIN_DECLS is used at the beginning of declarations so that C++
25    compilers don't mangle their names.  END_DECLS is used at the end. */
26 #undef BEGIN_DECLS
27 #undef END_DECLS
28 #ifdef __cplusplus
29 # define BEGIN_DECLS    extern "C" {
30 # define END_DECLS      }
31 #else
32 # define BEGIN_DECLS    /* empty */
33 # define END_DECLS      /* empty */
34 #endif
35
36 /* __attribute__ is available in gcc 2.5 and later, but only with gcc 2.7
37    could you use the __format__ form of the attributes, which is what we use
38    (to avoid confusion with other macros). */
39 #ifndef __attribute__
40 # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
41 #  define __attribute__(spec)   /* empty */
42 # endif
43 #endif
44
45 /* Used for unused parameters to silence gcc warnings. */
46 #define UNUSED  __attribute__((__unused__))
47
48 /* Make available the bool type. */
49 #if INN_HAVE_STDBOOL_H
50 # include <stdbool.h>
51 #else
52 # undef true
53 # undef false
54 # define true   (1)
55 # define false  (0)
56 # ifndef __cplusplus
57 #  define bool int
58 # endif
59 #endif /* INN_HAVE_STDBOOL_H */
60
61 /* Tell Perl that we have a bool type. */
62 #ifndef HAS_BOOL
63 # define HAS_BOOL 1
64 #endif
65
66 #endif /* !INN_DEFINES_H */