avoid negative return value from Win32::GetTickCount()
Jan Dubois [Sat, 3 Apr 1999 19:04:18 +0000 (21:04 +0200)]
Message-ID: <37084742.22824479@smtp1.ibm.net>
Subject: Re: Win32::GetTickCount

p4raw-id: //depot/perl@3316

win32/win32.c

index df28419..1848e9b 100644 (file)
@@ -2764,7 +2764,10 @@ XS(w32_GetTickCount)
 {
     dXSARGS;
     EXTEND(SP,1);
-    XSRETURN_IV(GetTickCount());
+    DWORD msec = GetTickCount();
+    if ((IV)msec > 0)
+       XSRETURN_IV(msec);
+    XSRETURN_NV(msec);
 }
 
 static