From: Ilya Zakharevich Date: Tue, 16 Sep 2003 23:49:42 +0000 (-0700) Subject: OS/2 APIs again X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4ab57fcbe55563102f75ccfb800b14bb33d79457;p=p5sagit%2Fp5-mst-13.2.git OS/2 APIs again Message-ID: <20030917064941.GA20444@math.berkeley.edu> p4raw-id: //depot/perl@21259 --- diff --git a/os2/os2ish.h b/os2/os2ish.h index 0da62aa..7825c93 100644 --- a/os2/os2ish.h +++ b/os2/os2ish.h @@ -530,7 +530,7 @@ void init_PMWIN_entries(void); /* The expressions below return true on error. */ /* INCL_DOSERRORS needed. rc should be declared outside. */ -#define CheckOSError(expr) (!(rc = (expr)) ? 0 : (FillOSError(rc), 1)) +#define CheckOSError(expr) ((rc = (expr)) ? (FillOSError(rc), rc) : 0) /* INCL_WINERRORS needed. */ #define CheckWinError(expr) ((expr) ? 0: (FillWinError, 1)) @@ -679,6 +679,7 @@ enum entries_ordinals { ORD_WinFlashWindow, ORD_WinLoadPointer, ORD_WinQuerySysPointer, + ORD_DosReplaceModule, ORD_NENTRIES }; @@ -689,7 +690,11 @@ enum entries_ordinals { #define DeclVoidFuncByORD(name,o,at,args) \ void name at { CallORD(void,o,at,args); } -/* These functions return false on error, and save the error info in $^E */ +/* This function returns error code on error, and saves the error info in $^E and Perl_rc */ +#define DeclOSFuncByORD_native(ret,name,o,at,args) \ + ret name at { unsigned long rc; return CheckOSError(CallORD(ret,o,at,args)); } + +/* These functions return false on error, and save the error info in $^E and Perl_rc */ #define DeclOSFuncByORD(ret,name,o,at,args) \ ret name at { unsigned long rc; return !CheckOSError(CallORD(ret,o,at,args)); } #define DeclWinFuncByORD(ret,name,o,at,args) \