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.
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.
# 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
/* 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
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);
/* 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;
/* 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);
/* 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
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);
/* 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;
/* 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);
/* 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
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;
/* 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;
/* 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;
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;
/* 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;
/* 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);
/* 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
/* 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;
/* 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;
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;
/* 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;
/* 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;
/* 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
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);
/* 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;
/* 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;
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,
}
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);
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;
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)