diff options
author | trawick <trawick@13f79535-47bb-0310-9956-ffa450edef68> | 2011-03-22 19:32:14 +0000 |
---|---|---|
committer | trawick <trawick@13f79535-47bb-0310-9956-ffa450edef68> | 2011-03-22 19:32:14 +0000 |
commit | 00d700439f04b7d608065d6d2719238ff2f10730 (patch) | |
tree | 617a90dd33feaad21cc2223e9a6bfc1261c28dcc | |
parent | 8eccb00c74cb8e0d5da2426458b4ca092c84aa4e (diff) | |
download | libapr-00d700439f04b7d608065d6d2719238ff2f10730.tar.gz |
grab some Windows/MinGW code tweaks from trunk for quieter gcc builds
time/win32/timestr.c: all of r892188
include/arch/win32/apr_arch_file_io.h: part of r892386
misc/win32/rand.c: all of r892426
misc/win32/misc.c: part of r892177
misc/win32/internal.c: all of r892390
poll/unix/pollset.c: part of r892386
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/branches/1.5.x@1084310 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | include/arch/win32/apr_arch_file_io.h | 8 | ||||
-rw-r--r-- | misc/win32/internal.c | 2 | ||||
-rw-r--r-- | misc/win32/misc.c | 13 | ||||
-rw-r--r-- | misc/win32/rand.c | 1 | ||||
-rw-r--r-- | poll/unix/pollset.c | 8 | ||||
-rw-r--r-- | time/win32/timestr.c | 4 |
6 files changed, 22 insertions, 14 deletions
diff --git a/include/arch/win32/apr_arch_file_io.h b/include/arch/win32/apr_arch_file_io.h index 6afaf8fb1..38efa2774 100644 --- a/include/arch/win32/apr_arch_file_io.h +++ b/include/arch/win32/apr_arch_file_io.h @@ -252,4 +252,12 @@ apr_status_t filepath_root_case(char **rootpath, char *root, apr_pool_t *p); apr_status_t file_cleanup(void *); +extern apr_status_t +apr_file_socket_pipe_create(apr_file_t **in, + apr_file_t **out, + apr_pool_t *p); + +extern apr_status_t +apr_file_socket_pipe_close(apr_file_t *file); + #endif /* ! FILE_IO_H */ diff --git a/misc/win32/internal.c b/misc/win32/internal.c index edd7f0a0e..03362cf59 100644 --- a/misc/win32/internal.c +++ b/misc/win32/internal.c @@ -96,6 +96,6 @@ int apr_wastrtoastr(char const * const * *retarr, } } - *retarr = newarr; + *retarr = (char const * const *)newarr; return args; } diff --git a/misc/win32/misc.c b/misc/win32/misc.c index a95a22190..8c3cb916c 100644 --- a/misc/win32/misc.c +++ b/misc/win32/misc.c @@ -17,6 +17,7 @@ #include "apr_private.h" #include "apr_arch_misc.h" #include "apr_arch_file_io.h" +#include "apr_dbg_win32_handles.h" #include "assert.h" #include "apr_lib.h" #include "tchar.h" @@ -35,7 +36,7 @@ apr_status_t apr_get_oslevel(apr_oslevel_e *level) { static unsigned int servpack = 0; TCHAR *pservpack; - if (pservpack = oslev.szCSDVersion) { + if ((pservpack = oslev.szCSDVersion)) { while (*pservpack && !apr_isdigit(*pservpack)) { pservpack++; } @@ -213,8 +214,8 @@ APR_DECLARE_NONSTD(HANDLE) apr_dbg_log(char* fn, HANDLE ha, char* fl, int ln, sbuf[1023] = '\0'; if (!fh) { (GetModuleFileNameA)(NULL, sbuf, 250); - sprintf(strchr(sbuf, '\0'), ".%d", - (GetCurrentProcessId)()); + sprintf(strchr(sbuf, '\0'), ".%u", + (unsigned int)(GetCurrentProcessId)()); fh = (CreateFileA)(sbuf, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL); (InitializeCriticalSection)(&cs); @@ -223,7 +224,8 @@ APR_DECLARE_NONSTD(HANDLE) apr_dbg_log(char* fn, HANDLE ha, char* fl, int ln, if (!nh) { (sprintf)(sbuf, "%p %08x %08x %s() %s:%d\n", - ha, seq, GetCurrentThreadId(), fn, fl, ln); + ha, (unsigned int)seq, (unsigned int)GetCurrentThreadId(), + fn, fl, ln); (EnterCriticalSection)(&cs); (WriteFile)(fh, sbuf, (DWORD)strlen(sbuf), &wrote, NULL); (LeaveCriticalSection)(&cs); @@ -250,7 +252,8 @@ APR_DECLARE_NONSTD(HANDLE) apr_dbg_log(char* fn, HANDLE ha, char* fl, int ln, } } (sprintf)(sbuf, "%p %08x %08x %s(%s) %s:%d\n", - *hv, seq, GetCurrentThreadId(), + *hv, (unsigned int)seq, + (unsigned int)GetCurrentThreadId(), fn, dsc, fl, ln); (WriteFile)(fh, sbuf, (DWORD)strlen(sbuf), &wrote, NULL); } while (--nh); diff --git a/misc/win32/rand.c b/misc/win32/rand.c index 7161bfbbd..cb5a6537f 100644 --- a/misc/win32/rand.c +++ b/misc/win32/rand.c @@ -15,6 +15,7 @@ */ #include "apr.h" +#include <rpc.h> #include <wincrypt.h> #include "apr_private.h" #include "apr_general.h" diff --git a/poll/unix/pollset.c b/poll/unix/pollset.c index d9fb2d460..1a7396b4b 100644 --- a/poll/unix/pollset.c +++ b/poll/unix/pollset.c @@ -33,14 +33,6 @@ static apr_pollset_method_e pollset_default_method = POLLSET_DEFAULT_METHOD; #if !APR_FILES_AS_SOCKETS #if defined (WIN32) -extern apr_status_t -apr_file_socket_pipe_create(apr_file_t **in, - apr_file_t **out, - apr_pool_t *p); - -extern apr_status_t -apr_file_socket_pipe_close(apr_file_t *file); - /* Create a dummy wakeup socket pipe for interrupting the poller */ static apr_status_t create_wakeup_pipe(apr_pollset_t *pollset) diff --git a/time/win32/timestr.c b/time/win32/timestr.c index fc9130bc6..138412352 100644 --- a/time/win32/timestr.c +++ b/time/win32/timestr.c @@ -18,6 +18,10 @@ #include "apr_portable.h" #include "apr_strings.h" +#if APR_HAVE_STDLIB_H +#include <stdlib.h> +#endif + APR_DECLARE_DATA const char apr_month_snames[12][4] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" |