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. Index: libltdl/config/ltmain.m4sh =================================================================== RCS file: /cvsroot/libtool/libtool/libltdl/config/ltmain.m4sh,v retrieving revision 1.52 diff -u -r1.52 ltmain.m4sh --- libltdl/config/ltmain.m4sh 25 Aug 2006 15:08:14 -0000 1.52 +++ libltdl/config/ltmain.m4sh 4 Sep 2006 17:24:10 -0000 @@ -940,31 +940,29 @@ $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" Index: libltdl/libltdl/lt_system.h =================================================================== RCS file: /cvsroot/libtool/libtool/libltdl/libltdl/lt_system.h,v retrieving revision 1.2 diff -u -r1.2 lt_system.h --- libltdl/libltdl/lt_system.h 22 Apr 2005 10:10:30 -0000 1.2 +++ libltdl/libltdl/lt_system.h 4 Sep 2006 17:24:10 -0000 @@ -99,7 +99,7 @@ #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)