+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>
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