summaryrefslogtreecommitdiff
path: root/include/apr.h.in
diff options
context:
space:
mode:
authorJeff Trawick <trawick@apache.org>2011-04-02 13:50:07 +0000
committerJeff Trawick <trawick@apache.org>2011-04-02 13:50:07 +0000
commit82633d4457b280518f71372c43663f1c2f285543 (patch)
tree02125e627b4888b5110e4df7796bcbe6b0c2edf8 /include/apr.h.in
parent9f3a2c2076b57d3b8136b06c62698183ef1cbcad (diff)
downloadapr-82633d4457b280518f71372c43663f1c2f285543.tar.gz
MinGW/MSYS: Support shared builds of APR, other general improvements
to support of this toolchain. test/Makefile.in: * $(LT_LDFLAGS) must be placed after the driver, otherwise it will act exactly like $(LTFLAGS). This is required, otherwise libtool will be never able to recognize the "-no-undefined" flag. * if mod_test.la does not specify $(LOCAL_LIBS), compilation will fail (this is required by both static and shared builds). include/apr.h.in: * It is required to declare APR_DECLARE, APR_DECLARE_NONSTD and APR_DECLARE_DATA as they are in apr.hw, otherwise the generate DLL won't export any symbol. APR_MODULE_DECLARE_DATA is already included, but previous ones are not. configure.in: * $(LT_LDFLAGS) must be placed after the driver, as described for test/Makefile.in. * Added "-no-undefined" flag to $(LT_LDFLAGS) if the target platform is Windows. * Declare APR_DECLARE_EXPORT or APR_DECLARE_STATIC, required by the macro added in include/apr.h.in. * Removed the "strange" libraries detection (btw, probably it was also breaking platforms without __stdcall calling convention, like Windows CE/Mobile/Phone, since function names were decorated), linker gave error without sense if adding "-lkernel32", probably because it creates a conflict of library precedence and dependency. PR: 46175 Submitted by: Carlo Bramini <carlo.bramix libero.it> git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1088023 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'include/apr.h.in')
-rw-r--r--include/apr.h.in16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/apr.h.in b/include/apr.h.in
index a6ecdf80d..b5bc72999 100644
--- a/include/apr.h.in
+++ b/include/apr.h.in
@@ -472,6 +472,8 @@ typedef apr_uint32_t apr_uintptr_t;
*/
#define APR_THREAD_FUNC @apr_thread_func@
+#if defined(DOXYGEN) || !defined(WIN32)
+
/**
* The public APR functions are declared with APR_DECLARE(), so they may
* use the most appropriate calling convention. Public APR functions with
@@ -524,6 +526,20 @@ typedef apr_uint32_t apr_uintptr_t;
*/
#define APR_DECLARE_DATA
+#elif defined(APR_DECLARE_STATIC)
+#define APR_DECLARE(type) type __stdcall
+#define APR_DECLARE_NONSTD(type) type __cdecl
+#define APR_DECLARE_DATA
+#elif defined(APR_DECLARE_EXPORT)
+#define APR_DECLARE(type) __declspec(dllexport) type __stdcall
+#define APR_DECLARE_NONSTD(type) __declspec(dllexport) type __cdecl
+#define APR_DECLARE_DATA __declspec(dllexport)
+#else
+#define APR_DECLARE(type) __declspec(dllimport) type __stdcall
+#define APR_DECLARE_NONSTD(type) __declspec(dllimport) type __cdecl
+#define APR_DECLARE_DATA __declspec(dllimport)
+#endif
+
#if !defined(WIN32) || defined(APU_MODULE_DECLARE_STATIC)
/**
* Declare a dso module's exported module structure as APR_MODULE_DECLARE_DATA.