Subject: | [PATCH] Compilation error |
Date: | Wed, 5 Dec 2007 15:15:25 +0100 |
To: | bug-Cache-FastMmap [...] rt.cpan.org |
From: | Paul Johnson <paul [...] pjcj.net> |
This patch is required for compilation on Solaris 8 with Sun WorkShop 6
update 2 C 5.3 and probably other compilers which are not as lenient as
gcc:
--- mmap_cache.c.org 2007-10-17 05:05:33.000000000 +0200
+++ mmap_cache.c 2007-12-05 14:36:39.668436000 +0100
@@ -673,10 +673,11 @@
if (cache->p_free_bytes >= kvlen) {
MU32 * base_det = PTR_ADD(cache->p_base, cache->p_free_data);
MU32 now = (MU32)time(0);
+ MU32 expire_time;
/* Calculate expiry time */
if (expire_seconds == (MU32)-1) expire_seconds = cache->expire_time;
- MU32 expire_time = expire_seconds ? now + expire_seconds : 0;
+ expire_time = expire_seconds ? now + expire_seconds : 0;
/* Store info into slot */
S_LastAccess(base_det) = now;
--
Paul Johnson - paul@pjcj.net
http://www.pjcj.net