summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorGary V. Vaughan <gary@gnu.org>2014-10-27 13:42:55 +0000
committerGary V. Vaughan <gary@gnu.org>2014-10-27 13:42:55 +0000
commita2ca3e849aa79885a056441c9148e3cceaf93de1 (patch)
tree80b5f87d100d598984ca9ec5bbf18422d1c08718 /tests
parent42e91f028255c79b1c3b308f61f0c0e6b6063280 (diff)
downloadlibtool-a2ca3e849aa79885a056441c9148e3cceaf93de1.tar.gz
testsuite: fixes required for `make distcheck CC=g++`.
* 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>
Diffstat (limited to 'tests')
-rw-r--r--tests/demo.at60
-rw-r--r--tests/mdemo.at8
-rw-r--r--tests/old-ltdl-iface.at2
3 files changed, 61 insertions, 9 deletions
diff --git a/tests/demo.at b/tests/demo.at
index f7a36a09..681bc8bf 100644
--- a/tests/demo.at
+++ b/tests/demo.at
@@ -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>
diff --git a/tests/mdemo.at b/tests/mdemo.at
index 1e196edf..6b3c1637 100644
--- a/tests/mdemo.at
+++ b/tests/mdemo.at
@@ -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
]])
diff --git a/tests/old-ltdl-iface.at b/tests/old-ltdl-iface.at
index a809622b..d636336c 100644
--- a/tests/old-ltdl-iface.at
+++ b/tests/old-ltdl-iface.at
@@ -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' : '.');