jwoolley 2002/07/15 22:22:26
Modified: include apr_inherit.h
include/arch/unix inherit.h
include/arch/win32 inherit.h
Log:
Fix the parameter name in the inherit_set/unset functions so that
it avoids shadowing global symbols (as with "socket").
Reported by: Karl Fogel
PS: I'm sure somebody will tell me if I horribly broke win32. :)
Revision Changes Path
1.12 +4 -2 apr/include/apr_inherit.h
Index: apr_inherit.h
===================================================================
RCS file: /home/cvs/apr/include/apr_inherit.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -u -r1.11 -r1.12
--- apr_inherit.h 5 Jul 2002 17:58:10 -0000 1.11
+++ apr_inherit.h 16 Jul 2002 05:22:17 -0000 1.12
@@ -75,13 +75,15 @@
* @param name Set Inheritance for this Socket/File Handle
*/
#define APR_DECLARE_INHERIT_SET(name) \
- APR_DECLARE(apr_status_t) apr_##name##_inherit_set(apr_##name##_t *name)
+ APR_DECLARE(apr_status_t) apr_##name##_inherit_set( \
+ apr_##name##_t *the##name)
/**
* @param name Unset Inheritance for this Socket/File Handle
*/
#define APR_DECLARE_INHERIT_UNSET(name) \
- APR_DECLARE(apr_status_t) apr_##name##_inherit_unset(apr_##name##_t
*name)
+ APR_DECLARE(apr_status_t) apr_##name##_inherit_unset( \
+ apr_##name##_t *the##name)
#ifdef __cplusplus
}
1.12 +14 -12 apr/include/arch/unix/inherit.h
Index: inherit.h
===================================================================
RCS file: /home/cvs/apr/include/arch/unix/inherit.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -u -r1.11 -r1.12
--- inherit.h 5 Jul 2002 17:58:10 -0000 1.11
+++ inherit.h 16 Jul 2002 05:22:19 -0000 1.12
@@ -60,35 +60,37 @@
#define APR_INHERIT (1 << 24) /* Must not conflict with other bits */
#define APR_IMPLEMENT_INHERIT_SET(name, flag, pool, cleanup) \
-apr_status_t apr_##name##_inherit_set(apr_##name##_t *name) \
+apr_status_t apr_##name##_inherit_set(apr_##name##_t *the##name) \
{ \
- if (!(name->flag & APR_INHERIT)) { \
- name->flag |= APR_INHERIT; \
- apr_pool_child_cleanup_set(name->pool, (void *)name, \
+ if (!(the##name->flag & APR_INHERIT)) { \
+ the##name->flag |= APR_INHERIT; \
+ apr_pool_child_cleanup_set(the##name->pool, \
+ (void *)the##name, \
cleanup, apr_pool_cleanup_null); \
} \
return APR_SUCCESS; \
} \
/* Deprecated */ \
-void apr_##name##_set_inherit(apr_##name##_t *name) \
+void apr_##name##_set_inherit(apr_##name##_t *the##name) \
{ \
- apr_##name##_inherit_set(name); \
+ apr_##name##_inherit_set(the##name); \
}
#define APR_IMPLEMENT_INHERIT_UNSET(name, flag, pool, cleanup) \
-apr_status_t apr_##name##_inherit_unset(apr_##name##_t *name) \
+apr_status_t apr_##name##_inherit_unset(apr_##name##_t *the##name) \
{ \
- if (name->flag & APR_INHERIT) { \
- name->flag &= ~APR_INHERIT; \
- apr_pool_child_cleanup_set(name->pool, (void *)name, \
+ if (the##name->flag & APR_INHERIT) { \
+ the##name->flag &= ~APR_INHERIT; \
+ apr_pool_child_cleanup_set(the##name->pool, \
+ (void *)the##name, \
cleanup, cleanup); \
} \
return APR_SUCCESS; \
} \
/* Deprecated */ \
-void apr_##name##_unset_inherit(apr_##name##_t *name) \
+void apr_##name##_unset_inherit(apr_##name##_t *the##name) \
{ \
- apr_##name##_inherit_unset(name); \
+ apr_##name##_inherit_unset(the##name); \
}
#endif /* ! INHERIT_H */
1.5 +14 -14 apr/include/arch/win32/inherit.h
Index: inherit.h
===================================================================
RCS file: /home/cvs/apr/include/arch/win32/inherit.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -u -r1.4 -r1.5
--- inherit.h 5 Jul 2002 17:58:10 -0000 1.4
+++ inherit.h 16 Jul 2002 05:22:26 -0000 1.5
@@ -60,11 +60,11 @@
#define APR_INHERIT (1 << 24) /* Must not conflict with other bits */
#define APR_IMPLEMENT_INHERIT_SET(name, flag, pool, cleanup) \
-APR_DECLARE(apr_status_t) apr_##name##_inherit_set(apr_##name##_t *name) \
+APR_DECLARE(apr_status_t) apr_##name##_inherit_set(apr_##name##_t
*the##name) \
{ \
IF_WIN_OS_IS_UNICODE \
{ \
- if (!SetHandleInformation(name->filehand, \
+ if (!SetHandleInformation(the##name->filehand, \
HANDLE_FLAG_INHERIT, \
HANDLE_FLAG_INHERIT)) \
return apr_get_os_error(); \
@@ -72,46 +72,46 @@
ELSE_WIN_OS_IS_ANSI \
{ \
HANDLE temp, hproc = GetCurrentProcess(); \
- if (!DuplicateHandle(hproc, name->filehand, \
+ if (!DuplicateHandle(hproc, the##name->filehand, \
hproc, &temp, 0, TRUE, \
DUPLICATE_SAME_ACCESS)) \
return apr_get_os_error(); \
- CloseHandle(name->filehand); \
- name->filehand = temp; \
+ CloseHandle(the##name->filehand); \
+ the##name->filehand = temp; \
} \
return APR_SUCCESS; \
} \
/* Deprecated */ \
-APR_DECLARE(void) apr_##name##_set_inherit(apr_##name##_t *name) \
+APR_DECLARE(void) apr_##name##_set_inherit(apr_##name##_t *the##name) \
{ \
- apr_##name##_inherit_set(name); \
+ apr_##name##_inherit_set(the##name); \
}
#define APR_IMPLEMENT_INHERIT_UNSET(name, flag, pool, cleanup) \
-APR_DECLARE(apr_status_t) apr_##name##_inherit_unset(apr_##name##_t *name) \
+APR_DECLARE(apr_status_t) apr_##name##_inherit_unset(apr_##name##_t
*the##name)\
{ \
IF_WIN_OS_IS_UNICODE \
{ \
- if (!SetHandleInformation(name->filehand, \
+ if (!SetHandleInformation(the##name->filehand, \
HANDLE_FLAG_INHERIT, 0)) \
return apr_get_os_error(); \
} \
ELSE_WIN_OS_IS_ANSI \
{ \
HANDLE temp, hproc = GetCurrentProcess(); \
- if (!DuplicateHandle(hproc, name->filehand, \
+ if (!DuplicateHandle(hproc, the##name->filehand, \
hproc, &temp, 0, FALSE, \
DUPLICATE_SAME_ACCESS)) \
return apr_get_os_error(); \
- CloseHandle(name->filehand); \
- name->filehand = temp; \
+ CloseHandle(the##name->filehand); \
+ the##name->filehand = temp; \
} \
return APR_SUCCESS; \
} \
/* Deprecated */ \
-APR_DECLARE(void) apr_##name##_unset_inherit(apr_##name##_t *name) \
+APR_DECLARE(void) apr_##name##_unset_inherit(apr_##name##_t *the##name) \
{ \
- apr_##name##_inherit_unset(name); \
+ apr_##name##_inherit_unset(the##name); \
}
#endif /* ! INHERIT_H */