]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* libltdl/lt__pre89.h, libltdl/ltdl.c, libltdl/ltdl.h, libltdl/argz.c,
authorGary V. Vaughan <gary@gnu.org>
Tue, 13 Apr 2004 15:30:10 +0000 (15:30 +0000)
committerGary V. Vaughan <gary@gnu.org>
Tue, 13 Apr 2004 15:30:10 +0000 (15:30 +0000)
libltdl/argz.h, libltdl/lt__glibc.h, libltdl/lt_dlloader.h,
libltdl/lt__dirent.c, libltdl/lt__dirent.h, libltdl/lt__private.h,
libltdl/lt__alloc.c, libltdl/lt__alloc.h, libltdl/lt_system.h,
libltdl/loader-dld_link.c, libltdl/loader-dlopen.c,
libltdl/loader-dyld.c,  libltdl/loader-loadlibrary.c,
libltdl/loader-shl_load.c, libltdl/lt_error.h, libltdl/lt_mutex.h:
Autoconf either defines to 1 or undefs the discovery macros it
puts in config.h, and many (non-GNU) compilers throw a spurious
warning when testing an #undef macro with #if.  For consistency,
while we are touching all these lines, use defined(MACRO) style
throughout.
Reported by Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>

20 files changed:
ChangeLog
libltdl/argz.c
libltdl/argz.h
libltdl/loader-dld_link.c
libltdl/loader-dlopen.c
libltdl/loader-dyld.c
libltdl/loader-loadlibrary.c
libltdl/loader-shl_load.c
libltdl/lt__alloc.c
libltdl/lt__alloc.h
libltdl/lt__dirent.c
libltdl/lt__dirent.h
libltdl/lt__glibc.h
libltdl/lt__pre89.h
libltdl/lt__private.h
libltdl/lt_error.h
libltdl/lt_mutex.h
libltdl/lt_system.h
libltdl/ltdl.c
libltdl/ltdl.h

index 15d7e576b96fc4667c37948168f4a27b03f0a940..234f93b6ced10f3c534424ba96ba4877135304c0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2004-04-13  Gary V. Vaughan  <gary@gnu.org>
+
+       * libltdl/lt__pre89.h, libltdl/ltdl.c, libltdl/ltdl.h, libltdl/argz.c,
+       libltdl/argz.h, libltdl/lt__glibc.h, libltdl/lt_dlloader.h,
+       libltdl/lt__dirent.c, libltdl/lt__dirent.h, libltdl/lt__private.h,
+       libltdl/lt__alloc.c, libltdl/lt__alloc.h, libltdl/lt_system.h,
+       libltdl/loader-dld_link.c, libltdl/loader-dlopen.c,
+       libltdl/loader-dyld.c,  libltdl/loader-loadlibrary.c,
+       libltdl/loader-shl_load.c, libltdl/lt_error.h, libltdl/lt_mutex.h:
+       Autoconf either defines to 1 or undefs the discovery macros it
+       puts in config.h, and many (non-GNU) compilers throw a spurious
+       warning when testing an #undef macro with #if.  For consistency,
+       while we are touching all these lines, use defined(MACRO) style
+       throughout.
+       Reported by Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>
+
 2004-04-13  Gary V. Vaughan  <gary@gnu.org>
 
        Factor out the individual loaders, in preparation for preloading
index 9762e96d4f289ce86d1f31e3bcdf28eaa9e047d2..8bda7a890aeab1925940e47bd21302d355c6d39b 100644 (file)
@@ -35,12 +35,12 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
 #include <sys/types.h>
 #include <errno.h>
 
-#if HAVE_STRING_H
+#if defined(HAVE_STRING_H)
 #  include <string.h>
-#elif HAVE_STRINGS_H
+#elif defined(HAVE_STRINGS_H)
 #  include <strings.h>
 #endif
-#if HAVE_MEMORY_H
+#if defined(HAVE_MEMORY_H)
 #  include <memory.h>
 #endif
 
index 4958cbb042b50b14f97092bcc14a278478ea3435..6344fc5b098d8b799d611350ad7bd785cfef96b1 100644 (file)
@@ -27,14 +27,14 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
 
 */
 
-#ifndef ARGZ_H
+#if !defined(ARGZ_H)
 #define ARGZ_H 1
 
-#if LTDL
+#if defined(LTDL)
 #  include "lt__glibc.h"
 #endif
 
