|
From: <pat...@us...> - 2007-06-25 21:58:52
|
Revision: 592
http://svn.sourceforge.net/xml-cppdom/?rev=592&view=rev
Author: patrickh
Date: 2007-06-25 14:58:54 -0700 (Mon, 25 Jun 2007)
Log Message:
-----------
Restored the ability to use automatic linking with static libraries on
Windows. I broke this in Revision 591.
Revision Links:
--------------
http://svn.sourceforge.net/xml-cppdom/?rev=591&view=rev
Modified Paths:
--------------
trunk/cppdom/config.h
Modified: trunk/cppdom/config.h
===================================================================
--- trunk/cppdom/config.h 2007-06-25 21:10:29 UTC (rev 591)
+++ trunk/cppdom/config.h 2007-06-25 21:58:54 UTC (rev 592)
@@ -46,9 +46,8 @@
#define CPPDOM_CONFIG_H
// -----------------------------------
-// win32 DLL configuration
-#if (defined(WIN32) || defined(WIN64)) && \
- (defined(CPPDOM_AUTO_LINK) || defined(CPPDOM_DYN_LINK))
+// win32
+#if defined(WIN32) || defined(WIN64)
// switch some warnings off
# pragma warning( disable: 4786 4275 4251 )
@@ -59,9 +58,15 @@
# define CPPDOM_EXPORT(ret) __declspec(dllexport) ret
# define CPPDOM_CLASS __declspec(dllexport)
# else
-//# define CPPDOM_EXPORT(ret) __declspec(dllimport) ret __stdcall
-# define CPPDOM_EXPORT(ret) __declspec(dllimport) ret
-# define CPPDOM_CLASS __declspec(dllimport)
+// Only define the dllimport bits if dynamic linking has been requested.
+# if defined(CPPDOM_DYN_LINK)
+//# define CPPDOM_EXPORT(ret) __declspec(dllimport) ret __stdcall
+# define CPPDOM_EXPORT(ret) __declspec(dllimport) ret
+# define CPPDOM_CLASS __declspec(dllimport)
+# else
+# define CPPDOM_EXPORT(ret) ret
+# define CPPDOM_CLASS
+# endif
// Use automatic linking when building with Visual C++ and when requested to
// do so. Define either CPPDOM_AUTO_LINK or CPPDOM_DYN_LINK to enable automatic
@@ -100,7 +105,7 @@
# endif /* defined(_MSC_VER) && (defined(CPPDOM_AUTO_LINK) || defined(CPPDOM_DYN_LINK)) */
# endif /* defined(CPPDOM_EXPORTS) */
-// UNIX handling and static linking on Windows.
+// Non-Windows handling.
#else
# define CPPDOM_EXPORT(ret) ret
# define CPPDOM_CLASS
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|