apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject svn commit: r649366 - in /apr/apr/branches/1.3.x: include/arch/win32/apr_arch_misc.h misc/win32/misc.c
Date Fri, 18 Apr 2008 05:11:49 GMT
Author: mturk
Date: Thu Apr 17 22:11:42 2008
New Revision: 649366

URL: http://svn.apache.org/viewvc?rev=649366&view=rev
Log:
Apply trunk patches r648601, r649000 and r649173 (fixing WIN64 compile time warnings)

Modified:
    apr/apr/branches/1.3.x/include/arch/win32/apr_arch_misc.h
    apr/apr/branches/1.3.x/misc/win32/misc.c

Modified: apr/apr/branches/1.3.x/include/arch/win32/apr_arch_misc.h
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.3.x/include/arch/win32/apr_arch_misc.h?rev=649366&r1=649365&r2=649366&view=diff
==============================================================================
--- apr/apr/branches/1.3.x/include/arch/win32/apr_arch_misc.h (original)
+++ apr/apr/branches/1.3.x/include/arch/win32/apr_arch_misc.h Thu Apr 17 22:11:42 2008
@@ -182,7 +182,9 @@
 
 FARPROC apr_load_dll_func(apr_dlltoken_e fnLib, char *fnName, int ordinal);
 
