]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* libltdl/libltdl/lt__private.h (__attribute__, LT__UNUSED):
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Wed, 30 Aug 2006 04:14:21 +0000 (04:14 +0000)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Wed, 30 Aug 2006 04:14:21 +0000 (04:14 +0000)
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.

ChangeLog
libltdl/libltdl/lt__private.h
libltdl/loaders/dld_link.c
libltdl/loaders/dlopen.c
libltdl/loaders/load_add_on.c
libltdl/loaders/loadlibrary.c
libltdl/loaders/preopen.c
libltdl/loaders/shl_load.c
libltdl/ltdl.c

index 5cfe0933edea360ada21871414025e0e2f0c89a6..dd9138b59388aec7b7bad940569b9e7d84609ee3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,17 @@
 2006-08-30  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
+       * 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.
index 690ea00f17ac7c813eb71dc55e2668e217f2ea2a..e712b6b8eaf0c822d00f673ac0078bab7f7a514f 100644 (file)
@@ -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
 
index 9dc9dcefdd3f5a3f4463dcafe821b280310336b0..b93868d201c60c7a5c7e74531e82d4ff100c2318 100644 (file)
@@ -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 <tanner@ffii.org>
 
    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);
 
index 7e058164b418beff428d6f7244646c71461c3b4b..95e7a07a8e468af047026bedd91cb68d2f7e9b49 100644 (file)
@@ -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 <tanner@ffii.org>
 
    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);
 
index 6c12256a7a959a58bb01662773f9ec05435e4a3c..d67e3a20d4345e31a6b4e8eb5ef4ffc4bc3bc44f 100644 (file)
@@ -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 <tanner@ffii.org>
 
    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;
index db3f80df76bd2fa8582266118706d7c69dcec5c9..47b0e664b68b324c70971e6b14a845cbbd9eef95 100644 (file)
@@ -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);
 
index afede08c559524d1b7931f8d6e70f186f7faf4cf..e71c46f2dbfe8a5153b588a9a54cf273c9e04e2c 100644 (file)
@@ -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 <tanner@ffii.org>
 
    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;
 
index f71773aab2a552edc5761c4938b1e103dc7b6073..bcdbc5632c522d2f5e4757eb6e2925e3ae86c52c 100644 (file)
@@ -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 <tanner@ffii.org>
 
    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;
 
index 15e2c5d63a790cf008d279158906fb005f497df0..92b6a0099735586d3ecdbedbadf58bf7554509dc 100644 (file)
@@ -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)