-#ifdef _cplusplus
+#if defined(_cplusplus)
 extern "C" {
 #endif
 
@@ -47,8 +47,8 @@ error_t       argz_insert     (char **pargz, size_t *pargz_len,
 char * argz_next       (char *argz, size_t argz_len, const char *entry);
 void   argz_stringify  (char *argz, size_t argz_len, int sep);
 
-#ifdef _cplusplus
+#if defined(_cplusplus)
 }
 #endif
 
-#endif /*!ARGZ_H*/
+#endif /*!defined(ARGZ_H)*/
index 0f97be0f83105af078c86a79034bf73066aae8bf..d43b62217b16f1dd19cca8b2b33422e3b559ee16 100644 (file)
@@ -30,8 +30,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
 #include "lt__private.h"
 #include "lt_dlloader.h"
 
-#if HAVE_DLD_H
-#include <dld.h>
+#if defined(HAVE_DLD_H)
+#  include <dld.h>
 #endif
 
 static lt_module
index 986a1a0abdfac0a8fc22d945419d1878030cfdd7..2f4c2d56dd488ee77aa06faabca7cbf3e965c1fb 100644 (file)
@@ -30,39 +30,39 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
 #include "lt__private.h"
 #include "lt_dlloader.h"
 
-#if HAVE_DLFCN_H
+#if defined(HAVE_DLFCN_H)
 #  include <dlfcn.h>
 #endif
 
-#if HAVE_SYS_DL_H
+#if defined(HAVE_SYS_DL_H)
 #  include <sys/dl.h>
 #endif
 
 /* We may have to define LT_LAZY_OR_NOW in the command line if we
    find out it does not work in some platform. */
-#ifndef LT_LAZY_OR_NOW
-#  ifdef RTLD_LAZY
+#if !defined(LT_LAZY_OR_NOW)
+#  if defined(RTLD_LAZY)
 #    define LT_LAZY_OR_NOW     RTLD_LAZY
 #  else
-#    ifdef DL_LAZY
+#    if defined(DL_LAZY)
 #      define LT_LAZY_OR_NOW   DL_LAZY
 #    endif
 #  endif /* !RTLD_LAZY */
 #endif
-#ifndef LT_LAZY_OR_NOW
-#  ifdef RTLD_NOW
+#if !defined(LT_LAZY_OR_NOW)
+#  ifd efined(RTLD_NOW)
 #    define LT_LAZY_OR_NOW     RTLD_NOW
 #  else
-#    ifdef DL_NOW
+#    if defined(DL_NOW)
 #      define LT_LAZY_OR_NOW   DL_NOW
 #    endif
 #  endif /* !RTLD_NOW */
 #endif
-#ifndef LT_LAZY_OR_NOW
+#if !defined(LT_LAZY_OR_NOW)
 #  define LT_LAZY_OR_NOW       0
 #endif /* !LT_LAZY_OR_NOW */
 
-#if HAVE_DLERROR
+#if defined(HAVE_DLERROR)
 #  define DLERROR(arg) dlerror ()
 #else
 #  define DLERROR(arg) LT__STRERROR (arg)
@@ -113,7 +113,7 @@ sys_dl_sym (lt_user_data loader_data, lt_module module, const char *symbol)
 
 struct lt_user_dlloader lt__sys_dl =
   {
-#  ifdef NEED_USCORE
+#  if defined(NEED_USCORE)
     "_",
 #  else
     0,
index 71fe82370e5a7fef4091c5d0e80025191167da81..6c0f2523bd447b3c6022786bbab246b51c785f37 100644 (file)
@@ -30,7 +30,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
 #include "lt__private.h"
 #include "lt_dlloader.h"
 
-#if HAVE_MACH_O_DYLD_H
+#if defined(HAVE_MACH_O_DYLD_H)
 #  if !defined(__APPLE_CC__) && !defined(__MWERKS__) && !defined(__private_extern__)
   /* Is this correct? Does it still function properly? */
 #    define __private_extern__ extern
@@ -41,7 +41,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
 #include <mach-o/getsect.h>
 
 /* We have to put some stuff here that isn't in older dyld.h files */
-#ifndef ENUM_DYLD_BOOL
+#if !defined(ENUM_DYLD_BOOL)
 # define ENUM_DYLD_BOOL
 # undef FALSE
 # undef TRUE
@@ -50,10 +50,10 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
     TRUE
  };
 #endif
-#ifndef LC_REQ_DYLD
+#if !defined(LC_REQ_DYLD)
 # define LC_REQ_DYLD 0x80000000
 #endif
-#ifndef LC_LOAD_WEAK_DYLIB
+#if !defined(LC_LOAD_WEAK_DYLIB)
 # define LC_LOAD_WEAK_DYLIB (0x18 | LC_REQ_DYLD)
 #endif
 
@@ -71,39 +71,39 @@ static enum DYLD_BOOL (*lt__module_export)  (NSModule module) = 0;
 
 static int dyld_cannot_close                           = 0;
 
-#ifndef NSADDIMAGE_OPTION_NONE
+#if !defined(NSADDIMAGE_OPTION_NONE)
 #  define NSADDIMAGE_OPTION_NONE                          0x0
 #endif
-#ifndef NSADDIMAGE_OPTION_RETURN_ON_ERROR
+#if !defined(NSADDIMAGE_OPTION_RETURN_ON_ERROR)
 #  define NSADDIMAGE_OPTION_RETURN_ON_ERROR               0x1
 #endif
-#ifndef NSADDIMAGE_OPTION_WITH_SEARCHING
+#if !defined(NSADDIMAGE_OPTION_WITH_SEARCHING)
 #  define NSADDIMAGE_OPTION_WITH_SEARCHING                0x2
 #endif
-#ifndef NSADDIMAGE_OPTION_RETURN_ONLY_IF_LOADED
+#if !defined(NSADDIMAGE_OPTION_RETURN_ONLY_IF_LOADED)
 #  define NSADDIMAGE_OPTION_RETURN_ONLY_IF_LOADED         0x4
 #endif
-#ifndef NSADDIMAGE_OPTION_MATCH_FILENAME_BY_INSTALLNAME
+#if !defined(NSADDIMAGE_OPTION_MATCH_FILENAME_BY_INSTALLNAME)
 #  define NSADDIMAGE_OPTION_MATCH_FILENAME_BY_INSTALLNAME 0x8
 #endif
 
-#ifndef NSLOOKUPSYMBOLINIMAGE_OPTION_BIND
+#if !defined(NSLOOKUPSYMBOLINIMAGE_OPTION_BIND)
 #  define NSLOOKUPSYMBOLINIMAGE_OPTION_BIND               0x0
 #endif
-#ifndef NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_NOW
+#if !defined(NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_NOW)
 #  define NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_NOW           0x1
 #endif
-#ifndef NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_FULLY
+#if !defined(NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_FULLY)
 #  define NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_FULLY         0x2
 #endif
-#ifndef NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR
+#if !defined(NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR)
 #  define NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR    0x4
 #endif
 
 #define LT__SYMLOOKUP_OPTS     (NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_NOW \
                                | NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR)
 
