jwoolley 01/06/05 17:07:46
Modified: . apr.dsp libapr.dsp
include apr.hw
include/arch/win32 apr_private.h locks.h
locks/win32 locks.c
Log:
(Attempt to) fix the build on Win32 from the sms-ified locks that David
checked in earlier. This patch has a few things I don't quite like (eg,
the macros are duplicated across the Unix/Win32 apr_private.h files), but
Greg has asked for an on-list discussion of David's original patch anyway,
so this is just a quick hack to try to get things working again in the
meanwhile.
Unfortunately, DOS line endings are killing me and so I can't actually test
this (MSVC won't grok .dsp files that were checked out with Unix line endings,
apparently, and I don't have Win32 CVS tools handy... sheesh), so I'll have
to lean on you Win32 guys to make sure this gets us building again. At least
it still builds on Unix and *looks* reasonable for Win32, meaning that this
patch can't have made us worse off than before. ;-)
Submitted by: Ian Holsman <[EMAIL PROTECTED]>
Revision Changes Path
1.72 +17 -1 apr/apr.dsp
Index: apr.dsp
===================================================================
RCS file: /home/cvs/apr/apr.dsp,v
retrieving revision 1.71
retrieving revision 1.72
diff -u -d -u -r1.71 -r1.72
--- apr.dsp 2001/05/23 14:15:31 1.71
+++ apr.dsp 2001/06/06 00:07:45 1.72
@@ -65,7 +65,7 @@
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MDd /W3 /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D
"_WINDOWS" /FD /c
-# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "./include" /I "./include/arch" /I
"./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D
"APR_DECLARE_STATIC" /D "WIN32" /D "_WINDOWS" /Fd"LibD\apr" /FD /c
+# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "./include" /I "./include/arch" /I
"./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D
"APR_DECLARE_STATIC" /D "WIN32" /D "_WINDOWS" /FR /Fd"LibD\apr" /FD /c
# ADD BASE RSC /l 0x409
# ADD RSC /l 0x409
BSC32=bscmake.exe
@@ -401,6 +401,22 @@
# Begin Source File
SOURCE=.\user\win32\userinfo.c
+# End Source File
+# End Group
+# Begin Group "memory"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\memory\unix\apr_sms.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\memory\unix\apr_sms_std.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\memory\unix\apr_sms_tracking.c
# End Source File
# End Group
# End Group
1.31 +16 -0 apr/libapr.dsp
Index: libapr.dsp
===================================================================
RCS file: /home/cvs/apr/libapr.dsp,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -d -u -r1.30 -r1.31
--- libapr.dsp 2001/05/23 14:15:29 1.30
+++ libapr.dsp 2001/06/06 00:07:45 1.31
@@ -409,6 +409,22 @@
SOURCE=.\user\win32\userinfo.c
# End Source File
# End Group
+# Begin Group "memory"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\memory\unix\apr_sms.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\memory\unix\apr_sms_std.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\memory\unix\apr_sms_tracking.c
+# End Source File
+# End Group
# End Group
# Begin Group "Generated Header Files"
1.67 +2 -0 apr/include/apr.hw
Index: apr.hw
===================================================================
RCS file: /home/cvs/apr/include/apr.hw,v
retrieving revision 1.66
retrieving revision 1.67
diff -u -d -u -r1.66 -r1.67
--- apr.hw 2001/05/17 12:19:56 1.66
+++ apr.hw 2001/06/06 00:07:45 1.67
@@ -235,6 +235,8 @@
typedef int gid_t;
+typedef struct apr_lock_t apr_lock_t;
+typedef struct apr_sms_t apr_sms_t;
/* Mechanisms to properly type numeric literals */
#define APR_INT64_C(val) (val##i64)
1.24 +41 -0 apr/include/arch/win32/apr_private.h
Index: apr_private.h
===================================================================
RCS file: /home/cvs/apr/include/arch/win32/apr_private.h,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -u -r1.23 -r1.24
--- apr_private.h 2001/05/10 18:11:12 1.23
+++ apr_private.h 2001/06/06 00:07:46 1.24
@@ -149,6 +149,47 @@
unsigned __stdcall SignalHandling(void *);
int thread_ready(void);
+/* Macros to deal with using either a pool or an sms
+ * to do memory stuff...
+ */
+#define APR_CLEANUP_REGISTER(struct, data, func, scope) \
+ if (struct->pool) { \
+ apr_pool_cleanup_register(struct->pool, data, func, scope); \
+ } else { \
+ apr_sms_cleanup_register(struct->mem_sys, APR_CHILD_CLEANUP, \
+ data, func); \
+ }
+
+#define APR_CLEANUP_REMOVE(struct, data, func) \
+ if (struct->pool) { \
+ apr_pool_cleanup_kill(struct->pool, data, func); \
+ } else { \
+ apr_sms_cleanup_unregister(struct->mem_sys, APR_CHILD_CLEANUP, \
+ data, func); \
+ }
+
+#define APR_MEM_PSTRDUP(struct, ptr, str) \
+ if (struct->pool) { \
+ ptr = apr_pstrdup(struct->pool, str); \
+ } else { \
+ size_t len = strlen(str) + 1; \
+ ptr = (char*) apr_sms_calloc(struct->mem_sys, len); \
+ memcpy(ptr, str, len); \
+ }
+
+#define APR_MEM_MALLOC(ptr, struct, type) \
+ if (struct->pool) { \
+ ptr = (type *)apr_palloc(struct->pool, sizeof(type)); \
+ } else { \
+ ptr = (type *)apr_sms_malloc(struct->mem_sys, sizeof(type)); \
+ }
+
+#define APR_MEM_CALLOC(ptr, struct, type) \
+ if (struct->pool) { \
+ ptr = (type *)apr_pcalloc(struct->pool, sizeof(type)); \
+ } else { \
+ ptr = (type *)apr_sms_calloc(struct->mem_sys, sizeof(type)); \
+ }
#endif /*APR_PRIVATE_H*/
#endif /*WIN32*/
1.11 +1 -1 apr/include/arch/win32/locks.h
Index: locks.h
===================================================================
RCS file: /home/cvs/apr/include/arch/win32/locks.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -u -r1.10 -r1.11
--- locks.h 2001/06/05 13:22:23 1.10
+++ locks.h 2001/06/06 00:07:46 1.11
@@ -68,7 +68,7 @@
char *fname;
};
-apr_status_t apr_lock_sms_create(apr_lock_t **lock, apr_locktype_e type,
+APR_DECLARE(apr_status_t) apr_lock_sms_create(apr_lock_t **lock,
apr_locktype_e type,
apr_lockscope_e scope, const char *fname,
apr_sms_t *mem_sys);
1.41 +2 -1 apr/locks/win32/locks.c
Index: locks.c
===================================================================
RCS file: /home/cvs/apr/locks/win32/locks.c,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -d -u -r1.40 -r1.41
--- locks.c 2001/06/05 13:22:50 1.40
+++ locks.c 2001/06/06 00:07:46 1.41
@@ -51,7 +51,8 @@
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
-
+#include "apr.h"
+#include "apr_private.h"
#include "apr_general.h"
#include "apr_strings.h"
#include "win32/locks.h"