From: Gurusamy Sarathy Date: Fri, 3 Mar 2000 16:21:34 +0000 (+0000) Subject: OS/2 patches for dlclose() support (from Yitzchak Scott-Thoennes X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=403d6f8e894056e673725f16d00d471c48c44dd2;p=p5sagit%2Fp5-mst-13.2.git OS/2 patches for dlclose() support (from Yitzchak Scott-Thoennes ) p4raw-id: //depot/perl@5488 --- diff --git a/makedef.pl b/makedef.pl index b88b8e9..ed3f1ccc 100644 --- a/makedef.pl +++ b/makedef.pl @@ -270,6 +270,7 @@ elsif ($PLATFORM eq 'os2') { dlopen dlsym dlerror + dlclose my_tmpfile my_tmpnam my_flock diff --git a/os2/diff.configure b/os2/diff.configure index c8f3b58..59a8a53 100644 --- a/os2/diff.configure +++ b/os2/diff.configure @@ -1,18 +1,18 @@ ---- Configure-pre Sun Jul 25 19:18:02 1999 -+++ Configure Wed Jul 28 17:50:14 1999 -@@ -1528,6 +1528,11 @@ if test X"$trnl" = X; then +--- Configure.orig Tue Feb 29 19:07:00 2000 ++++ Configure Thu Mar 2 10:10:24 2000 +@@ -1605,6 +1605,11 @@ esac fi if test X"$trnl" = X; then -+ case "`echo foo|tr '\r' x 2>/dev/null`" in -+ foox) trnl='\r' ;; ++ case "`echo foo|tr '\r\n' xy 2>/dev/null`" in ++ fooxy) trnl='\n\r' ;; + esac +fi +if test X"$trnl" = X; then cat <&2 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'. -@@ -1844,7 +1849,7 @@ for file in $loclist; do +@@ -1921,7 +1926,7 @@ *) echo "I don't know where '$file' is, and my life depends on it." >&4 echo "Go find a public domain implementation or fix your PATH setting!" >&4 @@ -21,16 +21,7 @@ ;; esac done -@@ -3688,7 +3693,7 @@ int main() { - exit(0); - } - EOM --if $cc -o gccvers gccvers.c; then -+if $cc -o gccvers gccvers.c $ldflags; then - gccversion=`./gccvers` - case "$gccversion" in - '') echo "You are not using GNU cc." ;; -@@ -4892,7 +4897,7 @@ case "$libc" in +@@ -5719,7 +5724,7 @@ esac ;; esac diff --git a/os2/dl_os2.c b/os2/dl_os2.c index 4a9688c..aab48dd 100644 --- a/os2/dl_os2.c +++ b/os2/dl_os2.c @@ -87,3 +87,13 @@ dlerror(void) return buf; } +int +dlclose(void *handle) +{ + ULONG rc; + + if ((rc = DosFreeModule((HMODULE)handle)) == 0) return 0; + + retcode = rc; + return 2; +} diff --git a/os2/dlfcn.h b/os2/dlfcn.h index c96f97f..c2feee6 100644 --- a/os2/dlfcn.h +++ b/os2/dlfcn.h @@ -1,3 +1,4 @@ void *dlopen(char *path, int mode); void *dlsym(void *handle, char *symbol); char *dlerror(void); +int dlclose(void *handle); diff --git a/os2/os2.sym b/os2/os2.sym index 7724e56..6855686 100644 --- a/os2/os2.sym +++ b/os2/os2.sym @@ -5,6 +5,7 @@ OS2_Perl_data dlopen dlsym dlerror +dlclose my_tmpfile my_tmpnam my_flock