You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by br...@apache.org on 2014/02/28 21:45:42 UTC

svn commit: r1573069 - in /subversion/trunk: configure.ac subversion/libsvn_subr/utf8proc.c subversion/libsvn_subr/utf8proc/utf8proc.h

Author: brane
Date: Fri Feb 28 20:45:42 2014
New Revision: 1573069

URL: http://svn.apache.org/r1573069
Log:
Don't rely on the presence of stdbool.h and inttypes.h headers for utf8proc.

* configure.ac: Check for stdbool.h and inttypes.h.
* subversion/libsvn_subr/utf8proc/utf8proc.h:
   Include stdbool.h and inttypes.h only if we know they're available.
   Otherwise, use typedefs based on APR's sized types.
* subversion/libsvn_subr/utf8proc.c:
   Move the include of utf8proc.c after svn_private_config.h, so that the
   presence symbols for stdbool.h and inttypes.h are available.

Modified:
    subversion/trunk/configure.ac
    subversion/trunk/subversion/libsvn_subr/utf8proc.c
    subversion/trunk/subversion/libsvn_subr/utf8proc/utf8proc.h

Modified: subversion/trunk/configure.ac
URL: http://svn.apache.org/viewvc/subversion/trunk/configure.ac?rev=1573069&r1=1573068&r2=1573069&view=diff
==============================================================================
--- subversion/trunk/configure.ac (original)
+++ subversion/trunk/configure.ac Fri Feb 28 20:45:42 2014
@@ -1486,6 +1486,8 @@ AC_SUBST(JAVAHL_COMPAT_TESTS_TARGET)
 
 # ==== Miscellaneous bits ====================================================
 
+AC_CHECK_HEADERS([stdbool.h inttypes.h])
+
 # Strip '-no-cpp-precomp' from CPPFLAGS for the clang compiler
 ### I think we get this flag from APR, so the fix probably belongs there
 if test "$CC" = "clang"; then

Modified: subversion/trunk/subversion/libsvn_subr/utf8proc.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/utf8proc.c?rev=1573069&r1=1573068&r2=1573069&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/utf8proc.c (original)
+++ subversion/trunk/subversion/libsvn_subr/utf8proc.c Fri Feb 28 20:45:42 2014
@@ -23,9 +23,6 @@
 
 
 
-#define UTF8PROC_INLINE
-#include "utf8proc/utf8proc.c"
-
 #include <apr_fnmatch.h>
 
 #include "private/svn_string_private.h"
@@ -33,6 +30,9 @@
 #include "svn_private_config.h"
 #define UNUSED(x) ((void)(x))
 
+#define UTF8PROC_INLINE
+#include "utf8proc/utf8proc.c"
+
 
 const char *svn_utf__utf8proc_version(void)
 {

Modified: subversion/trunk/subversion/libsvn_subr/utf8proc/utf8proc.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/utf8proc/utf8proc.h?rev=1573069&r1=1573068&r2=1573069&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/utf8proc/utf8proc.h (original)
+++ subversion/trunk/subversion/libsvn_subr/utf8proc/utf8proc.h Fri Feb 28 20:45:42 2014
@@ -83,9 +83,16 @@ typedef int int32_t;
 #endif
 typedef unsigned char bool;
 enum {false, true};
-#else
+#elif defined(HAVE_STDBOOL_H) && defined(HAVE_INTTYPES_H)
 #include <stdbool.h>
 #include <inttypes.h>
+#else
+#include <apr.h>
+typedef signed char int8_t;
+typedef unsigned char uint8_t;
+typedef apr_int16_t int16_t;
+typedef apr_uint16_t uint16_t;
+typedef apr_int32_t int32_t;
 #endif
 #include <limits.h>