apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Huelsmann <ehu...@gmail.com>
Subject [PATCH] Don't define POSIX types {p,g,u}id_t
Date Tue, 26 Apr 2005 06:09:09 GMT
How about the patch below?

It could easily be backported, as it could be presented as fixing what
should not have been in APR headers.

bye,


Erik.


Log:
[[[
Eliminate {p,u,g}id_t from apr's public interface: it collides with
other software on
Windows, where sys/types.h doesn't provide it.

Note: This patch introduces apr_os_pid_t, for compatibility reasons: it's being
defined to exactly the same types pid_t was before, making them binary
compatible.
If binary compatability had not been a concern, I would have used apr_os_proc_t.

* include/apr.h.in: typedef apr_os_pid_t as pid_t.

* include/apr.hw: typedef apr_os_pid_t as int.

* include/apr.hnw: typedef apr_os_pid_t as pid_t.

* include/apr_thread_proc.h (apr_proc_t): Replace pid_t with apr_os_pid_t.
]]]


Index: include/apr.h.in
===================================================================
--- include/apr.h.in    (revision 164603)
+++ include/apr.h.in    (working copy)
@@ -269,6 +269,10 @@
 typedef  @off_t_value@           apr_off_t;
 typedef  @socklen_t_value@       apr_socklen_t;
  
+/** @deprecated Only here for compatibility reasons; use apr_os_proc_t
+ */
+typedef  pid_t                   apr_os_pid_t;
+
 #define APR_SIZEOF_VOIDP @voidp_size@
  
 /* Are we big endian? */
Index: include/apr_thread_proc.h
===================================================================
--- include/apr_thread_proc.h   (revision 164603)
+++ include/apr_thread_proc.h   (working copy)
@@ -121,7 +121,7 @@
 /** The APR process type */
 typedef struct apr_proc_t {
     /** The process ID */
-    pid_t pid;
+    apr_os_pid_t pid;
     /** Parent's side of pipe to child's stdin */
     apr_file_t *in;
     /** Parent's side of pipe to child's stdout */
Index: include/apr.hw
===================================================================
--- include/apr.hw      (revision 164603)
+++ include/apr.hw      (working copy)
@@ -345,12 +345,9 @@
 #define APR_SIZEOF_VOIDP   4
 #endif
  
-/* XXX These simply don't belong here, perhaps in apr_portable.h
- * based on some APR_HAVE_PID/GID/UID?
+/** @deprecated Only here for compatibility reasons; use apr_os_proc_t
  */
-typedef  int         pid_t;
-typedef  int         uid_t;
-typedef  int         gid_t;
+typedef  int         apr_os_pid_t;
  
 /* Mechanisms to properly type numeric literals */

Mime
View raw message