-#ifdef __BIG_ENDIAN__
+#if defined(__BIG_ENDIAN__)
 #  define LT__MAGIC    MH_MAGIC
 #else
 #  define LT__MAGIC    MH_CIGAM
@@ -339,7 +339,6 @@ sys_dyld_close (lt_user_data loader_data, lt_module module)
        }
       else
        {
-#if 1
          /* Currently, if a module contains c++ static destructors and it
             is unloaded, we get a segfault in atexit(), due to compiler and
             dynamic loader differences of opinion, this works around that.  */
@@ -349,8 +348,7 @@ sys_dyld_close (lt_user_data loader_data, lt_module module)
            {
              flags |= NSUNLINKMODULE_OPTION_KEEP_MEMORY_MAPPED;
            }
-#endif
-#ifdef __ppc__
+#if defined(__ppc__)
          flags |= NSUNLINKMODULE_OPTION_RESET_LAZY_REFERENCES;
 #endif
          if (!NSUnLinkModule (module, flags))
index a240fd24c93fcb9620eeafa7f8afff77b72fdae0..ab28797b1a4a4d0ef7d0261cb98925497a489a59 100644 (file)
@@ -73,7 +73,7 @@ sys_wll_open (lt_user_data loader_data, const char *filename)
   if (!searchname)
     return 0;
 
-#if __CYGWIN__
+#if defined(__CYGWIN__)
   {
     char wpath[MAX_PATH];
     cygwin_conv_to_full_win32_path(searchname, wpath);
index 7ba0f3164a5fcecb808e41a146b1c10ea9b8af90..49d9283df9785cae536d6ccbede27faf3753eff4 100644 (file)
@@ -30,7 +30,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
 #include "lt__private.h"
 #include "lt_dlloader.h"
 
-#ifdef HAVE_DL_H
+#if defined(HAVE_DL_H)
 #  include <dl.h>
 #endif
 
@@ -65,10 +65,10 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  *                  library specified by the path argument.
  */
 
-#ifndef        DYNAMIC_PATH
+#if !defined(DYNAMIC_PATH)
 #  define DYNAMIC_PATH         0
 #endif
-#ifndef        BIND_RESTRICTED
+#if !defined(BIND_RESTRICTED)
 #  define BIND_RESTRICTED      0
 #endif
 
index 8d740d78d460d803d0cebdb6206189ffaba3f543..93275d1926a99e16769ecc42341bcd54757af1f6 100644 (file)
@@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
 
 */
 
-#ifdef HAVE_CONFIG_H
+#if defined(HAVE_CONFIG_H)
 #  include HAVE_CONFIG_H
 #endif
 
index 48c91447d4d4b1bee0428c3ce4dc1387c2ae656c..fd88e775243eeb884d8d1674dd167e47d464166b 100644 (file)
@@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
 
 */
 
-#ifndef LT__ALLOC_H
+#if !defined(LT__ALLOC_H)
 #define LT__ALLOC_H 1
 
 #include "lt_system.h"
@@ -53,4 +53,4 @@ char *lt__strdup (const char *string);
 
 LT_END_C_DECLS
 
-#endif /*!LT__ALLOC_H*/
+#endif /*!defined(LT__ALLOC_H)*/
index 511572d14b433d9ebff12a46a4b7607d14e387c5..6f0d68948d7e73d811240901a2899a2230f52aea 100644 (file)
@@ -32,7 +32,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
 
 #include "lt__dirent.h"
 
-#if __WINDOWS__
+#if defined(__WINDOWS__)
 
 void
 closedir (DIR *entry)
@@ -98,4 +98,4 @@ readdir (DIR *entry)
   return &entry->file_info;
 }
 
-#endif /*__WINDOWS__*/
+#endif /*defined(__WINDOWS__)*/
index 203e4867bfc5e7525fb1f8eaabf805547825fc19..4c2b4e21914346d77b6a021f894784539842c2f1 100644 (file)
@@ -27,10 +27,10 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
 
 */
 
-#ifndef LT__DIRENT_H
+#if !defined(LT__DIRENT_H)
 #define LT__DIRENT_H 1
 
-#ifdef HAVE_CONFIG_H
+#if defined(HAVE_CONFIG_H)
 #  include HAVE_CONFIG_H
 #endif
 
@@ -46,13 +46,13 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    `direct' API.  */
 #  define dirent direct
 #  define D_NAMLEN(dirent) ((dirent)->d_namlen)
-#  if HAVE_SYS_NDIR_H
+#  if defined(HAVE_SYS_NDIR_H)
 #    include <sys/ndir.h>
 #  endif
-#  if HAVE_SYS_DIR_H
+#  if defined(HAVE_SYS_DIR_H)
 #    include <sys/dir.h>
 #  endif
-#  if HAVE_NDIR_H
+#  if defined(HAVE_NDIR_H)
 #    include <ndir.h>
 #  endif
 
@@ -92,6 +92,6 @@ void          closedir        (DIR *entry);
 
 LT_END_C_DECLS
 
-#endif /*!__WINDOWS__*/
+#endif /*!defined(__WINDOWS__)*/
 
-#endif /*!LT__DIRENT_H*/
+#endif /*!defined(LT__DIRENT_H)*/
index 9d3af3b9936e7ea7bdbcb31197967736b14a6411..0e91c918b57cd2820323954ed04d6357cd808260 100644 (file)
@@ -27,10 +27,10 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
 
 */
 
-#ifndef LT__GLIBC_H
+#if !defined(LT__GLIBC_H)
 #define LT__GLIBC_H 1
 
-#ifdef HAVE_CONFIG_H
+#if defined(HAVE_CONFIG_H)
 #  include HAVE_CONFIG_H
 #endif
 
@@ -54,20 +54,20 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
 /* ...finally, we revert to the library implementations of any symbols
    that are provided by the host since they may be more optimised (say
    with inline assembler) than the generic versions we provide here.  */
-#if HAVE_ARGZ_APPEND
+#if defined(HAVE_ARGZ_APPEND)
 #  undef argz_append
 #endif
-#if HAVE_ARGZ_CREATE_SEP
+#if defined(HAVE_ARGZ_CREATE_SEP)
 #  undef argz_create_sep
 #endif
-#if HAVE_ARGZ_INSERT
+#if defined(HAVE_ARGZ_INSERT)
 #  undef argz_insert
 #endif
-#if HAVE_ARGZ_NEXT
+#if defined(HAVE_ARGZ_NEXT)
 #  undef argz_next
 #endif
-#if HAVE_ARGZ_STRINGIFY
+#if defined(HAVE_ARGZ_STRINGIFY)
 #  undef argz_stringify
 #endif
 
-#endif /*!LT__GLIBC_H*/
+#endif /*!defined(LT__GLIBC_H)*/
index c410f6e6a8dd087f1589ee41fd62e1ef9466d759..c184e501db98ff2dd46e23b4ad9eaf277c143bd7 100644 (file)
@@ -27,10 +27,10 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
 
 */
 
-#ifndef LT__PREC89_H
+#if !defined(LT__PREC89_H)
 #define LT__PREC89_H 1
 
-#ifdef HAVE_CONFIG_H
+#if defined(HAVE_CONFIG_H)
 #  include HAVE_CONFIG_H
 #endif
 
@@ -38,14 +38,14 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
 
 LT_BEGIN_C_DECLS
 
-#if ! HAVE_STRCMP
+#if !defined(HAVE_STRCMP)
 #  undef strcmp
 #  define strcmp lt__strcmp
 int strcmp (const char *str1, const char *str2);
 #endif
 
-#if ! HAVE_STRCHR
-#  if HAVE_INDEX
+#if !defined(HAVE_STRCHR)
+#  if defined(HAVE_INDEX)
 #    define strchr index
 #  else
 #    undef strchr
@@ -54,8 +54,8 @@ const char *strchr (const char *str, int ch);
 #  endif
 #endif
 
-#if ! HAVE_STRRCHR
-#  if HAVE_RINDEX
+#if !defined(HAVE_STRRCHR)
+#  if defined(HAVE_RINDEX)
 #    define strrchr rindex
 #  else
 #    undef strcmp
@@ -64,8 +64,8 @@ const char *strrchr (const char *str, int ch);
 #  endif
 #endif
 
-#if ! HAVE_MEMCPY
-#  if HAVE_BCOPY
+#if !defined(HAVE_MEMCPY)
+#  if defined(HAVE_BCOPY)
 #    define memcpy(dest, src, size)    bcopy((src), (dest), (size))
 #  else
 #    undef memcpy
@@ -74,7 +74,7 @@ void *memcpy (void *dest, const void *src, size_t size);
 #  endif
 #endif
 
-#if ! HAVE_MEMMOVE
+#if !defined(HAVE_MEMMOVE)
 #  undef memmove
 #  define memmove lt__memmove
 void *memmove (void *dest, const void *src, size_t size);
@@ -82,4 +82,4 @@ void *memmove (void *dest, const void *src, size_t size);
 
 LT_END_C_DECLS
 
-#endif /*!LT__PREC89*/
+#endif /*!defined(LT__PREC89)*/
index d1776c645b84bddfe2b2e4e82bac158265da34d5..61cdd67da60ed9a083742f181a3bbba94b86f51b 100644 (file)
@@ -27,10 +27,10 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
 
 */
 
-#ifndef LT__PRIVATE_H
+#if !defined(LT__PRIVATE_H)
 #define LT__PRIVATE_H 1
 
-#ifdef HAVE_CONFIG_H
+#if defined(HAVE_CONFIG_H)
 #  include HAVE_CONFIG_H
 #endif
 
@@ -39,18 +39,18 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
 #include <assert.h>
 #include <errno.h>
 
-#if HAVE_UNISTD_H
+#if defined(HAVE_UNISTD_H)
 #  include <unistd.h>
 #endif
 
-#if HAVE_STRING_H
+#if defined(HAVE_STRING_H)
 #  include <string.h>
 #else
-#  if HAVE_STRINGS_H
+#  if defined(HAVE_STRINGS_H)
 #    include <strings.h>
 #  endif
 #endif
-#if HAVE_MEMORY_H
+#if defined(HAVE_MEMORY_H)
 #  include <memory.h>
 #endif
 
@@ -63,11 +63,11 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
 /* ...and all exported interfaces.  */
 #include "ltdl.h"
 
-#if WITH_DMALLOC
+#if defined(WITH_DMALLOC)
 #  include <dmalloc.h>
 #endif
 
-#ifdef DLL_EXPORT
+#if defined(DLL_EXPORT)
 #  define LT_GLOBAL_DATA       __declspec(dllexport)
 #else
 #  define LT_GLOBAL_DATA
@@ -76,7 +76,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
 
 LT_BEGIN_C_DECLS
 
-#ifndef errno
+#if !defined(errno)
 extern int errno;
 #endif
 
@@ -135,4 +135,4 @@ LT_SCOPE const char         *lt__last_error;
 
 LT_END_C_DECLS
 
-#endif /*!LT__PRIVATE_H*/
+#endif /*!defined(LT__PRIVATE_H)*/
index 7043db2f2cdbe2500abe7e48ab36712f7ae68bad..b250899603d67023829e35abc95607b37bcc6455 100644 (file)
@@ -27,7 +27,7 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
 */
 
 /* Only include this header file once. */
-#ifndef LT_ERROR_H
+#if !defined(LT_ERROR_H)
 #define LT_ERROR_H 1
 
 #include <libltdl/lt_system.h>
@@ -75,4 +75,4 @@ LT_SCOPE int  lt_dlseterror   (int errorcode);
 
 LT_END_C_DECLS
 
-#endif /*!LT_ERROR_H*/
+#endif /*!defined(LT_ERROR_H)*/
index 53eb4ce010ed2655f2a0e426e255f1c3814f87fc..ae0dd7480c132b5c7e950398d66e0b2fe78c8bc5 100644 (file)
@@ -27,7 +27,7 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
 */
 
 /* Only include this header file once. */
-#ifndef LT_MUTEX_H
+#if !defined(LT_MUTEX_H)
 #define LT_MUTEX_H 1
 
 #include <libltdl/lt_system.h>
@@ -46,4 +46,4 @@ LT_SCOPE int  lt_dlmutex_register     (lt_dlmutex_lock *lock,
 
 LT_END_C_DECLS
 
-#endif /*!LT_MUTEX_H*/
+#endif /*!defined(LT_MUTEX_H)*/
index ad0f26cf1c97638523e28675f6808b50b63d45f6..802930cfdf3c8533ffe029e93bab37ef2a8fc064 100644 (file)
@@ -26,7 +26,7 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
 02111-1307  USA
 */
 
-#ifndef LT_SYSTEM_H
+#if !defined(LT_SYSTEM_H)
 #define LT_SYSTEM_H 1
 
 #include <stddef.h>
@@ -34,10 +34,10 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
 #include <sys/types.h>
 
 /* Some systems do not define EXIT_*, even with STDC_HEADERS.  */
-#ifndef EXIT_SUCCESS
+#if !defined(EXIT_SUCCESS)
 # define EXIT_SUCCESS 0
 #endif
-#ifndef EXIT_FAILURE
+#if !defined(EXIT_FAILURE)
 # define EXIT_FAILURE 1
 #endif
 
@@ -51,7 +51,7 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
 /* LTDL_BEGIN_C_DECLS should be used at the beginning of your declarations,
    so that C++ compilers don't mangle their names.  Use LTDL_END_C_DECLS at
    the end of C declarations. */
-#ifdef __cplusplus
+#if defined(__cplusplus)
 # define LT_BEGIN_C_DECLS      extern "C" {
 # define LT_END_C_DECLS                }
 #else
@@ -96,37 +96,21 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
 
 /* DLL building support on win32 hosts;  mostly to workaround their
    ridiculous implementation of data symbol exporting. */
-#ifndef LT_SCOPE
-#  ifdef __WINDOWS__
-#    ifdef DLL_EXPORT          /* defined by libtool (if required) */
+#if !defined(LT_SCOPE)
+#  if defined(__WINDOWS__)
+#    if defined(DLL_EXPORT)            /* defined by libtool (if required) */
 #      define LT_SCOPE __declspec(dllexport)
 #    endif
-#    ifdef LIBLTDL_DLL_IMPORT  /* define if linking with this dll */
+#    if defined(LIBLTDL_DLL_IMPORT)    /* define if linking with this dll */
 #      define LT_SCOPE extern __declspec(dllimport)
 #    endif
 #  endif
-#  ifndef LT_SCOPE             /* static linking or !__WINDOWS__ */
+#  if !defined(LT_SCOPE)               /* static linking or !__WINDOWS__ */
 #    define LT_SCOPE   extern
 #  endif
 #endif
 
-/* DLL building support on win32 hosts;  mostly to workaround their
-   ridiculous implementation of data symbol exporting. */
-#ifndef LT_SCOPE
-#  ifdef __WINDOWS__
-#    ifdef DLL_EXPORT          /* defined by libtool (if required) */
-#      define LT_SCOPE __declspec(dllexport)
-#    endif
-#    ifdef LIBLTDL_DLL_IMPORT  /* define if linking with this dll */
-#      define LT_SCOPE extern __declspec(dllimport)
-#    endif
-#  endif
-#  ifndef LT_SCOPE             /* static linking or !__WINDOWS__ */
-#    define LT_SCOPE   extern
-#  endif
-#endif
-
-#ifdef __WINDOWS__
+#if defined(__WINDOWS__)
 /* LT_DIRSEP_CHAR is accepted *in addition* to '/' as a directory
    separator when it is set. */
 # define LT_DIRSEP_CHAR                '\\'
@@ -155,4 +139,4 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
 #  define LT_CONC(s,t) s/**/t
 #endif
 
-#endif /*!LT__SYSTEM_H */
+#endif /*!defined(LT__SYSTEM_H)*/
index 9280cf704cca1caf683cf6b4d0ee0034a436bda9..c685ba2d4c75d1de4766c73854003892e0600ec0 100644 (file)
@@ -43,7 +43,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
 #define LTDL_ARCHIVE_EXT       ".la"
 
 /* max. filename length */
-#ifndef LT_FILENAME_MAX
+#if !defined(LT_FILENAME_MAX)
 #  define LT_FILENAME_MAX      1024
 #endif
 
@@ -110,10 +110,10 @@ struct lt_dlhandle_struct {
 
 static const char      objdir[]                = LTDL_OBJDIR;
 static const char      archive_ext[]           = LTDL_ARCHIVE_EXT;
-#ifdef LTDL_SHLIB_EXT
+#if defined(LTDL_SHLIB_EXT)
 static const char      shlib_ext[]             = LTDL_SHLIB_EXT;
 #endif
-#ifdef LTDL_SYSSEARCHPATH
+#if defined(LTDL_SYSSEARCHPATH)
 static const char      sys_search_path[]       = LTDL_SYSSEARCHPATH;
 #endif
 
@@ -121,22 +121,22 @@ static    const char      sys_search_path[]       = LTDL_SYSSEARCHPATH;
 
 /* --- DLLOADER VIRTUAL FUNCTION TABLES --- */
 
-#if HAVE_LIBDL
+#if defined(HAVE_LIBDL)
 LT_SCOPE struct lt_user_dlloader lt__sys_dl;
 #endif
-#if HAVE_SHL_LOAD
+#if defined(HAVE_SHL_LOAD)
 LT_SCOPE struct lt_user_dlloader lt__sys_shl;
 #endif
 #if defined(__WINDOWS__) || defined(__CYGWIN__)
 LT_SCOPE struct lt_user_dlloader lt__sys_wll;
 #endif
-#ifdef __BEOS__
+#if defined(__BEOS__)
 LT_SCOPE struct lt_user_dlloader lt__sys_bedl;
 #endif
-#if HAVE_DLD
+#if defined(HAVE_DLD)
 LT_SCOPE struct lt_user_dlloader lt__sys_dld;
 #endif
-#if HAVE_DYLD
+#if defined(HAVE_DYLD)
 LT_SCOPE struct lt_user_dlloader lt__sys_dyld;
 LT_SCOPE int lt__sys_dyld_init (void);
 #endif
@@ -232,20 +232,20 @@ lt_dlinit (void)
 
       /* All ltdl supplied loaders are in the /dl[a-z-]+/ namespace.  */
       errors += lt_dlloader_add (LOADER_APPEND, &lt__presym,   "dlpreload");
-#if HAVE_DLD
+#if defined(HAVE_DLD)
       errors += lt_dlloader_add (LOADER_APPEND, &lt__sys_dld,  "dld");
 #endif
-#if HAVE_DYLD
+#if defined(HAVE_DYLD)
       errors += lt_dlloader_add (LOADER_APPEND, &lt__sys_dyld, "dldyld");
       errors += lt__sys_dyld_init();
 #endif
-#ifdef __BEOS__
+#if defined(__BEOS__)
       errors += lt_dlloader_add (LOADER_APPEND, &lt__sys_bedl, "dlopen");
 #endif
-#if HAVE_SHL_LOAD
+#if defined(HAVE_SHL_LOAD)
       errors += lt_dlloader_add (LOADER_APPEND, &lt__sys_shl,  "dlopen");
 #endif
-#if HAVE_LIBDL
+#if defined(HAVE_LIBDL)
       errors += lt_dlloader_add (LOADER_APPEND, &lt__sys_dl,   "dlopen");
 #endif
 #if defined(__WINDOWS__) || defined(__CYGWIN__)
@@ -448,7 +448,7 @@ tryall_dlopen_module (lt_dlhandle *handle, const char *prefix,
   assert (handle);
   assert (dirname);
   assert (dlname);
-#ifdef LT_DIRSEP_CHAR
+#if defined(LT_DIRSEP_CHAR)
   /* Only canonicalized names (i.e. with DIRSEP chars already converted)
      should make it into this function:  */
   assert (strchr (dirname, LT_DIRSEP_CHAR) == 0);
@@ -556,7 +556,7 @@ canonicalize_path (const char *path, char **pcanonical)
 
        /* Anything other than a directory separator is copied verbatim.  */
        if ((path[src] != '/')
-#ifdef LT_DIRSEP_CHAR
+#if defined(LT_DIRSEP_CHAR)
            && (path[src] != LT_DIRSEP_CHAR)
 #endif
            )
@@ -568,7 +568,7 @@ canonicalize_path (const char *path, char **pcanonical)
           NULL terminator.  */
        else if ((path[1+ src] != LT_PATHSEP_CHAR)
                 && (path[1+ src] != LT_EOS_CHAR)
-#ifdef LT_DIRSEP_CHAR
+#if defined(LT_DIRSEP_CHAR)
                 && (path[1+ src] != LT_DIRSEP_CHAR)
 #endif
                 && (path[1+ src] != '/'))
@@ -762,7 +762,7 @@ find_handle (const char *search_path, const char *base_name,
 static int
 load_deplibs (lt_dlhandle handle, char *deplibs)
 {
-#if LTDL_DLOPEN_DEPLIBS
+#if defined(LTDL_DLOPEN_DEPLIBS)
   char *p, *save_search_path = 0;
   int   depcount = 0;
   int  i;
@@ -772,7 +772,7 @@ load_deplibs (lt_dlhandle handle, char *deplibs)
 
   handle->depcount = 0;
 
-#if LTDL_DLOPEN_DEPLIBS
+#if defined(LTDL_DLOPEN_DEPLIBS)
   if (!deplibs)
     {
       return errors;
@@ -1104,7 +1104,7 @@ try_dlopen (lt_dlhandle *phandle, const char *filename)
                file = find_file (search_path, base_name, &dir);
            }
 
-#ifdef LTDL_SHLIBPATH_VAR
+#if defined(LTDL_SHLIBPATH_VAR)
          if (!file)
            {
              search_path = getenv (LTDL_SHLIBPATH_VAR);
@@ -1112,7 +1112,7 @@ try_dlopen (lt_dlhandle *phandle, const char *filename)
                file = find_file (search_path, base_name, &dir);
            }
 #endif
-#ifdef LTDL_SYSSEARCHPATH
+#if defined(LTDL_SYSSEARCHPATH)
          if (!file && sys_search_path)
            {
              file = find_file (sys_search_path, base_name, &dir);
@@ -1307,11 +1307,11 @@ try_dlopen (lt_dlhandle *phandle, const char *filename)
       if ((dir || (!find_handle (user_search_path, base_name, &newhandle)
                   && !find_handle (getenv (LTDL_SEARCHPATH_VAR), base_name,
                                    &newhandle)
-#ifdef LTDL_SHLIBPATH_VAR
+#if defined(LTDL_SHLIBPATH_VAR)
                   && !find_handle (getenv (LTDL_SHLIBPATH_VAR), base_name,
                                    &newhandle)
 #endif
-#ifdef LTDL_SYSSEARCHPATH
+#if defined(LTDL_SYSSEARCHPATH)
                   && !find_handle (sys_search_path, base_name, &newhandle)
 #endif
                   )))
@@ -1407,7 +1407,7 @@ lt_dlopenext (const char *filename)
   /* If FILENAME already bears a suitable extension, there is no need
      to try appending additional extensions.  */
   if (ext && ((strcmp (ext, archive_ext) == 0)
-#ifdef LTDL_SHLIB_EXT
+#if defined(LTDL_SHLIB_EXT)
              || (strcmp (ext, shlib_ext) == 0)
 #endif
       ))
@@ -1435,7 +1435,7 @@ lt_dlopenext (const char *filename)
       return handle;
     }
 
-#ifdef LTDL_SHLIB_EXT
+#if defined(LTDL_SHLIB_EXT)
   /* Try appending SHLIB_EXT.   */
   if (LT_STRLEN (shlib_ext) > LT_STRLEN (archive_ext))
     {
@@ -1673,14 +1673,14 @@ lt_dlforeachfile (const char *search_path,
                                       foreachfile_callback, func, data);
        }
 
-#ifdef LTDL_SHLIBPATH_VAR
+#if defined(LTDL_SHLIBPATH_VAR)
       if (!is_done)
        {
          is_done = foreach_dirinpath (getenv(LTDL_SHLIBPATH_VAR), 0,
                                       foreachfile_callback, func, data);
        }
 #endif
-#ifdef LTDL_SYSSEARCHPATH
+#if defined(LTDL_SYSSEARCHPATH)
       if (!is_done)
        {
          is_done = foreach_dirinpath (getenv(LTDL_SYSSEARCHPATH), 0,
index 7db190d0f8c96bbb035d210a453bb96b51097365..3e93a83767149a150fd641b30c8d2db4dbbc4576 100644 (file)
@@ -27,7 +27,7 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
 */
 
 /* Only include this header file once. */
-#ifndef LTDL_H
+#if !defined(LTDL_H)
 #define LTDL_H 1
 
 #include <libltdl/lt_system.h>
@@ -139,7 +139,7 @@ LT_SCOPE void       (*lt_dlfree)    (void *ptr);
 /* --- SOURCE COMPATIBILITY WITH ANCIENT LIBLTDL --- */
 
 
-#ifdef LT_NON_POSIX_NAMESPACE
+#if defined(LT_NON_POSIX_NAMESPACE)
 #  define lt_ptr_t             void *
 #  define lt_module_t          lt_module
 #  define lt_module_open_t     lt_module_open
@@ -152,4 +152,4 @@ LT_SCOPE void       (*lt_dlfree)    (void *ptr);
 
 LT_END_C_DECLS
 
-#endif /* !LTDL_H */
+#endif /*!defined(LTDL_H)*/