<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -255,6 +255,52 @@ AC_SEARCH_LIBS(umem_cache_create, umem)
 AC_SEARCH_LIBS(gethugepagesizes, hugetlbfs)
 
 AC_HEADER_STDBOOL
+AH_BOTTOM([#if HAVE_STDBOOL_H
+#include &lt;stdbool.h&gt;
+#else
+#define bool char
+#define false 0
+#define true 1
+#endif ])
+
+AC_CHECK_HEADERS([inttypes.h])
+AH_BOTTOM([#ifdef HAVE_INTTYPES_H
+#include &lt;inttypes.h&gt;
+#endif
+])
+
+dnl **********************************************************************
+dnl DETECT_UINT64_SUPPORT
+dnl
+dnl check if we can use a uint64_t
+dnl **********************************************************************
+AC_DEFUN([AC_C_DETECT_UINT64_SUPPORT],
+[
+    AC_CACHE_CHECK([for print macros for integers (C99 section 7.8.1)],
+        [ac_cv_c_uint64_support],
+        [AC_TRY_COMPILE(
+            [
+#ifdef HAVE_INTTYPES_H
+#include &lt;inttypes.h&gt;
+#endif
+#include &lt;stdio.h&gt;
+            ], [
+  uint64_t val = 0;
+  fprintf(stderr, &quot;%&quot; PRIu64 &quot;\n&quot;, val);
+            ],
+            [ ac_cv_c_uint64_support=yes ],
+            [ ac_cv_c_uint64_support=no ])
+        ])
+])
+
+AC_C_DETECT_UINT64_SUPPORT
+AS_IF([test &quot;x$ac_cv_c_uint64_support&quot; = &quot;xno&quot;],
+      [AC_MSG_WARN([
+
+Failed to use print macros (PRIu) as defined in C99 section 7.8.1.
+
+])])
+
 AC_C_CONST
 
 dnl From licq: Copyright (c) 2000 Dirk Mueller
@@ -314,7 +360,9 @@ AC_DEFUN([AC_C_HTONLL],
        AC_LANG_PROGRAM([
 #include &lt;sys/types.h&gt;
 #include &lt;netinet/in.h&gt;
-#include &lt;inttypes.h&gt;
+#ifdef HAVE_INTTYPES_H
+#include &lt;inttypes.h&gt; */
+#endif
        ], [
           return htonll(0);
        ])</diff>
      <filename>configure.ac</filename>
    </modified>
    <modified>
      <diff>@@ -15,8 +15,6 @@
 #include &lt;netinet/in.h&gt;
 #include &lt;event.h&gt;
 #include &lt;netdb.h&gt;
-#include &lt;stdbool.h&gt;
-#include &lt;stdint.h&gt;
 #include &lt;pthread.h&gt;
 #include &lt;unistd.h&gt;
 </diff>
      <filename>memcached.h</filename>
    </modified>
    <modified>
      <diff>@@ -35,8 +35,6 @@
 #ifndef PROTOCOL_BINARY_H
 #define PROTOCOL_BINARY_H
 
-#include &lt;stdint.h&gt;
-
 /**
  * This file contains definitions of the constants and packet formats
  * defined in the binary specification. Please note that you _MUST_ remember</diff>
      <filename>protocol_binary.h</filename>
    </modified>
    <modified>
      <diff>@@ -14,16 +14,14 @@
 #include &lt;errno.h&gt;
 #include &lt;assert.h&gt;
 #include &lt;string.h&gt;
-#include &lt;inttypes.h&gt;
-#include &lt;stdbool.h&gt;
 #include &lt;unistd.h&gt;
 #include &lt;netinet/in.h&gt;
 #include &lt;fcntl.h&gt;
 
-#include &quot;protocol_binary.h&quot;
 #include &quot;config.h&quot;
 #include &quot;cache.h&quot;
 #include &quot;util.h&quot;
+#include &quot;protocol_binary.h&quot;
 
 #define TMP_TEMPLATE &quot;/tmp/test_file.XXXXXXX&quot;
 </diff>
      <filename>testapp.c</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>e24110a42dcf036f25e38211198c8a1f8f9590da</id>
    </parent>
  </parents>
  <author>
    <name>Trond Norbye</name>
    <email>Trond.Norbye@sun.com</email>
  </author>
  <url>http://github.com/dustin/memcached/commit/24869322da6262588d40eb6b12427feed929aede</url>
  <id>24869322da6262588d40eb6b12427feed929aede</id>
  <committed-date>2009-11-04T10:29:24-08:00</committed-date>
  <authored-date>2009-11-04T02:40:56-08:00</authored-date>
  <message>Allow semi-broken C99 compilers to compile memcached

Some C compilers understand the syntax we use in memcached, but do not
ship stdbool.h or stdint.h.  According to C99 inttypes.h contains the
formatting macros we use (PRInn) and is supposed to include stdint.h.

This patch tries to detect stdbool.h and inttypes.h and tries to
include them from config.h</message>
  <tree>4dd10ed1302c3deb4b63498c35a0239b4b52c3d6</tree>
  <committer>
    <name>Dustin Sallings</name>
    <email>dustin@spy.net</email>
  </committer>
</commit>
