]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
dllimport the variable for MSVC in link-order.at
authorPeter Rosin <peda@lysator.liu.se>
Sat, 17 Jul 2010 02:05:33 +0000 (04:05 +0200)
committerPeter Rosin <peda@lysator.liu.se>
Sat, 17 Jul 2010 02:05:33 +0000 (04:05 +0200)
* tests/link-order.at [MSVC]: Makes the test pass by dllimporting
imported variables when working with shared libraries.

ChangeLog
tests/link-order.at

index a20add4cc219ac94cd7e3daf204e412c47e5f96e..5c425b765bd4e0deb25e49ae5fdf286b82056070 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2010-07-17  Peter Rosin  <peda@lysator.liu.se>
+
+       dllimport the variable for MSVC in link-order.at
+       * tests/link-order.at [MSVC]: Makes the test pass by dllimporting
+       imported variables when working with shared libraries.
+
 2010-07-08  Peter Rosin  <peda@lysator.liu.se>
            Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
index 0122a45e9ce1735750f358f55de2c20365540789..05ce776a2f8d840323c878c29f346fdcfadea2fc 100644 (file)
@@ -48,13 +48,31 @@ for i in old new; do
   mkdir src
 
   cat >src/a_$i.c <<EOF
-extern int c;
+/* w32 fun, MSVC needs to dllimport when using a shared library, so use
+ * DLL_EXPORT to discriminate as that happens to coinside in this case.
+ * gnu has auto import.
+ */
+#if defined _MSC_VER && defined DLL_EXPORT
+#  define LIBCEE_SCOPE __declspec(dllimport)
+#else
+#  define LIBCEE_SCOPE extern
+#endif
+LIBCEE_SCOPE int c;
 extern int b_$i();
 int a_$i() { return c + b_$i(); }
 EOF
 
   cat >src/b_$i.c <<EOF
-extern int c;
+/* w32 fun, MSVC needs to dllimport when using a shared library, so use
+ * DLL_EXPORT to discriminate as that happens to coinside in this case.
+ * gnu has auto import.
+ */
+#if defined _MSC_VER && defined DLL_EXPORT
+#  define LIBCEE_SCOPE __declspec(dllimport)
+#else
+#  define LIBCEE_SCOPE extern
+#endif
+LIBCEE_SCOPE int c;
 int b_$i() { return 1 + c; }
 EOF