summaryrefslogtreecommitdiff
path: root/shmem
diff options
context:
space:
mode:
authorWilliam A. Rowe Jr <wrowe@apache.org>2005-06-18 18:19:59 +0000
committerWilliam A. Rowe Jr <wrowe@apache.org>2005-06-18 18:19:59 +0000
commit899af5c254a2268f27bd1769e98371f77990899a (patch)
tree71b6d3a4a1a0f62696dec42c15c4eea062747e3b /shmem
parentd0d8fe5a3c3f6f3632c3097d72891480fc37002a (diff)
downloadapr-899af5c254a2268f27bd1769e98371f77990899a.tar.gz
Fatal compiler quirk, you would think (DWORD)(n >> 32) == 0
if n is a DWORD. But, alas, in release builds it doesn't. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@191306 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'shmem')
-rw-r--r--shmem/win32/shm.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/shmem/win32/shm.c b/shmem/win32/shm.c
index 32c952e0a..1c9bca9b2 100644
--- a/shmem/win32/shm.c
+++ b/shmem/win32/shm.c
@@ -19,6 +19,7 @@
#include "apr_file_io.h"
#include "apr_shm.h"
#include "apr_arch_file_io.h"
+#include "limits.h"
typedef struct memblock_t {
apr_size_t size;
@@ -63,7 +64,7 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m,
apr_file_t *f;
void *base;
void *mapkey;
- DWORD err;
+ DWORD err, sizelo, sizehi;
reqsize += sizeof(memblock_t);
@@ -76,6 +77,12 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m,
/* Compute the granualar multiple of the pagesize */
size = memblock * (1 + (reqsize - 1) / memblock);
+ sizelo = (DWORD)size;
+#ifdef WIN64
+ sizehi = (DWORD)(size >> 32);
+#else
+ sizehi = 0;
+#endif
if (!file) {
/* Do Anonymous, which must be passed as a duplicated handle */
@@ -109,8 +116,6 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m,
#if APR_HAS_UNICODE_FS
IF_WIN_OS_IS_UNICODE
{
- DWORD sizelo = (DWORD)size;
- DWORD sizehi = (DWORD)(size >> 32);
hMap = CreateFileMappingW(hFile, NULL, PAGE_READWRITE,
sizehi, sizelo, mapkey);
}
@@ -118,8 +123,6 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m,
#if APR_HAS_ANSI_FS
ELSE_WIN_OS_IS_ANSI
{
- DWORD sizelo = (DWORD)size;
- DWORD sizehi = (DWORD)(size >> 32);
hMap = CreateFileMappingA(hFile, NULL, PAGE_READWRITE,
sizehi, sizelo, mapkey);
}