]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* libltdl/ltdl.h (LTDL_STMT_START, LTDL_STMT_END): Macros for
authorGary V. Vaughan <gary@gnu.org>
Fri, 14 Jan 2000 13:28:52 +0000 (13:28 +0000)
committerGary V. Vaughan <gary@gnu.org>
Fri, 14 Jan 2000 13:28:52 +0000 (13:28 +0000)
wrapping other macros to make a portable compound statement from
multiple C statements in the expansion.
(LTDL_SET_PRELOADED_SYMBOLS): Use the above macros to add an
extern declaration for lt_preloaded_symbols, to remove
dependency on undefined symbol from libltdl.dll on cygwin (and
other -no-undefined architectures).
* libltdl/ltdl.c (lt_preloaded_symbols): No longer defined here.

ChangeLog
libltdl/ltdl.c
libltdl/ltdl.h

index 362d85f23ab054108a65e7f3ddff7b8754029bd4..a5dacb29aa329d8687ab4b245f3e50e6d3fcf2eb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2000-01-14  Gary V. Vaughan  <gary@oranda.demon.co.uk>
 
+       * libltdl/ltdl.h (LTDL_STMT_START, LTDL_STMT_END):  Macros for
+       wrapping other macros to make a portable compound statement from
+       multiple C statements in the expansion.
+       (LTDL_SET_PRELOADED_SYMBOLS): Use the above macros to add an
+       extern declaration for lt_preloaded_symbols, to remove
+       dependency on undefined symbol from libltdl.dll on cygwin (and
+       other -no-undefined architectures).
+       * libltdl/ltdl.c (lt_preloaded_symbols): No longer defined here.
+
        * libtool,m4 (AC_LIBTOOL_SETUP):  The result of lt_cv_need_dllmain
        was set to the opposite of what it should be.
        * configure.in (AC_LIBTOOL_WIN32_DLL):  Call to this macro is
index 9cb5887e7c8fcff0734997edc0aad22fcdc12ee5..cb86a5d69a713288bc91e49fa896160ae5f241b7 100644 (file)
@@ -104,11 +104,6 @@ static const char invalid_handle_error[] = "invalid handle";
 static const char buffer_overflow_error[] = "internal buffer overflow";
 static const char shutdown_error[] = "library already shutdown";
 
-#ifndef HAVE_PRELOADED_SYMBOLS
-/* If libtool won't define it, we'd better do */
-LTDL_GLOBAL_DATA const lt_dlsymlist lt_preloaded_symbols[1] = { { 0, 0 } };
-#endif
-
 static const char *last_error = 0;
 
 LTDL_GLOBAL_DATA lt_ptr_t (*lt_dlmalloc) LTDL_PARAMS((size_t size)) = (lt_ptr_t(*)LTDL_PARAMS((size_t)))malloc;
index 0fafa207c58fc94d5aa183030884831e4aaeb0be..76c451a4424ed36e5345863e50f5f22a7eed557a 100644 (file)
@@ -66,6 +66,24 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
 # define lt_ptr_t      char*
 #endif
 
+/* LTDL_STMT_START/END are used to create macros which expand to a
+   a single compound statement in a portable way. */
+#undef LTDL_STMT_START
+#undef LTDL_STMT_END
+#if defined (__GNUC__) && !defined (__STRICT_ANSI__) && !defined (__cplusplus)
+#  define LTDL_STMT_START        (void)(
+#  define LTDL_STMT_END          )
+#else
+#  if (defined (sun) || defined (__sun__))
+#    define LTDL_STMT_START      if (1)
+#    define LTDL_STMT_END        else (void)0
+#  else
+#    define LTDL_STMT_START      do
+#    define LTDL_STMT_END        while (0)
+#  endif
+#endif
+
+
 #ifdef WIN32
 #  ifndef __CYGWIN__
 /* LTDL_DIRSEP_CHAR is accepted *in addition* to '/' as a directory
@@ -130,8 +148,10 @@ extern int lt_dlsetdata LTDL_PARAMS((lt_dlhandle handle, lt_ptr_t data));
 extern lt_ptr_t lt_dlgetdata LTDL_PARAMS((lt_dlhandle handle));
 extern const lt_dlinfo *lt_dlgetinfo LTDL_PARAMS((lt_dlhandle handle));
 
-LTDL_SCOPE const lt_dlsymlist lt_preloaded_symbols[];
-#define LTDL_SET_PRELOADED_SYMBOLS() lt_dlpreload_default(lt_preloaded_symbols)
+#define LTDL_SET_PRELOADED_SYMBOLS()           LTDL_STMT_START{        \
+       extern const lt_dlsymlist lt_preloaded_symbols[];               \
+       lt_dlpreload_default(lt_preloaded_symbols);                     \
+                                               }LTDL_STMT_END
 
 LTDL_SCOPE lt_ptr_t (*lt_dlmalloc)LTDL_PARAMS((size_t size));
 LTDL_SCOPE void (*lt_dlfree)LTDL_PARAMS((lt_ptr_t ptr));