]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
testsuite: fixes required for `make distcheck CC=g++`.
authorGary V. Vaughan <gary@gnu.org>
Mon, 27 Oct 2014 13:42:55 +0000 (13:42 +0000)
committerGary V. Vaughan <gary@gnu.org>
Mon, 27 Oct 2014 13:42:55 +0000 (13:42 +0000)
* tests/demo.at (Pdemo conf): Overide _LT_DEMO_SETUP foo.h to
declare foo2.
* tests/mdemo.at (_LT_SETUP): Don't wrap `sub` dectlaration in
C++ guards, because sub.c is also compiled with g++ in this test.
* tests/old-ltdl-iface.at (old.c): Add a return type to main
declaration as required by C++.

Signed-off-by: Gary V. Vaughan <gary@gnu.org>
tests/demo.at
tests/mdemo.at
tests/old-ltdl-iface.at

index f7a36a091f2f10ffe5373717f8ff7b98b9150b18..681bc8bf16d8abbffeaf0bb03c41123b85515820 100644 (file)
@@ -890,6 +890,66 @@ int main ()
 }
 ]])
 
+AT_DATA([foo.h],
+[[#ifndef FOO_H
+#define FOO_H
+
+/* At some point, cygwin will stop defining __CYGWIN32__, but b19 and
+ * earlier do not define __CYGWIN__.  This snippet allows us to check
+ * for __CYGWIN__ reliably for both current, old, and (probable) future
+ * releases.
+ */
+#ifdef __CYGWIN32__
+#  ifndef __CYGWIN__
+#    define __CYGWIN__
+#  endif
+#endif
+
+#if (defined _WIN32 || defined _WIN32_WCE) && !defined __GNUC__
+# ifdef BUILDING_LIBHELLO
+#  ifdef DLL_EXPORT
+#   define LIBHELLO_SCOPE extern __declspec (dllexport)
+#  endif
+# else
+#  define LIBHELLO_SCOPE extern __declspec (dllimport)
+# endif
+#endif
+#ifndef LIBHELLO_SCOPE
+# define LIBHELLO_SCOPE extern
+#endif
+
+/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
+#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
+/* DATA imports from DLLs on WIN32 can't be const, because runtime
+   relocations are performed -- see ld's documentation on pseudo-relocs.  */
+# define LT_DLSYM_CONST
+#elif defined __osf__
+/* This system does not cope well with relocations in const data.  */
+# define LT_DLSYM_CONST
+#else
+# define LT_DLSYM_CONST const
+#endif
+
+/* Silly constants that the functions return. */
+#define HELLO_RET 0xe110
+#define FOO_RET 0xf00
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int foo (void);
+int foo2 (void);
+int hello (void);
+LIBHELLO_SCOPE int nothing;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+]])
+
 AT_DATA([foo2.c],
 [[#include <config.h>
 #include <stdio.h>
index 1e196edf7ef94492447951aae8be9c25e7ad56e7..6b3c163731fa810c7a361cb76e9e193e1f1d29e8 100644 (file)
@@ -133,16 +133,8 @@ AT_DATA([foo.h],
 #define HELLO_RET 0xe110
 #define FOO_RET 0xf00
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 int sub (void);
 
-#ifdef __cplusplus
-}
-#endif
-
 #endif
 ]])
 
index a809622bdc137887041358d5a21fb1743cf13b4f..d636336c163daa06e41324003dc18d47f0bcd731 100644 (file)
@@ -67,7 +67,7 @@ old_LDADD = -Lltdl $(LIBLTDL)
 AT_DATA([old.c],
 [[#include <stdio.h>
 #include "ltdl.h"
-main () {
+int main () {
   putchar ('.');
   putchar (lt_dlinit () ? 'E' : '.');
   putchar (lt_dlexit () ? 'E' : '.');