From: George Bosilca Date: Mon, 4 Sep 2006 17:25:15 +0000 (+0000) Subject: * libltdl/config/ltmain.m4sh (func_mode_link): In the dlsym X-Git-Tag: release-2-1b~251 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c6b76b438587dc3c8b89d287c281320358421aad;p=thirdparty%2Flibtool.git * libltdl/config/ltmain.m4sh (func_mode_link): In the dlsym file, define a type for the symbol list, and declare the list `extern', so that it is extern even if compiled by a C++ compiler. The type definition helps avoid a compiler warning against anonymous extern struct. * libltdl/libltdl/lt_system.h: Add `extern' to `LT_SCOPE' for the same reason. --- diff --git a/ChangeLog b/ChangeLog index bff5967f8..380210877 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,14 @@ 2006-09-04 George Bosilca and Ralf Wildenhues + * libltdl/config/ltmain.m4sh (func_mode_link): In the dlsym + file, define a type for the symbol list, and declare the list + `extern', so that it is extern even if compiled by a C++ + compiler. The type definition helps avoid a compiler warning + against anonymous extern struct. + * libltdl/libltdl/lt_system.h: Add `extern' to `LT_SCOPE' for + the same reason. + * libltdl/argz_.h: It's __cplusplus, not _cplusplus. * libltdl/libltdl/slist.h: Likewise. diff --git a/libltdl/config/ltmain.m4sh b/libltdl/config/ltmain.m4sh index 72e801b42..f9e5036d2 100644 --- a/libltdl/config/ltmain.m4sh +++ b/libltdl/config/ltmain.m4sh @@ -940,31 +940,29 @@ extern \"C\" { $ECHO >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ +typedef struct { + const char *name; + void *address; +} lt_dlsymlist; " case $host in *cygwin* | *mingw* ) $ECHO >> "$output_objdir/$my_dlsyms" "\ /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation - on pseudo-relocs. */ - struct { -" - ;; + on pseudo-relocs. */" + lt_dlsym_const= ;; *) - $ECHO >> "$output_objdir/$my_dlsyms" "\ -const struct { -" - ;; + lt_dlsym_const=const ;; esac $ECHO >> "$output_objdir/$my_dlsyms" "\ - const char *name; - void *address; -} +extern $lt_dlsym_const lt_dlsymlist +lt_${my_prefix}_LTX_preloaded_symbols[[]]; +$lt_dlsym_const lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[[]] = {\ - { \"$my_originator\", (void *) 0 }, -" + { \"$my_originator\", (void *) 0 }," eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" diff --git a/libltdl/libltdl/lt_system.h b/libltdl/libltdl/lt_system.h index d1e9f46bd..b8173943f 100644 --- a/libltdl/libltdl/lt_system.h +++ b/libltdl/libltdl/lt_system.h @@ -99,7 +99,7 @@ Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA #if !defined(LT_SCOPE) # if defined(__WINDOWS__) # if defined(DLL_EXPORT) /* defined by libtool (if required) */ -# define LT_SCOPE __declspec(dllexport) +# define LT_SCOPE extern __declspec(dllexport) # endif # if defined(LIBLTDL_DLL_IMPORT) /* define if linking with this dll */ # define LT_SCOPE extern __declspec(dllimport)