-/* The apr_load_dll_func call WILL fault if the function cannot be loaded */
+/* The apr_load_dll_func call WILL return 0 set error to
+ * ERROR_INVALID_FUNCTION if the function cannot be loaded
+ */
 
 #define APR_DECLARE_LATE_DLL_FUNC(lib, rettype, calltype, fn, ord, args, names) \
     typedef rettype (calltype *apr_winapi_fpt_##fn) args; \
@@ -191,7 +193,9 @@
     {   if (!apr_winapi_pfn_##fn) \
             apr_winapi_pfn_##fn = (apr_winapi_fpt_##fn) \
                                       apr_load_dll_func(lib, #fn, ord); \
-        return (*(apr_winapi_pfn_##fn)) names; }; \
+        if (apr_winapi_pfn_##fn) \
+            return (*(apr_winapi_pfn_##fn)) names; \
+        else { SetLastError(ERROR_INVALID_FUNCTION); return 0;} }; \
 
 /* Provide late bound declarations of every API function missing from
  * one or more supported releases of the Win32 API
@@ -334,14 +338,14 @@
 #define GetCompressedFileSizeW apr_winapi_GetCompressedFileSizeW
 
 
-APR_DECLARE_LATE_DLL_FUNC(DLL_NTDLL, DWORD, WINAPI, NtQueryTimerResolution, 0, (
+APR_DECLARE_LATE_DLL_FUNC(DLL_NTDLL, LONG, WINAPI, NtQueryTimerResolution, 0, (
     ULONG *pMaxRes,  /* Minimum NS Resolution */
     ULONG *pMinRes,  /* Maximum NS Resolution */
     ULONG *pCurRes), /* Current NS Resolution */
     (pMaxRes, pMinRes, pCurRes));
 #define QueryTimerResolution apr_winapi_NtQueryTimerResolution
 
-APR_DECLARE_LATE_DLL_FUNC(DLL_NTDLL, DWORD, WINAPI, NtSetTimerResolution, 0, (
+APR_DECLARE_LATE_DLL_FUNC(DLL_NTDLL, LONG, WINAPI, NtSetTimerResolution, 0, (
     ULONG ReqRes,    /* Requested NS Clock Resolution */
     BOOL  Acquire,   /* Aquire (1) or Release (0) our interest */
     ULONG *pNewRes), /* The NS Clock Resolution granted */
@@ -357,7 +361,7 @@
     ULONG_PTR InheritedFromUniqueProcessId;
 } PBI, *PPBI;
 
-APR_DECLARE_LATE_DLL_FUNC(DLL_NTDLL, DWORD, WINAPI, NtQueryInformationProcess, 0, (
+APR_DECLARE_LATE_DLL_FUNC(DLL_NTDLL, LONG, WINAPI, NtQueryInformationProcess, 0, (
     HANDLE hProcess,  /* Obvious */
     INT   info,       /* Use 0 for PBI documented above */
     PVOID pPI,        /* The PIB buffer */
@@ -366,7 +370,7 @@
     (hProcess, info, pPI, LenPI, pSizePI));
 #define QueryInformationProcess apr_winapi_NtQueryInformationProcess
 
-APR_DECLARE_LATE_DLL_FUNC(DLL_NTDLL, DWORD, WINAPI, NtQueryObject, 0, (
+APR_DECLARE_LATE_DLL_FUNC(DLL_NTDLL, LONG, WINAPI, NtQueryObject, 0, (
     HANDLE hObject,   /* Obvious */
     INT   info,       /* Use 0 for PBI documented above */
     PVOID pOI,        /* The PIB buffer */

Modified: apr/apr/branches/1.3.x/misc/win32/misc.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.3.x/misc/win32/misc.c?rev=649366&r1=649365&r2=649366&view=diff
==============================================================================
--- apr/apr/branches/1.3.x/misc/win32/misc.c (original)
+++ apr/apr/branches/1.3.x/misc/win32/misc.c Thu Apr 17 22:11:42 2008
@@ -174,12 +174,14 @@
     }
 #if defined(_WIN32_WCE)
     if (ordinal)
-        return GetProcAddressA(lateDllHandle[fnLib], (char *) ordinal);
+        return GetProcAddressA(lateDllHandle[fnLib], (const char *)
+                                                     (apr_ssize_t)ordinal);
     else
         return GetProcAddressA(lateDllHandle[fnLib], fnName);
 #else
     if (ordinal)
-        return GetProcAddress(lateDllHandle[fnLib], (char *) ordinal);
+        return GetProcAddress(lateDllHandle[fnLib], (const char *)
+                                                    (apr_ssize_t)ordinal);
     else
         return GetProcAddress(lateDllHandle[fnLib], fnName);
 #endif
@@ -220,8 +222,8 @@
     }
 
     if (!nh) {
-        (sprintf)(sbuf, "%08x %08x %08x %s() %s:%d\n",
-                  (DWORD)ha, seq, GetCurrentThreadId(), fn, fl, ln);
+        (sprintf)(sbuf, "%p %08x %08x %s() %s:%d\n",
+                  ha, seq, GetCurrentThreadId(), fn, fl, ln);
         (EnterCriticalSection)(&cs);
         (WriteFile)(fh, sbuf, (DWORD)strlen(sbuf), &wrote, NULL);
         (LeaveCriticalSection)(&cs);
@@ -234,21 +236,21 @@
             HANDLE *hv = va_arg(a, HANDLE*);
             char *dsc = va_arg(a, char*);
             if (strcmp(dsc, "Signaled") == 0) {
-                if ((DWORD)ha >= STATUS_WAIT_0 
-                       && (DWORD)ha < STATUS_ABANDONED_WAIT_0) {
-                    hv += (DWORD)ha;
+                if ((apr_ssize_t)ha >= STATUS_WAIT_0 
+                       && (apr_ssize_t)ha < STATUS_ABANDONED_WAIT_0) {
+                    hv += (apr_ssize_t)ha;
                 }
-                else if ((DWORD)ha >= STATUS_ABANDONED_WAIT_0
-                            && (DWORD)ha < STATUS_USER_APC) {
-                    hv += (DWORD)ha - STATUS_ABANDONED_WAIT_0;
+                else if ((apr_ssize_t)ha >= STATUS_ABANDONED_WAIT_0
+                            && (apr_ssize_t)ha < STATUS_USER_APC) {
+                    hv += (apr_ssize_t)ha - STATUS_ABANDONED_WAIT_0;
                     dsc = "Abandoned";
                 }
-                else if ((DWORD)ha == WAIT_TIMEOUT) {
+                else if ((apr_ssize_t)ha == WAIT_TIMEOUT) {
                     dsc = "Timed Out";
                 }
             }
-            (sprintf)(sbuf, "%08x %08x %08x %s(%s) %s:%d\n",
-                      (DWORD*)*hv, seq, GetCurrentThreadId(), 
+            (sprintf)(sbuf, "%p %08x %08x %s(%s) %s:%d\n",
+                      *hv, seq, GetCurrentThreadId(), 
                       fn, dsc, fl, ln);
             (WriteFile)(fh, sbuf, (DWORD)strlen(sbuf), &wrote, NULL);
         } while (--nh);



Mime
View raw message