]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* tests/export.at [MSVC]: dllimport all imported variables.
authorPeter Rosin <peda@lysator.liu.se>
Mon, 5 Jul 2010 11:02:54 +0000 (13:02 +0200)
committerPeter Rosin <peda@lysator.liu.se>
Mon, 5 Jul 2010 11:02:54 +0000 (13:02 +0200)
Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
Signed-off-by: Peter Rosin <peda@lysator.liu.se>
ChangeLog
tests/export.at

index 6c5f3ca028c2570a476f48f3b98427b389401dda..f5fa68f89305b0d8db61aefd2e5ca8cd113f1ad5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2010-07-05  Peter Rosin  <peda@lysator.liu.se>
+
+       * tests/export.at [MSVC]: dllimport all imported variables.
+
 2010-07-01  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
            Peter Rosin  <peda@lysator.liu.se>
 
index a330d407fa4d26ae615c1818190337ec152d7015..39adfbc31b57dbc6f2a1f7bafa95df02d426844c 100644 (file)
@@ -93,32 +93,48 @@ v15
 
 AT_DATA(main.c,
 [[
+/* w32 fun.  With GCC, you can have auto-import, which will work for
+ * functions and non-const variables.  With MSVC, you have to explicitly
+ * import all variables.  Depending on the amount of portability, you
+ * need these annotations: LIBA_SCOPE for GCC, and also LIBA_SCOPE_VAR
+ * for MSVC.  Of course you can merge both to one, this test only avoids
+ * that in order to expose the auto-import feature on Cygwin.
+ *
+ * For users, it's best to realize that they should not provide any
+ * non-function API at all.
+ */
 #if defined(LIBA_DLL_IMPORT)
 #  if defined(_WIN32) || defined(WIN32) || defined(__CYGWIN__)
 #    define LIBA_SCOPE extern __declspec(dllimport)
+#    if defined(_MSC_VER)
+#      define LIBA_SCOPE_VAR LIBA_SCOPE
+#    endif
 #  endif
 #endif
 #if !defined(LIBA_SCOPE)
 #  define LIBA_SCOPE extern
 #endif
+#if !defined(LIBA_SCOPE_VAR)
+#  define LIBA_SCOPE_VAR extern
+#endif
 #ifdef __cplusplus
 extern "C" {
 #endif
-extern int v1;
-extern int v3, v4;
+LIBA_SCOPE_VAR int v1;
+LIBA_SCOPE_VAR int v3, v4;
 LIBA_SCOPE const int v5, v6;
-extern const char* v7;
-extern const char v8[];
+LIBA_SCOPE_VAR const char* v7;
+LIBA_SCOPE_VAR const char v8[];
 extern int v9(void);
-extern int (*v10) (void);
-extern int (*v11) (void);
+LIBA_SCOPE_VAR int (*v10) (void);
+LIBA_SCOPE_VAR int (*v11) (void);
 LIBA_SCOPE int (*const v12) (void);
 #ifdef __cplusplus
 }
 #endif
 
 typedef struct { int arr[1000]; } large;
-extern large v13, v14, v15;
+LIBA_SCOPE_VAR large v13, v14, v15;
 
 int main (void)
 {