You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by wr...@apache.org on 2007/10/24 06:42:11 UTC

svn commit: r587780 - in /apr/apr/branches/1.2.x: CHANGES build/apr_common.m4 configure.in include/apr.h.in include/apr.hnw include/apr.hw include/apr_file_info.h

Author: wrowe
Date: Tue Oct 23 21:41:58 2007
New Revision: 587780

URL: http://svn.apache.org/viewvc?rev=587780&view=rev
Log:
Define apr_ino_t in such a way that it doesn't change definition
based on the library consumer's -D'efines to the filesystem.

Submitted by: Lucian Adrian Grijincu <lucian.grijincu gmail.com>
Backport: r587779

Modified:
    apr/apr/branches/1.2.x/CHANGES
    apr/apr/branches/1.2.x/build/apr_common.m4
    apr/apr/branches/1.2.x/configure.in
    apr/apr/branches/1.2.x/include/apr.h.in
    apr/apr/branches/1.2.x/include/apr.hnw
    apr/apr/branches/1.2.x/include/apr.hw
    apr/apr/branches/1.2.x/include/apr_file_info.h

Modified: apr/apr/branches/1.2.x/CHANGES
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.2.x/CHANGES?rev=587780&r1=587779&r2=587780&view=diff
==============================================================================
--- apr/apr/branches/1.2.x/CHANGES [utf-8] (original)
+++ apr/apr/branches/1.2.x/CHANGES [utf-8] Tue Oct 23 21:41:58 2007
@@ -1,5 +1,9 @@
-                                                     -*- coding: utf-8 -*-
+                                                     -*- coding: utf-8 -*-
 Changes for APR 1.2.12
+
+  *) Define apr_ino_t in such a way that it doesn't change definition
+     based on the library consumer's -D'efines to the filesystem.
+     [Lucian Adrian Grijincu <lucian.grijincu gmail.com>]
 
   *) Implement apr_atomic_casptr() for z/OS.
      [David Jones <oscaremma gmail.com>]

Modified: apr/apr/branches/1.2.x/build/apr_common.m4
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.2.x/build/apr_common.m4?rev=587780&r1=587779&r2=587780&view=diff
==============================================================================
--- apr/apr/branches/1.2.x/build/apr_common.m4 (original)
+++ apr/apr/branches/1.2.x/build/apr_common.m4 Tue Oct 23 21:41:58 2007
@@ -959,3 +959,18 @@
 
 AC_SUBST(MKDEP)
 ])
+
+dnl
+dnl APR_CHECK_TYPES_COMPATIBLE(TYPE-1, TYPE-2, [ACTION-IF-TRUE])
+dnl
+dnl Try to determine whether two types are the same. Only works
+dnl for gcc and icc.
+dnl
+AC_DEFUN([APR_CHECK_TYPES_COMPATIBLE], [
+define([apr_cvname], apr_cv_typematch_[]translit([$1], [ ], [_])_[]translit([$2], [ ], [_]))
+AC_CACHE_CHECK([whether $1 and $2 are the same], apr_cvname, [
+AC_TRY_COMPILE(AC_INCLUDES_DEFAULT, [
+    int foo[0 - !__builtin_types_compatible_p($1, $2)];
+], [apr_cvname=yes $3], [apr_cvname=no])])
+])
+

Modified: apr/apr/branches/1.2.x/configure.in
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.2.x/configure.in?rev=587780&r1=587779&r2=587780&view=diff
==============================================================================
--- apr/apr/branches/1.2.x/configure.in (original)
+++ apr/apr/branches/1.2.x/configure.in Tue Oct 23 21:41:58 2007
@@ -470,6 +470,14 @@
    if test "$apr_cv_use_lfs64" = "yes"; then
       APR_ADDTO(CPPFLAGS, [-D_LARGEFILE64_SOURCE])
    fi
