From: Gary V. Vaughan Date: Mon, 27 Oct 2014 13:42:55 +0000 (+0000) Subject: testsuite: fixes required for `make distcheck CC=g++`. X-Git-Tag: v2.4.3~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a2ca3e849aa79885a056441c9148e3cceaf93de1;p=thirdparty%2Flibtool.git 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 --- diff --git a/tests/demo.at b/tests/demo.at index f7a36a091..681bc8bf1 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 #include diff --git a/tests/mdemo.at b/tests/mdemo.at index 1e196edf7..6b3c16373 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 a809622bd..d636336c1 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 #include "ltdl.h" -main () { +int main () { putchar ('.'); putchar (lt_dlinit () ? 'E' : '.'); putchar (lt_dlexit () ? 'E' : '.');