From: Ralf Wildenhues Date: Wed, 30 Aug 2006 04:14:21 +0000 (+0000) Subject: * libltdl/libltdl/lt__private.h (__attribute__, LT__UNUSED): X-Git-Tag: release-2-1b~259 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=673d0f40fec2ec0793074c39dec2499a00232f68;p=thirdparty%2Flibtool.git * libltdl/libltdl/lt__private.h (__attribute__, LT__UNUSED): New macros. * libltdl/loaders/dld_link.c: Use LT__UNUSED where appropriate. * libltdl/loaders/dlopen.c, libltdl/loaders/load_add_on.c, libltdl/loaders/loadlibrary.c, libltdl/loaders/preopen.c, libltdl/loaders/shl_load.c: Likewise. * libltdl/ltdl.c: Likewise. (find_file_callback): Fix declaration names to match definition. (load_deplibs) [!LTDL_DLOPEN_DEPLIBS]: Use separate definition for less preprocessor clutter. --- diff --git a/ChangeLog b/ChangeLog index 5cfe0933e..dd9138b59 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,17 @@ 2006-08-30 Ralf Wildenhues + * libltdl/libltdl/lt__private.h (__attribute__, LT__UNUSED): + New macros. + * libltdl/loaders/dld_link.c: Use LT__UNUSED where + appropriate. + * libltdl/loaders/dlopen.c, libltdl/loaders/load_add_on.c, + libltdl/loaders/loadlibrary.c, libltdl/loaders/preopen.c, + libltdl/loaders/shl_load.c: Likewise. + * libltdl/ltdl.c: Likewise. + (find_file_callback): Fix declaration names to match definition. + (load_deplibs) [!LTDL_DLOPEN_DEPLIBS]: Use separate definition + for less preprocessor clutter. + * Makefile.am (check-local, installcheck-local): Use `TESTSUITEFLAGS' rather than `TESTSUITE_FLAGS', like Autoconf. * HACKING, README, README.alpha: All uses changed. diff --git a/libltdl/libltdl/lt__private.h b/libltdl/libltdl/lt__private.h index 690ea00f1..e712b6b8e 100644 --- a/libltdl/libltdl/lt__private.h +++ b/libltdl/libltdl/lt__private.h @@ -77,6 +77,16 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # define LT_GLOBAL_DATA #endif +#ifndef __attribute__ +# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8) || __STRICT_ANSI__ +# define __attribute__(x) +# endif +#endif + +#ifndef LT__UNUSED +# define LT__UNUSED __attribute__ ((__unused__)) +#endif + LT_BEGIN_C_DECLS diff --git a/libltdl/loaders/dld_link.c b/libltdl/loaders/dld_link.c index 9dc9dcefd..b93868d20 100644 --- a/libltdl/loaders/dld_link.c +++ b/libltdl/loaders/dld_link.c @@ -1,5 +1,5 @@ /* loader-dld_link.c -- dynamic linking with dld - Copyright (C) 1998, 1999, 2000, 2004 Free Software Foundation, Inc. + Copyright (C) 1998, 1999, 2000, 2004, 2006 Free Software Foundation, Inc. Originally by Thomas Tanner NOTE: The canonical source of this file is maintained with the @@ -91,7 +91,7 @@ get_vtable (lt_user_data loader_data) loader. Returns an opaque representation of the newly opened module for processing with this loader's other vtable functions. */ static lt_module -vm_open (lt_user_data loader_data, const char *filename) +vm_open (lt_user_data loader_data LT__UNUSED, const char *filename) { lt_module module = lt__strdup (filename); @@ -107,7 +107,7 @@ vm_open (lt_user_data loader_data, const char *filename) /* A function called through the vtable when a particular module should be unloaded. */ static int -vm_close (lt_user_data loader_data, lt_module module) +vm_close (lt_user_data loader_data LT__UNUSED, lt_module module) { int errors = 0; @@ -127,7 +127,8 @@ vm_close (lt_user_data loader_data, lt_module module) /* A function called through the vtable to get the address of a symbol loaded from a particular module. */ static void * -vm_sym (lt_user_data loader_data, lt_module module, const char *name) +vm_sym (lt_user_data loader_data LT__UNUSED, lt_module module LT__UNUSED, + const char *name) { void *address = dld_get_func (name); diff --git a/libltdl/loaders/dlopen.c b/libltdl/loaders/dlopen.c index 7e058164b..95e7a07a8 100644 --- a/libltdl/loaders/dlopen.c +++ b/libltdl/loaders/dlopen.c @@ -1,5 +1,5 @@ /* loader-dlopen.c -- dynamic linking with dlopen/dlsym - Copyright (C) 1998, 1999, 2000, 2004 Free Software Foundation, Inc. + Copyright (C) 1998, 1999, 2000, 2004, 2006 Free Software Foundation, Inc. Originally by Thomas Tanner NOTE: The canonical source of this file is maintained with the @@ -132,7 +132,7 @@ get_vtable (lt_user_data loader_data) loader. Returns an opaque representation of the newly opened module for processing with this loader's other vtable functions. */ static lt_module -vm_open (lt_user_data loader_data, const char *filename) +vm_open (lt_user_data loader_data LT__UNUSED, const char *filename) { lt_module module = dlopen (filename, LT_LAZY_OR_NOW); @@ -148,7 +148,7 @@ vm_open (lt_user_data loader_data, const char *filename) /* A function called through the vtable when a particular module should be unloaded. */ static int -vm_close (lt_user_data loader_data, lt_module module) +vm_close (lt_user_data loader_data LT__UNUSED, lt_module module) { int errors = 0; @@ -165,7 +165,7 @@ vm_close (lt_user_data loader_data, lt_module module) /* A function called through the vtable to get the address of a symbol loaded from a particular module. */ static void * -vm_sym (lt_user_data loader_data, lt_module module, const char *name) +vm_sym (lt_user_data loader_data LT__UNUSED, lt_module module, const char *name) { void *address = dlsym (module, name); diff --git a/libltdl/loaders/load_add_on.c b/libltdl/loaders/load_add_on.c index 6c12256a7..d67e3a20d 100644 --- a/libltdl/loaders/load_add_on.c +++ b/libltdl/loaders/load_add_on.c @@ -1,5 +1,5 @@ /* loader-load_add_on.c -- dynamic linking for BeOS - Copyright (C) 1998, 1999, 2000, 2004 Free Software Foundation, Inc. + Copyright (C) 1998, 1999, 2000, 2004, 2006 Free Software Foundation, Inc. Originally by Thomas Tanner NOTE: The canonical source of this file is maintained with the @@ -89,7 +89,7 @@ get_vtable (lt_user_data loader_data) loader. Returns an opaque representation of the newly opened module for processing with this loader's other vtable functions. */ static lt_module -vm_open (lt_user_data loader_data, const char *filename) +vm_open (lt_user_data loader_data LT__UNUSED, const char *filename) { image_id image = 0; @@ -118,7 +118,7 @@ vm_open (lt_user_data loader_data, const char *filename) /* A function called through the vtable when a particular module should be unloaded. */ static int -vm_close (lt_user_data loader_data, lt_module module) +vm_close (lt_user_data loader_data LT__UNUSED, lt_module module) { int errors = 0; @@ -135,7 +135,7 @@ vm_close (lt_user_data loader_data, lt_module module) /* A function called through the vtable to get the address of a symbol loaded from a particular module. */ static void * -vm_sym (lt_user_data loader_data, lt_module module, const char *name) +vm_sym (lt_user_data loader_data LT__UNUSED, lt_module module, const char *name) { void *address = 0; image_id image = (image_id) module; diff --git a/libltdl/loaders/loadlibrary.c b/libltdl/loaders/loadlibrary.c index db3f80df7..47b0e664b 100644 --- a/libltdl/loaders/loadlibrary.c +++ b/libltdl/loaders/loadlibrary.c @@ -96,7 +96,7 @@ get_vtable (lt_user_data loader_data) loader. Returns an opaque representation of the newly opened module for processing with this loader's other vtable functions. */ static lt_module -vm_open (lt_user_data loader_data, const char *filename) +vm_open (lt_user_data loader_data LT__UNUSED, const char *filename) { lt_module module = 0; char *ext; @@ -198,7 +198,7 @@ vm_open (lt_user_data loader_data, const char *filename) /* A function called through the vtable when a particular module should be unloaded. */ static int -vm_close (lt_user_data loader_data, lt_module module) +vm_close (lt_user_data loader_data LT__UNUSED, lt_module module) { int errors = 0; @@ -215,7 +215,7 @@ vm_close (lt_user_data loader_data, lt_module module) /* A function called through the vtable to get the address of a symbol loaded from a particular module. */ static void * -vm_sym (lt_user_data loader_data, lt_module module, const char *name) +vm_sym (lt_user_data loader_data LT__UNUSED, lt_module module, const char *name) { void *address = GetProcAddress (module, name); diff --git a/libltdl/loaders/preopen.c b/libltdl/loaders/preopen.c index afede08c5..e71c46f2d 100644 --- a/libltdl/loaders/preopen.c +++ b/libltdl/loaders/preopen.c @@ -1,5 +1,5 @@ /* loader-preopen.c -- emulate dynamic linking using preloaded_symbols - Copyright (C) 1998, 1999, 2000, 2004 Free Software Foundation, Inc. + Copyright (C) 1998, 1999, 2000, 2004, 2006 Free Software Foundation, Inc. Originally by Thomas Tanner NOTE: The canonical source of this file is maintained with the @@ -108,7 +108,7 @@ static const lt_dlsymlist *default_preloaded_symbols = 0; /* A function called through the vtable to initialise this loader. */ static int -vl_init (lt_user_data loader_data) +vl_init (lt_user_data loader_data LT__UNUSED) { int errors = 0; @@ -125,7 +125,7 @@ vl_init (lt_user_data loader_data) /* A function called through the vtable when this loader is no longer needed by the application. */ static int -vl_exit (lt_user_data loader_data) +vl_exit (lt_user_data loader_data LT__UNUSED) { free_symlists (); return 0; @@ -136,7 +136,7 @@ vl_exit (lt_user_data loader_data) loader. Returns an opaque representation of the newly opened module for processing with this loader's other vtable functions. */ static lt_module -vm_open (lt_user_data loader_data, const char *filename) +vm_open (lt_user_data loader_data LT__UNUSED, const char *filename) { symlist_chain *lists; lt_module module = 0; @@ -188,7 +188,7 @@ vm_open (lt_user_data loader_data, const char *filename) /* A function called through the vtable when a particular module should be unloaded. */ static int -vm_close (lt_user_data loader_data, lt_module module) +vm_close (lt_user_data loader_data LT__UNUSED, lt_module module) { /* Just to silence gcc -Wall */ module = 0; @@ -199,7 +199,7 @@ vm_close (lt_user_data loader_data, lt_module module) /* A function called through the vtable to get the address of a symbol loaded from a particular module. */ static void * -vm_sym (lt_user_data loader_data, lt_module module, const char *name) +vm_sym (lt_user_data loader_data LT__UNUSED, lt_module module, const char *name) { lt_dlsymlist *symbol = (lt_dlsymlist*) module; diff --git a/libltdl/loaders/shl_load.c b/libltdl/loaders/shl_load.c index f71773aab..bcdbc5632 100644 --- a/libltdl/loaders/shl_load.c +++ b/libltdl/loaders/shl_load.c @@ -1,5 +1,5 @@ /* loader-shl_load.c -- dynamic linking with shl_load (HP-UX) - Copyright (C) 1998, 1999, 2000, 2004 Free Software Foundation, Inc. + Copyright (C) 1998, 1999, 2000, 2004, 2006 Free Software Foundation, Inc. Originally by Thomas Tanner NOTE: The canonical source of this file is maintained with the @@ -132,7 +132,7 @@ get_vtable (lt_user_data loader_data) loader. Returns an opaque representation of the newly opened module for processing with this loader's other vtable functions. */ static lt_module -vm_open (lt_user_data loader_data, const char *filename) +vm_open (lt_user_data loader_data LT__UNUSED, const char *filename) { static shl_t self = (shl_t) 0; lt_module module = shl_load (filename, LT_BIND_FLAGS, 0L); @@ -167,7 +167,7 @@ vm_open (lt_user_data loader_data, const char *filename) /* A function called through the vtable when a particular module should be unloaded. */ static int -vm_close (lt_user_data loader_data, lt_module module) +vm_close (lt_user_data loader_data LT__UNUSED, lt_module module) { int errors = 0; @@ -184,7 +184,7 @@ vm_close (lt_user_data loader_data, lt_module module) /* A function called through the vtable to get the address of a symbol loaded from a particular module. */ static void * -vm_sym (lt_user_data loader_data, lt_module module, const char *name) +vm_sym (lt_user_data loader_data LT__UNUSED, lt_module module, const char *name) { void *address = 0; diff --git a/libltdl/ltdl.c b/libltdl/ltdl.c index 15e2c5d63..92b6a0099 100644 --- a/libltdl/ltdl.c +++ b/libltdl/ltdl.c @@ -92,8 +92,8 @@ static int foreach_dirinpath (const char *search_path, foreach_callback_func *func, void *data1, void *data2); -static int find_file_callback (char *filename, void *data, - void *ignored); +static int find_file_callback (char *filename, void *data1, + void *data2); static int find_handle_callback (char *filename, void *data, void *ignored); static int foreachfile_callback (char *filename, void *data1, @@ -684,7 +684,7 @@ find_file (const char *search_path, const char *base_name, char **pdir) } static int -find_handle_callback (char *filename, void *data, void *ignored) +find_handle_callback (char *filename, void *data, void *ignored LT__UNUSED) { lt_dlhandle *handle = (lt_dlhandle *) data; int notfound = access (filename, R_OK); @@ -717,20 +717,26 @@ find_handle (const char *search_path, const char *base_name, return handle; } +#if !defined(LTDL_DLOPEN_DEPLIBS) +static int +load_deplibs (lt_dlhandle handle, char *deplibs LT__UNUSED) +{ + ((lt__handle *) handle)->depcount = 0; + return 0; +} + +#else /* defined(LTDL_DLOPEN_DEPLIBS) */ static int load_deplibs (lt_dlhandle handle, char *deplibs) { -#if defined(LTDL_DLOPEN_DEPLIBS) char *p, *save_search_path = 0; int depcount = 0; int i; char **names = 0; -#endif int errors = 0; ((lt__handle *) handle)->depcount = 0; -#if defined(LTDL_DLOPEN_DEPLIBS) if (!deplibs) { return errors; @@ -871,10 +877,10 @@ load_deplibs (lt_dlhandle handle, char *deplibs) if (save_search_path) { MEMREASSIGN (user_search_path, save_search_path); } -#endif return errors; } +#endif /* defined(LTDL_DLOPEN_DEPLIBS) */ static int unload_deplibs (lt_dlhandle handle)