]> sjero.net Git - wget/blob - src/config-post.h
[svn] Update FSF's address and copyright years.
[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 #endif /* NAMESPACE_TWEAKS */
51
52
53 /* Alloca declaration, based on recommendation in the Autoconf manual.
54    These have to be after the above namespace tweaks, but before any
55    non-preprocessor code.  */
56
57 #if HAVE_ALLOCA_H
58 # include <alloca.h>
59 #elif defined _MSC_VER || defined __BORLANDC__ || defined __MINGW32__
60 # include <malloc.h>
61 #elif defined __GNUC__
62 # define alloca __builtin_alloca
63 #elif defined _AIX
64 # define alloca __alloca
65 #else
66 # include <stddef.h>
67 # ifdef  __cplusplus
68 extern "C"
69 # endif
70 void *alloca (size_t);
71 #endif