ap_config.h revision 224115a27112e197b0fbdfb0e9c2ea7e2498a3f5
b0fb330a8581c8bfab5e523084f9f39264a52b12gstein/* Licensed to the Apache Software Foundation (ASF) under one or more
b0fb330a8581c8bfab5e523084f9f39264a52b12gstein * contributor license agreements. See the NOTICE file distributed with
b0fb330a8581c8bfab5e523084f9f39264a52b12gstein * this work for additional information regarding copyright ownership.
bc8fd1b0b1afdf89b8d28eefa8cd74e26ba97986fielding * The ASF licenses this file to You under the Apache License, Version 2.0
b0fb330a8581c8bfab5e523084f9f39264a52b12gstein * (the "License"); you may not use this file except in compliance with
b0fb330a8581c8bfab5e523084f9f39264a52b12gstein * the License. You may obtain a copy of the License at
b0fb330a8581c8bfab5e523084f9f39264a52b12gstein * Unless required by applicable law or agreed to in writing, software
b0fb330a8581c8bfab5e523084f9f39264a52b12gstein * distributed under the License is distributed on an "AS IS" BASIS,
b0fb330a8581c8bfab5e523084f9f39264a52b12gstein * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
b0fb330a8581c8bfab5e523084f9f39264a52b12gstein * See the License for the specific language governing permissions and
b0fb330a8581c8bfab5e523084f9f39264a52b12gstein * limitations under the License.
b0fb330a8581c8bfab5e523084f9f39264a52b12gstein * @brief Symbol export macros and hook functions
b0fb330a8581c8bfab5e523084f9f39264a52b12gstein/* Although this file doesn't declare any hooks, declare the exports group here */
b0fb330a8581c8bfab5e523084f9f39264a52b12gstein * @defgroup exports Apache exports
b0fb330a8581c8bfab5e523084f9f39264a52b12gstein * @ingroup APACHE_CORE
b0fb330a8581c8bfab5e523084f9f39264a52b12gstein/* define these just so doxygen documents them */
b0fb330a8581c8bfab5e523084f9f39264a52b12gstein * AP_DECLARE_STATIC is defined when including Apache's Core headers,
b0fb330a8581c8bfab5e523084f9f39264a52b12gstein * to provide static linkage when the dynamic library may be unavailable.
b0fb330a8581c8bfab5e523084f9f39264a52b12gstein * @see AP_DECLARE_EXPORT
b0fb330a8581c8bfab5e523084f9f39264a52b12gstein * AP_DECLARE_STATIC and AP_DECLARE_EXPORT are left undefined when
b0fb330a8581c8bfab5e523084f9f39264a52b12gstein * including Apache's Core headers, to import and link the symbols from the
b0fb330a8581c8bfab5e523084f9f39264a52b12gstein * dynamic Apache Core library and assure appropriate indirection and calling
b0fb330a8581c8bfab5e523084f9f39264a52b12gstein * conventions at compile time.
b0fb330a8581c8bfab5e523084f9f39264a52b12gstein * AP_DECLARE_EXPORT is defined when building the Apache Core dynamic
b0fb330a8581c8bfab5e523084f9f39264a52b12gstein * library, so that all public symbols are exported.
b0fb330a8581c8bfab5e523084f9f39264a52b12gstein * @see AP_DECLARE_STATIC
b0fb330a8581c8bfab5e523084f9f39264a52b12gstein#endif /* def DOXYGEN */
f4c310fd2555c6faca1f980f00b161eadb089023gstein#if !defined(WIN32)
1b21d7b3d97def358b2e923655edeb16613a1c31gstein * Apache Core dso functions are declared with AP_DECLARE(), so they may
952023a04a2f9d51553babd9094fb857f1c97548trawick * use the most appropriate calling convention. Hook functions and other
1b21d7b3d97def358b2e923655edeb16613a1c31gstein * Core functions with variable arguments must use AP_DECLARE_NONSTD().
1b21d7b3d97def358b2e923655edeb16613a1c31gstein * AP_DECLARE(rettype) ap_func(args)
f4c310fd2555c6faca1f980f00b161eadb089023gstein * Apache Core dso variable argument and hook functions are declared with
f4c310fd2555c6faca1f980f00b161eadb089023gstein * AP_DECLARE_NONSTD(), as they must use the C language calling convention.
f4c310fd2555c6faca1f980f00b161eadb089023gstein * @see AP_DECLARE
98e9c4a310bb623ff788680f88b6bd200ff36a24wrowe * AP_DECLARE_NONSTD(rettype) ap_func(args [...])
f4c310fd2555c6faca1f980f00b161eadb089023gstein * Apache Core dso variables are declared with AP_MODULE_DECLARE_DATA.
f4c310fd2555c6faca1f980f00b161eadb089023gstein * This assures the appropriate indirection is invoked at compile time.
f4c310fd2555c6faca1f980f00b161eadb089023gstein * @note AP_DECLARE_DATA extern type apr_variable; syntax is required for
f4c310fd2555c6faca1f980f00b161eadb089023gstein * declarations within headers to properly import the variable.
f4c310fd2555c6faca1f980f00b161eadb089023gstein * AP_DECLARE_DATA type apr_variable
5b03ba47ff7225cacb131f14b019332af27da960gstein#define AP_DECLARE(type) __declspec(dllexport) type __stdcall
5b03ba47ff7225cacb131f14b019332af27da960gstein#define AP_DECLARE_NONSTD(type) __declspec(dllexport) type
5b03ba47ff7225cacb131f14b019332af27da960gstein#define AP_DECLARE(type) __declspec(dllimport) type __stdcall
5b03ba47ff7225cacb131f14b019332af27da960gstein#define AP_DECLARE_NONSTD(type) __declspec(dllimport) type
98e9c4a310bb623ff788680f88b6bd200ff36a24wrowe#if !defined(WIN32)
f4c310fd2555c6faca1f980f00b161eadb089023gstein * The public APREQ functions are declared with APREQ_DECLARE(), so they may
1ccd992d37d62c8cb2056126f2234f64ec189bfddougm * use the most appropriate calling convention. Public APR functions with
f4c310fd2555c6faca1f980f00b161eadb089023gstein * variable arguments must use APR_DECLARE_NONSTD().
f4c310fd2555c6faca1f980f00b161eadb089023gstein * @remark Both the declaration and implementations must use the same macro.
f4c310fd2555c6faca1f980f00b161eadb089023gstein/** APREQ_DECLARE(rettype) apeq_func(args)
f4c310fd2555c6faca1f980f00b161eadb089023gstein * The public APEQ functions using variable arguments are declared with
98e9c4a310bb623ff788680f88b6bd200ff36a24wrowe * APEQ_DECLARE_NONSTD(), as they must follow the C language calling convention.
98e9c4a310bb623ff788680f88b6bd200ff36a24wrowe * @see APEQ_DECLARE @see APEQ_DECLARE_DATA
f4c310fd2555c6faca1f980f00b161eadb089023gstein * @remark Both the declaration and implementations must use the same macro.
f4c310fd2555c6faca1f980f00b161eadb089023gstein/** APEQ_DECLARE_NONSTD(rettype) apr_func(args, ...);
f4c310fd2555c6faca1f980f00b161eadb089023gstein * The public APREQ variables are declared with APREQ_DECLARE_DATA.
f4c310fd2555c6faca1f980f00b161eadb089023gstein * This assures the appropriate indirection is invoked at compile time.
f4c310fd2555c6faca1f980f00b161eadb089023gstein * @see APREQ_DECLARE @see APREQ_DECLARE_NONSTD
f4c310fd2555c6faca1f980f00b161eadb089023gstein * @remark Note that the declaration and implementations use different forms,
f4c310fd2555c6faca1f980f00b161eadb089023gstein * but both must include the macro.
98e9c4a310bb623ff788680f88b6bd200ff36a24wrowe/** extern APREQ_DECLARE_DATA type apr_variable;\n
f4c310fd2555c6faca1f980f00b161eadb089023gstein * APREQ_DECLARE_DATA type apr_variable = value;
f4c310fd2555c6faca1f980f00b161eadb089023gstein#define APREQ_DECLARE(type) __declspec(dllexport) type __stdcall
f4c310fd2555c6faca1f980f00b161eadb089023gstein#define APREQ_DECLARE_NONSTD(type) __declspec(dllexport) type
f4c310fd2555c6faca1f980f00b161eadb089023gstein#define APREQ_DECLARE(type) __declspec(dllimport) type __stdcall
1ccd992d37d62c8cb2056126f2234f64ec189bfddougm#define APREQ_DECLARE_NONSTD(type) __declspec(dllimport) type
f4c310fd2555c6faca1f980f00b161eadb089023gstein#if !defined(WIN32) || defined(AP_MODULE_DECLARE_STATIC)
f4c310fd2555c6faca1f980f00b161eadb089023gstein * Declare a dso module's exported module structure as AP_MODULE_DECLARE_DATA.
98e9c4a310bb623ff788680f88b6bd200ff36a24wrowe * Unless AP_MODULE_DECLARE_STATIC is defined at compile time, symbols
f4c310fd2555c6faca1f980f00b161eadb089023gstein * declared with AP_MODULE_DECLARE_DATA are always exported.
f4c310fd2555c6faca1f980f00b161eadb089023gstein * module AP_MODULE_DECLARE_DATA mod_tag
f4c310fd2555c6faca1f980f00b161eadb089023gstein#if defined(WIN32)
f4c310fd2555c6faca1f980f00b161eadb089023gstein * AP_MODULE_DECLARE_EXPORT is a no-op. Unless contradicted by the
f4c310fd2555c6faca1f980f00b161eadb089023gstein * AP_MODULE_DECLARE_STATIC compile-time symbol, it is assumed and defined.
98e9c4a310bb623ff788680f88b6bd200ff36a24wrowe * The old SHARED_MODULE compile-time symbol is now the default behavior,
98e9c4a310bb623ff788680f88b6bd200ff36a24wrowe * so it is no longer referenced anywhere with Apache 2.0.
f4c310fd2555c6faca1f980f00b161eadb089023gstein#define AP_MODULE_DECLARE(type) __declspec(dllexport) type __stdcall
f4c310fd2555c6faca1f980f00b161eadb089023gstein#define AP_MODULE_DECLARE_NONSTD(type) __declspec(dllexport) type
98e9c4a310bb623ff788680f88b6bd200ff36a24wrowe#if (!defined(WIN32) && !defined(NETWARE)) || defined(__MINGW32__)
f4c310fd2555c6faca1f980f00b161eadb089023gstein/* Where the main/parent process's pid is logged */
f4c310fd2555c6faca1f980f00b161eadb089023gstein#define DEFAULT_PIDLOG DEFAULT_REL_RUNTIMEDIR "/httpd.pid"
f4c310fd2555c6faca1f980f00b161eadb089023gstein/* If APR has OTHER_CHILD logic, use reliable piped logs. */
f4c310fd2555c6faca1f980f00b161eadb089023gstein#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
48f35e10f195dd594d75738fc536bb885eda537cgstein/* Presume that the compiler supports C99-style designated
f4c310fd2555c6faca1f980f00b161eadb089023gstein * initializers if using GCC (but not G++), or for any other compiler
f4c310fd2555c6faca1f980f00b161eadb089023gstein * which claims C99 support. */
f4c310fd2555c6faca1f980f00b161eadb089023gstein#if (defined(__GNUC__) && !defined(__cplusplus)) || defined(AP_HAVE_C99)
f4c310fd2555c6faca1f980f00b161eadb089023gstein#ifndef __has_attribute /* check for supported attributes on clang */
f4c310fd2555c6faca1f980f00b161eadb089023gstein#if (defined(__GNUC__) && __GNUC__ >= 4) || __has_attribute(sentinel)
48f35e10f195dd594d75738fc536bb885eda537cgstein#if ( defined(__GNUC__) && \
48f35e10f195dd594d75738fc536bb885eda537cgstein (__GNUC__ >= 4 || ( __GNUC__ == 3 && __GNUC_MINOR__ >= 4))) \
48f35e10f195dd594d75738fc536bb885eda537cgstein#define AP_FN_ATTR_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
48f35e10f195dd594d75738fc536bb885eda537cgstein#if ( defined(__GNUC__) && \
48f35e10f195dd594d75738fc536bb885eda537cgstein#define AP_FN_ATTR_ALLOC_SIZE(x) __attribute__((alloc_size(x)))
48f35e10f195dd594d75738fc536bb885eda537cgstein#define AP_FN_ATTR_ALLOC_SIZE2(x,y) __attribute__((alloc_size(x,y)))
48f35e10f195dd594d75738fc536bb885eda537cgstein#endif /* AP_CONFIG_H */