bug-libtool
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 1/2] tests: __declspec (dll{ex, im}port) in tests/exceptions.


From: Bob Friesenhahn
Subject: Re: [PATCH 1/2] tests: __declspec (dll{ex, im}port) in tests/exceptions.at
Date: Mon, 20 Sep 2010 10:57:59 -0500 (CDT)
User-agent: Alpine 2.01 (GSO 1266 2009-07-14)

On Mon, 20 Sep 2010, Peter Rosin wrote:

Hi!

I have tested this patch on MinGW/gcc and Cygwin/gcc and they are both
ok with the __declspec() notation.  On MSVC, the test goes from skip
to fail, as it needs 2/2.

This patch looks good to apply, as does the 2/2 patch to make sure that lt__PROGRAM__LTX_preloaded_symbols is globally scoped and "extern C".

Bob


Cheers,
Peter

From 52972128c5952da628e033e4509208711906c3a2 Mon Sep 17 00:00:00 2001
From: Peter Rosin <address@hidden>
Date: Mon, 20 Sep 2010 09:07:25 +0200
Subject: [PATCH 1/2] tests: __declspec (dll{ex,im}port) in tests/exceptions.at

* tests/exceptions.at (common.h, module.h, lib.h) [w32]: Use
__declspec (dllimport) and __declspec (dllexport) instead of
the less portable __attribute__ ((dllimport)) and
__attribute__ ((dllexport)).  Makes the test compile on MSVC.

Signed-off-by: Peter Rosin <address@hidden>
---
ChangeLog           |    8 ++++++++
tests/exceptions.at |   17 ++++++++---------
2 files changed, 16 insertions(+), 9 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 78d3e48..3c72890 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2010-09-20  Peter Rosin  <address@hidden>
+
+       tests: __declspec (dll{ex,im}port) in tests/exceptions.at
+       * tests/exceptions.at (common.h, module.h, lib.h) [w32]: Use
+       __declspec (dllimport) and __declspec (dllexport) instead of
+       the less portable __attribute__ ((dllimport)) and
+       __attribute__ ((dllexport)).  Makes the test compile on MSVC.
+
2010-09-19  Peter Rosin  <address@hidden>

        tests: Import items from liba1 for MSVC.
diff --git a/tests/exceptions.at b/tests/exceptions.at
index 235597c..286b2ac 100644
--- a/tests/exceptions.at
+++ b/tests/exceptions.at
@@ -66,9 +66,8 @@ CPPFLAGS="$LTDLINCL $CPPFLAGS"
# the regex).  However, in this test, none of these situations apply,
# so we don't directly address it.  Otherwise, the correct mechanism
# would be to avoid all of those flags, and instead explicitly decorate
-# all symbols with appropriate __attribute__ ((dllexport)) or
-# __attribute__ ((dllimport)) flags when building the DLLs and the
-# clients.
+# all symbols with appropriate __declspec (dllexport) or
+# __declspec (dllimport) flags when building the DLLs and the clients.
#
# For more information, see these two threads:
#   http://lists.gnu.org/archive/html/bug-libtool/2010-06/msg00069.html
@@ -84,9 +83,9 @@ AT_DATA([common.h],
#if defined(__CYGWIN__) || defined(_WIN32)
# if defined(DLL_EXPORT) || defined(USING_COMMON_DLL)
#  if defined(LIBTOOL_TEST_IN_COMMON)
-#   define COMMON_IMPEXP __attribute__ ((dllexport))
+#   define COMMON_IMPEXP __declspec (dllexport)
#  else
-#   define COMMON_IMPEXP __attribute__ ((dllimport))
+#   define COMMON_IMPEXP __declspec (dllimport)
#  endif
# else
#  define COMMON_IMPEXP
@@ -128,9 +127,9 @@ AT_DATA([module.h],
#if defined(__CYGWIN__) || defined(_WIN32)
# if defined(DLL_EXPORT) || defined(USING_MODULE_DLL)
#  if defined(LIBTOOL_TEST_IN_MODULE)
-#   define MODULE_IMPEXP __attribute__ ((dllexport))
+#   define MODULE_IMPEXP __declspec (dllexport)
#  else
-#   define MODULE_IMPEXP __attribute__ ((dllimport))
+#   define MODULE_IMPEXP __declspec (dllimport)
#  endif
# else
#  define MODULE_IMPEXP
@@ -174,9 +173,9 @@ AT_DATA([lib.h],
#if defined(__CYGWIN__) || defined(_WIN32)
# if defined(DLL_EXPORT) || defined(USING_LIB_DLL)
#  if defined(LIBTOOL_TEST_IN_LIB)
-#   define LIB_IMPEXP __attribute__ ((dllexport))
+#   define LIB_IMPEXP __declspec (dllexport)
#  else
-#   define LIB_IMPEXP __attribute__ ((dllimport))
+#   define LIB_IMPEXP __declspec (dllimport)
#  endif
# else
#  define LIB_IMPEXP


--
Bob Friesenhahn
address@hidden, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]