From 7955f590bb4ad0f8990cf33e6ad08baca1c66e88 Mon Sep 17 00:00:00 2001 From: Bob Friesenhahn Date: Wed, 15 Sep 2004 18:24:00 +0000 Subject: [PATCH] * libltdl/loaders/loadlibrary.c: Compilation fixes (originally from Gary V. Vaughan) to compile under MinGW. * config/mkstamp: Translate input data so that it is assured to use the Unix line terminations. This is necessary under Windows if the files are checked out with CR/NL line terminations. A side-effect of this change is that input must always be from stdin. Previously a filename argument was accepted as well. --- ChangeLog | 10 ++++++++ config/mkstamp | 6 ++--- libltdl/loaders/loadlibrary.c | 43 +++++++++++++++++++---------------- 3 files changed, 36 insertions(+), 23 deletions(-) diff --git a/ChangeLog b/ChangeLog index 90a82f510..0aa371cb1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2004-09-15 Bob Friesenhahn + + * libltdl/loaders/loadlibrary.c: Compilation fixes (originally + from Gary V. Vaughan) to compile under MinGW. + * config/mkstamp: Translate input data so that it is assured to + use the Unix line terminations. This is necessary under Windows if + the files are checked out with CR/NL line terminations. A + side-effect of this change is that input must always be from + stdin. Previously a filename argument was accepted as well. + 2004-09-15 Ralf Wildenhues * tests/Makefile.am: Use the same CPP, F77, CXX and CXXFLAGS diff --git a/config/mkstamp b/config/mkstamp index 2a1971b94..c59aef0b5 100755 --- a/config/mkstamp +++ b/config/mkstamp @@ -27,10 +27,10 @@ # tags, and it edits this line so that it looks like ` $rev $date' # Command-line arguments are passed down to sed; additional -e cmd -# arguments are acceptable. If no input filename is specified in the -# command line, sed will read from stdin. +# arguments are acceptable. Input is from from stdin. The original +# version of this script accepted input from a named file or stdin. -exec sed -e ' +tr -d "\015" | sed -e ' s%.*\$''Revision: \([^$]*\) \$.*\$''Date: \([^$]*\) \$.*% \1 \2% t end d diff --git a/libltdl/loaders/loadlibrary.c b/libltdl/loaders/loadlibrary.c index 98fc1ec97..ace878c74 100644 --- a/libltdl/loaders/loadlibrary.c +++ b/libltdl/loaders/loadlibrary.c @@ -52,7 +52,7 @@ static void * vm_sym (lt_user_data loader_data, lt_module module, lt_dlvtable * get_vtable (lt_user_data loader_data) { - static lt_dlloader *vtable = 0; + static lt_dlvtable *vtable = 0; if (!vtable) { @@ -95,7 +95,6 @@ static lt_dlhandle handles; static lt_module vm_open (lt_user_data loader_data, const char *filename) { - lt_dlhandle cur = 0; lt_module module = 0; const char *errormsg = 0; char *searchname = 0; @@ -149,26 +148,30 @@ vm_open (lt_user_data loader_data, const char *filename) We check whether LoadLibrary is returning a handle to an already loaded module, and simulate failure if we find one. */ - while (cur = lt_dlhandle_next (cur)) - { - if (!cur->module) - { - cur = 0; - break; - } - - if (cur->module == module) - { - break; - } + { + lt__handle * cur = 0; + + while (cur = (lt__handle *) lt_dlhandle_next ((lt_dlhandle) cur)) + { + if (!cur->module) + { + cur = 0; + break; + } + + if (cur->module == module) + { + break; + } + } + + if (cur || !module) + { + LT__SETERROR (CANNOT_OPEN); + module = 0; + } } - if (cur || !module) - { - LT__SETERROR (CANNOT_OPEN); - module = 0; - } - return module; } -- 2.47.2