+
+
+   dnl define apr_ino_t in a manner independent of _FILE_OFFSET_BITS setting
+   dnl default fallback
+   ino_t_value=ino_t
+   APR_CHECK_TYPES_COMPATIBLE(ino_t, unsigned long long, ino_t_value="unsigned long long")
+   APR_CHECK_TYPES_COMPATIBLE(ino_t, unsigned long, ino_t_value="unsigned long")
+   APR_CHECK_TYPES_COMPATIBLE(ino_t, unsigned int, ino_t_value="unsigned int")
 fi
 
 AC_ARG_ENABLE(nonportable-atomics,
@@ -1380,6 +1388,7 @@
 AC_SUBST(stdint) 
 AC_SUBST(bigendian)
 AC_SUBST(aprlfs)
+AC_SUBST(ino_t_value)
 
 dnl ----------------------------- Checking for string functions
 AC_CHECK_FUNCS(strnicmp, have_strnicmp="1", have_strnicmp="0")

Modified: apr/apr/branches/1.2.x/include/apr.h.in
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.2.x/include/apr.h.in?rev=587780&r1=587779&r2=587780&view=diff
==============================================================================
--- apr/apr/branches/1.2.x/include/apr.h.in (original)
+++ apr/apr/branches/1.2.x/include/apr.h.in Tue Oct 23 21:41:58 2007
@@ -272,6 +272,14 @@
 typedef  @ssize_t_value@         apr_ssize_t;
 typedef  @off_t_value@           apr_off_t;
 typedef  @socklen_t_value@       apr_socklen_t;
+typedef  @ino_t_value@           apr_ino_t;
+
+/* As we don't want to break users who author for 1.2.x, we can't
+ * present this type until they have included apr_file_info.h
+ * where it was originally declared in release 1.2.0.
+ * Mask it from accedental misuse here.
+ */
+#define apr_ino_t apr_ino_t__requires__apr_file_info_h
 
 #define APR_SIZEOF_VOIDP @voidp_size@
 

Modified: apr/apr/branches/1.2.x/include/apr.hnw
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.2.x/include/apr.hnw?rev=587780&r1=587779&r2=587780&view=diff
==============================================================================
--- apr/apr/branches/1.2.x/include/apr.hnw (original)
+++ apr/apr/branches/1.2.x/include/apr.hnw Tue Oct 23 21:41:58 2007
@@ -255,6 +255,14 @@
 #else
 typedef  size_t            apr_socklen_t;
 #endif
+typedef  apr_uint64_t      apr_ino_t;
+
+/* As we don't want to break users who author for 1.2.x, we can't
+ * present this type until they have included apr_file_info.h
+ * where it was originally declared in release 1.2.0.
+ * Mask it from accedental misuse here.
+ */
+#define apr_ino_t apr_ino_t__requires__apr_file_info_h
 
 /* Are we big endian? */
 /* XXX: Fatal assumption on Alpha platforms */

Modified: apr/apr/branches/1.2.x/include/apr.hw
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.2.x/include/apr.hw?rev=587780&r1=587779&r2=587780&view=diff
==============================================================================
--- apr/apr/branches/1.2.x/include/apr.hw (original)
+++ apr/apr/branches/1.2.x/include/apr.hw Tue Oct 23 21:41:58 2007
@@ -345,6 +345,14 @@
 typedef  int         apr_off_t;
 #endif
 typedef  int         apr_socklen_t;
+typedef  apr_uint64_t      apr_ino_t;
+
+/* As we don't want to break users who author for 1.2.x, we can't
+ * present this type until they have included apr_file_info.h
+ * where it was originally declared in release 1.2.0.
+ * Mask it from accedental misuse here.
+ */
+#define apr_ino_t apr_ino_t__requires__apr_file_info_h
 
 /* Are we big endian? */
 /* XXX: Fatal assumption on Alpha platforms */

Modified: apr/apr/branches/1.2.x/include/apr_file_info.h
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.2.x/include/apr_file_info.h?rev=587780&r1=587779&r2=587780&view=diff
==============================================================================
--- apr/apr/branches/1.2.x/include/apr_file_info.h (original)
+++ apr/apr/branches/1.2.x/include/apr_file_info.h Tue Oct 23 21:41:58 2007
@@ -125,21 +125,23 @@
 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.
  */
 typedef dev_t                     apr_dev_t;
 #endif
+
+/* See apr.h.in (.hw or .hnw) for the declaration of apr_ino_t,
+ * but as we don't want to break users who author for 1.2.x, we
+ * can't present this type until they have included apr_file_info.h
+ * where it was originally declared in release 1.2.0.
+ * Unmask it for use here.
+ */
+#undef apr_ino_t
 
 /**
  * @defgroup apr_file_stat Stat Functions