]> sjero.net Git - wget/blob - src/config-post.h
[svn] New option --ignore-case for case-insensitive matching.
[wget] / src / config-post.h
1 /* Some autoconf-unrelated preprocessor magic that needs to be done
2    *before* including the system includes and therefore cannot belong
3    in sysdep.h.
4
5    Everything else related to system tweaking belongs to sysdep.h.
6
7    This file is included at the bottom of config.h.  */
8
9 /* Testing for __sun is not enough because it's also defined on SunOS.  */
10 #ifdef __sun
11 # ifdef __SVR4
12 #  define solaris
13 # endif
14 #endif
15
16 /* The "namespace tweaks" below attempt to set a friendly "compilation
17    environment" under popular operating systems.  Default compilation
18    environment often means that some functions that are "extensions"
19    are not declared -- `strptime' is one example.
20
21    But non-default environments can expose bugs in the system header
22    files, crippling compilation in _very_ non-obvious ways.  Because
23    of that, we define them only on well-tested architectures where we
24    know they will work.  */
25
26 #undef NAMESPACE_TWEAKS
27
28 #ifdef solaris
29 # define NAMESPACE_TWEAKS
30 #endif
31
32 #ifdef __linux__
33 # define NAMESPACE_TWEAKS
34 #endif
35
36 #ifdef NAMESPACE_TWEAKS
37
38 /* Request the "Unix 98 compilation environment". */
39 #define _XOPEN_SOURCE 500
40
41 /* For Solaris: request everything else that is available and doesn't
42    conflict with the above.  */
43 #define __EXTENSIONS__
44
45 /* For Linux: request features of 4.3BSD and SVID (System V Interface
46    Definition). */
47 #define _SVID_SOURCE
48 #define _BSD_SOURCE
49
50 /* Under glibc-based systems we want all GNU extensions as well.  This
51    declares some unnecessary cruft, but also useful functions such as
52    timegm, FNM_CASEFOLD extension to fnmatch, memrchr, etc.  */
53 #define _GNU_SOURCE
54
55 #endif /* NAMESPACE_TWEAKS */
56
57
58 /* Alloca declaration, based on recommendation in the Autoconf manual.
59    These have to be after the above namespace tweaks, but before any
60    non-preprocessor code.  */
61
62 #if HAVE_ALLOCA_H
63 # include <alloca.h>
64 #elif defined WINDOWS
65 # include <malloc.h>
66 # ifndef alloca
67 #  define alloca _alloca
68 # endif
69 #elif defined __GNUC__
70 # define alloca __builtin_alloca
71 #elif defined _AIX
72 # define alloca __alloca
73 #else
74 # include <stddef.h>
75 # ifdef  __cplusplus
76 extern "C"
77 # endif
78 void *alloca (size_t);
79 #endif