Attached patch avoids the only remaining argument to moving the typedef
over to apr.h, that a developer would trip over a module authored to apr 1.2.12
and discover it won't compile on apr 1.2.0.
Of course apr_* is our namespace, so a developer using such symbols is already
rolling the dice.
Example patch attached.
Simple test case;
#include <apr.h>
#include <apr_general.h>
int main(int argc, const char * const * argv, const char * const *env)
{
apr_ino_t dont_do_this;
}
Results in
/bin/sh /local0/asf/build/apr-1.2/libtool --silent --mode=compile gcc -g -O2 -pthread -DHAVE_CONFIG_H -DLINUX=2 -D_REENTRANT
-D_GNU_SOURCE -D_LARGEFILE64_SOURCE -I../include -I./../include -o testapp.lo -c testapp.c && touch testapp.lo
testapp.c: In function 'main':
testapp.c:6: error: 'apr_unknown_apr_ino_t__must_include_apr_file_io_h'
undeclared (first use in this function)
testapp.c:6: error: (Each undeclared identifier is reported only once
testapp.c:6: error: for each function it appears in.)
testapp.c:6: error: expected ';' before 'dont_do_this'
I really think that would be sufficient to enforce our versioning policy, no?
Bill
Index: include/apr.h.in
===================================================================
--- include/apr.h.in (revision 584469)
+++ include/apr.h.in (working copy)
@@ -273,6 +273,12 @@
typedef @off_t_value@ apr_off_t;
typedef @socklen_t_value@ apr_socklen_t;
+typedef @ino_t_value@ apr_ino_t;
+/* Because users can't count on apr_ino_t here for the duration of 1.2.x,
+ * we'll #define it out, until they've included apr_file_info.h
+ */
+#define apr_ino_t apr_unknown_apr_ino_t__must_include_apr_file_io_h
+
#define APR_SIZEOF_VOIDP @voidp_size@
/* Are we big endian? */
Index: include/apr.hw
===================================================================
--- include/apr.hw (revision 584469)
+++ include/apr.hw (working copy)
@@ -346,6 +346,12 @@
#endif
typedef int apr_socklen_t;
+typedef apr_uint64_t apr_ino_t;
+/* Because users can't count on apr_ino_t here for the duration of 1.2.x,
+ * we'll #define it out, until they've included apr_file_info.h
+ */
+#define apr_ino_t apr_unknown_apr_ino_t__must_include_apr_file_io_h
+
/* Are we big endian? */
/* XXX: Fatal assumption on Alpha platforms */
#define APR_IS_BIGENDIAN 0
Index: include/apr.hnw
===================================================================
--- include/apr.hnw (revision 584469)
+++ include/apr.hnw (working copy)
@@ -256,6 +256,12 @@
typedef size_t apr_socklen_t;
#endif
+typedef apr_uint64_t apr_ino_t;
+/* Because users can't count on apr_ino_t here for the duration of 1.2.x,
+ * we'll #define it out, until they've included apr_file_info.h
+ */
+#define apr_ino_t apr_unknown_apr_ino_t__must_include_apr_file_io_h
+
/* Are we big endian? */
/* XXX: Fatal assumption on Alpha platforms */
#define APR_IS_BIGENDIAN 0
Index: include/apr_file_info.h
===================================================================
--- include/apr_file_info.h (revision 584469)
+++ include/apr_file_info.h (working copy)
@@ -114,6 +114,8 @@
/** @} */
+/* For APR 1.2.x, re-expose apr_ino_t once we arrive here, see apr.h.in */
+#undef apr_ino_t
/**
* Structure for referencing directories.
@@ -125,16 +127,10 @@
typedef apr_int32_t apr_fileperms_t;
#if (defined WIN32) || (defined NETWARE)
/**
- * Structure for determining the inode of the file.
- */
-typedef apr_uint64_t apr_ino_t;
-/**
* Structure for determining the device the file is on.
*/
typedef apr_uint32_t apr_dev_t;
#else
-/** The inode of the file. */
-typedef ino_t apr_ino_t;
/**
* Structure for determining the device the file is on.
*/