]> granicus.if.org Git - apache/blob - include/ap_config.h
fix a warning in a call to apr_psprintf()
[apache] / include / ap_config.h
1 /* ====================================================================
2  * The Apache Software License, Version 1.1
3  *
4  * Copyright (c) 2000-2001 The Apache Software Foundation.  All rights
5  * reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  *
11  * 1. Redistributions of source code must retain the above copyright
12  *    notice, this list of conditions and the following disclaimer.
13  *
14  * 2. Redistributions in binary form must reproduce the above copyright
15  *    notice, this list of conditions and the following disclaimer in
16  *    the documentation and/or other materials provided with the
17  *    distribution.
18  *
19  * 3. The end-user documentation included with the redistribution,
20  *    if any, must include the following acknowledgment:
21  *       "This product includes software developed by the
22  *        Apache Software Foundation (http://www.apache.org/)."
23  *    Alternately, this acknowledgment may appear in the software itself,
24  *    if and wherever such third-party acknowledgments normally appear.
25  *
26  * 4. The names "Apache" and "Apache Software Foundation" must
27  *    not be used to endorse or promote products derived from this
28  *    software without prior written permission. For written
29  *    permission, please contact apache@apache.org.
30  *
31  * 5. Products derived from this software may not be called "Apache",
32  *    nor may "Apache" appear in their name, without prior written
33  *    permission of the Apache Software Foundation.
34  *
35  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
36  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
37  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
38  * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
39  * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
40  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
41  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
42  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
43  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
44  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
45  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
46  * SUCH DAMAGE.
47  * ====================================================================
48  *
49  * This software consists of voluntary contributions made by many
50  * individuals on behalf of the Apache Software Foundation.  For more
51  * information on the Apache Software Foundation, please see
52  * <http://www.apache.org/>.
53  */
54
55 #ifndef AP_CONFIG_H
56 #define AP_CONFIG_H
57
58 #include "apr.h"
59 #include "apr_hooks.h"
60
61 /**
62  * @package Symbol Export Macros
63  */
64
65 /**
66  * AP_DECLARE_EXPORT is defined when building the Apache Core dynamic
67  * library, so that all public symbols are exported.
68  *
69  * AP_DECLARE_STATIC is defined when including Apache's Core headers,
70  * to provide static linkage when the dynamic library may be unavailable.
71  *
72  * AP_DECLARE_STATIC and AP_DECLARE_EXPORT are left undefined when
73  * including Apache's Core headers, to import and link the symbols from the 
74  * dynamic Apache Core library and assure appropriate indirection and calling 
75  * conventions at compile time.
76  *
77  * @deffunc AP_DECLARE_EXPORT/AP_DECLARE_STATIC
78  */
79
80 #if !defined(WIN32)
81 /**
82  * Apache Core dso functions are declared with AP_DECLARE(), so they may
83  * use the most appropriate calling convention.  Hook functions and other
84  * Core functions with variable arguments must use AP_DECLARE_NONSTD().
85  *
86  * @deffunc AP_DECLARE(rettype) ap_func(args)
87  */
88 #define AP_DECLARE(type)            type
89
90 /**
91  * Apache Core dso variable argument and hook functions are declared with 
92  * AP_DECLARE_NONSTD(), as they must use the C language calling convention.
93  *
94  * @deffunc AP_DECLARE_NONSTD(rettype) ap_func(args [...])
95  */
96 #define AP_DECLARE_NONSTD(type)     type
97
98 /**
99  * Apache Core dso variables are declared with AP_MODULE_DECLARE_DATA.
100  * This assures the appropriate indirection is invoked at compile time.
101  *
102  * @tip extern AP_DECLARE_DATA type apr_variable; syntax is required for
103  * declarations within headers to properly import the variable.
104  * @deffunc AP_DECLARE_DATA type apr_variable
105  */
106 #define AP_DECLARE_DATA
107
108 #elif defined(AP_DECLARE_STATIC)
109 #define AP_DECLARE(type)            type __stdcall
110 #define AP_DECLARE_NONSTD(type)     type
111 #define AP_DECLARE_DATA
112 #elif defined(AP_DECLARE_EXPORT)
113 #define AP_DECLARE(type)            __declspec(dllexport) type __stdcall
114 #define AP_DECLARE_NONSTD(type)     __declspec(dllexport) type
115 #define AP_DECLARE_DATA             __declspec(dllexport)
116 #else
117 #define AP_DECLARE(type)            __declspec(dllimport) type __stdcall
118 #define AP_DECLARE_NONSTD(type)     __declspec(dllimport) type
119 #define AP_DECLARE_DATA             __declspec(dllimport)
120 #endif
121
122 #if !defined(WIN32) || defined(AP_MODULE_DECLARE_STATIC)
123 /**
124  * Declare a dso module's exported module structure as AP_MODULE_DECLARE_DATA.
125  *
126  * Unless AP_MODULE_DECLARE_STATIC is defined at compile time, symbols 
127  * declared with AP_MODULE_DECLARE_DATA are always exported.
128  *
129  * @deffunc module AP_MODULE_DECLARE_DATA mod_tag
130  */
131 #define AP_MODULE_DECLARE_DATA
132 #else
133 /**
134  * AP_MODULE_DECLARE_EXPORT is a no-op.  Unless contradicted by the
135  * AP_MODULE_DECLARE_STATIC compile-time symbol, it is assumed and defined.
136  *
137  * The old SHARED_MODULE compile-time symbol is now the default behavior, 
138  * so it is no longer referenced anywhere with Apache 2.0.
139  *
140  * @deffunc AP_MODULE_DECLARE_EXPORT
141  */
142 #define AP_MODULE_DECLARE_EXPORT
143 #define AP_MODULE_DECLARE_DATA __declspec(dllexport)
144 #endif
145
146 /**
147  * @package Hook Functions
148  */
149
150 #define AP_DECLARE_HOOK(ret,name,args) \
151         APR_DECLARE_EXTERNAL_HOOK(ap,AP,ret,name,args)
152
153 #define AP_IMPLEMENT_HOOK_BASE(name) \
154         APR_IMPLEMENT_EXTERNAL_HOOK_BASE(ap,AP,name)
155
156 /**
157  * Implement an Apache core hook that has no return code, and
158  * therefore runs all of the registered functions. The implementation
159  * is called ap_run_<I>name</I>.
160  *
161  * @param name The name of the hook
162  * @param args_decl The declaration of the arguments for the hook, for example
163  * "(int x,void *y)"
164  * @param args_use The arguments for the hook as used in a call, for example
165  * "(x,y)"
166  * @tip If IMPLEMENTing a hook that is not linked into the Apache core,
167  * (e.g. within a dso) see APR_IMPLEMENT_EXTERNAL_HOOK_VOID.
168  * @deffunc AP_IMPLEMENT_HOOK_VOID(name, args_decl, args_use)
169  */
170 #define AP_IMPLEMENT_HOOK_VOID(name,args_decl,args_use) \
171         APR_IMPLEMENT_EXTERNAL_HOOK_VOID(ap,AP,name,args_decl,args_use)
172
173 /**
174  * Implement an Apache core hook that runs until one of the functions
175  * returns something other than ok or decline. That return value is
176  * then returned from the hook runner. If the hooks run to completion,
177  * then ok is returned. Note that if no hook runs it would probably be
178  * more correct to return decline, but this currently does not do
179  * so. The implementation is called ap_run_<I>name</I>.
180  *
181  * @param ret The return type of the hook (and the hook runner)
182  * @param name The name of the hook
183  * @param args_decl The declaration of the arguments for the hook, for example
184  * "(int x,void *y)"
185  * @param args_use The arguments for the hook as used in a call, for example
186  * "(x,y)"
187  * @param ok The "ok" return value
188  * @param decline The "decline" return value
189  * @return ok, decline or an error.
190  * @tip If IMPLEMENTing a hook that is not linked into the Apache core,
191  * (e.g. within a dso) see APR_IMPLEMENT_EXTERNAL_HOOK_RUN_ALL.
192  * @deffunc AP_IMPLEMENT_HOOK_RUN_ALL(ret, name, args_decl, args_use, ok, decline)
193  */
194 #define AP_IMPLEMENT_HOOK_RUN_ALL(ret,name,args_decl,args_use,ok,decline) \
195         APR_IMPLEMENT_EXTERNAL_HOOK_RUN_ALL(ap,AP,ret,name,args_decl, \
196                                             args_use,ok,decline)
197
198 /**
199  * Implement a hook that runs until the first function that returns
200  * something other than decline. If all functions return decline, the
201  * hook runner returns decline. The implementation is called
202  * ap_run_<I>name</I>.
203  *
204  * @param ret The return type of the hook (and the hook runner)
205  * @param name The name of the hook
206  * @param args_decl The declaration of the arguments for the hook, for example
207  * "(int x,void *y)"
208  * @param args_use The arguments for the hook as used in a call, for example
209  * "(x,y)"
210  * @param decline The "decline" return value
211  * @return decline or an error.
212  * @tip If IMPLEMENTing a hook that is not linked into the Apache core
213  * (e.g. within a dso) see APR_IMPLEMENT_EXTERNAL_HOOK_RUN_FIRST.
214  * @deffunc AP_IMPLEMENT_HOOK_RUN_FIRST(ret, name, args_decl, args_use, decline)
215  */
216 #define AP_IMPLEMENT_HOOK_RUN_FIRST(ret,name,args_decl,args_use,decline) \
217         APR_IMPLEMENT_EXTERNAL_HOOK_RUN_FIRST(ap,AP,ret,name,args_decl, \
218                                               args_use,decline)
219
220 #include "os.h"
221 #ifndef WIN32
222 #include "ap_config_auto.h"
223 #endif
224
225
226 /* TODO - We need to put OS detection back to make all the following work */
227
228 #if defined(SUNOS4) || defined(IRIX) || defined(NEXT) || defined(AUX3) \
229     || defined (UW) || defined(LYNXOS) || defined(TPF)
230 /* These systems don't do well with any lingering close code; I don't know
231  * why -- manoj */
232 #define NO_LINGCLOSE
233 #endif
234
235 /* XXX - The PHP4 comments say -D_HPUX_SOURCE is obsolete. */
236
237 /* TODO - none of the dynamic linking defines are in yet, but that's because
238  * Manoj needs to learn what the exact ramifications of libtool on DSOs are */
239
240 #undef PACKAGE
241 #undef VERSION
242
243 #if APR_FILE_BASED_SHM
244 #define AP_USE_FILE_BASED_SCOREBOARD
245 #else
246 #define AP_USE_MEM_BASED_SCOREBOARD
247 #endif
248
249 /* If APR has OTHER_CHILD logic, use reliable piped logs.
250  */
251 #if APR_HAS_OTHER_CHILD
252 #define AP_HAVE_RELIABLE_PIPED_LOGS TRUE
253 #endif
254
255 #if APR_CHARSET_EBCDIC && !defined(APACHE_XLATE)
256 #define APACHE_XLATE
257 #endif
258
259 #endif /* AP_CONFIG_H */