From: William A. Rowe Jr Date: Wed, 11 Oct 2000 17:08:39 +0000 (+0000) Subject: Parallels the commit to apr.h.in/apr.hw for the apache core library. X-Git-Tag: APACHE_2_0_ALPHA_8~409 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3f7906e840fb79115e8f2bad458a43ea69cbb4eb;p=apache Parallels the commit to apr.h.in/apr.hw for the apache core library. Only mod_dav/mod_dav_fs and ap_hooks.h (as best examples) will use these symbols until it is acceptable to all or the new symbols are backed out. This symbol rename will have the unique quality that strlen("API_EXPORT") == strlen("AP_DECLARE"), therefore the mass symbol rename will not throw off function continuation lines. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86539 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/include/ap_config.h b/include/ap_config.h index 2176114237..c75b6f554e 100644 --- a/include/ap_config.h +++ b/include/ap_config.h @@ -58,40 +58,56 @@ #include "ap_mmn.h" /* MODULE_MAGIC_NUMBER_ */ #include "apr_lib.h" /* apr_isfoo() macros */ -/* Implemented flags for dynamic library bindings. - * - * API_EXPORT(type) for functions bound in the apache core, except: - * API_EXPORT_NONSTD(type) for functions with var args (only as ...) - * API_VAR_EXPORT for data residing in the core - * MODULE_VAR_EXPORT is a hack that will need to go away +/* Create a set of AP_DECLARE(type), AP_DECLARE_NONSTD(type) and + * AP_DECLARE_DATA with appropriate export and import tags for the platform */ +#if !defined(WIN32) +#define AP_DECLARE(type) type +#define AP_DECLARE_NONSTD(type) type +#define AP_DECLARE_DATA +#elif defined(AP_DECLARE_STATIC) +#define AP_DECLARE(type) type __stdcall +#define AP_DECLARE_NONSTD(type) type +#define AP_DECLARE_DATA +#elif defined(AP_DECLARE_EXPORT) +#define AP_DECLARE(type) __declspec(dllexport) type __stdcall +#define AP_DECLARE_NONSTD(type) __declspec(dllexport) type +#define AP_DECLARE_DATA __declspec(dllexport) +#else +#define AP_DECLARE(type) __declspec(dllimport) type __stdcall +#define AP_DECLARE_NONSTD(type) __declspec(dllimport) type +#define AP_DECLARE_DATA __declspec(dllimport) +#endif +/* setup compat like aliases for authors + */ +#define API_EXPORT(t) AP_DECLARE(t) +#define API_EXPORT_NONSTD(t) AP_DECLARE_NONSTD(t) +#define API_VAR_EXPORT AP_DECLARE_DATA + +/* Play a little game. Unless MODULE_DECLARE_STATIC + * is defined, MODULE_DECLARE_* macros are always exported + */ +/* Create a set of MODULE_DECLARE(type), MODULE_DECLARE_NONSTD(type) and + * MODULE_DECLARE_DATA with appropriate export and import tags for the platform + */ #if !defined(WIN32) -#define API_EXPORT(type) type -#define API_EXPORT_NONSTD(type) type -#define API_VAR_EXPORT -#define MODULE_EXPORT(type) type -#define MODULE_VAR_EXPORT -#elif defined(API_STATIC) -#define API_EXPORT(type) type __stdcall -#define API_EXPORT_NONSTD(type) type -#define API_VAR_EXPORT -#define MODULE_EXPORT(type) type __stdcall -#define MODULE_VAR_EXPORT -#elif defined(API_EXPORT_SYMBOLS) -#define API_EXPORT(type) __declspec(dllexport) type __stdcall -#define API_EXPORT_NONSTD(type) __declspec(dllexport) type -#define API_VAR_EXPORT __declspec(dllexport) -#define MODULE_EXPORT(type) __declspec(dllexport) type __stdcall -#define MODULE_VAR_EXPORT __declspec(dllexport) +#define MODULE_DECLARE(type) type +#define MODULE_DECLARE_NONSTD(type) type +#define MODULE_DECLARE_DATA +#elif defined(MODULE_DECLARE_STATIC) +#define MODULE_DECLARE(type) type __stdcall +#define MODULE_DECLARE_NONSTD(type) type +#define MODULE_DECLARE_DATA #else -#define API_EXPORT(type) __declspec(dllimport) type __stdcall -#define API_EXPORT_NONSTD(type) __declspec(dllimport) type -#define API_VAR_EXPORT __declspec(dllimport) -#define MODULE_EXPORT(type) __declspec(dllexport) type __stdcall -#define MODULE_VAR_EXPORT __declspec(dllexport) +#define MODULE_DECLARE_EXPORT +#define MODULE_DECLARE(type) __declspec(dllexport) type __stdcall +#define MODULE_DECLARE_NONSTD(type) __declspec(dllexport) type +#define MODULE_DECLARE_DATA __declspec(dllexport) #endif +#define MODULE_VAR_EXPORT MODULE_DECLARE_DATA + #ifdef WIN32 #include "os.h" #else