Tests for module mbsncasecmp.
[gnulib.git] / lib / inttypes_.h
index f9ff39a..2379540 100644 (file)
    along with this program; if not, write to the Free Software Foundation,
    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
 
-#ifndef INTTYPES_H
+/* Include the original <inttypes.h> if it exists, and if this file
+   has not been included yet or if this file includes gnulib stdint.h
+   which in turn includes this file.  */
+#if ! defined INTTYPES_H || defined _GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H
+# if @HAVE_INTTYPES_H@
+#  include @ABSOLUTE_INTTYPES_H@
+# endif
+#endif
+
+#if ! defined INTTYPES_H && ! defined _GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H
 #define INTTYPES_H
 
 /*
  * <http://www.opengroup.org/susv3xbd/inttypes.h.html>
  */
 
-/* Include the original <inttypes.h> if it exists.  */
-#if @HAVE_INTTYPES_H@
-# include @ABSOLUTE_INTTYPES_H@
-#endif
 /* Include <stdint.h> or the gnulib replacement.  */
 #include <stdint.h>
 /* Get CHAR_BIT.  */
 
 #if ! defined __cplusplus || defined __STDC_FORMAT_MACROS
 
+# if defined _TNS_R_TARGET
+   /* Tandem NonStop R series and compatible platforms released before
+      July 2005 support %Ld but not %lld.  */
+#  define _LONG_LONG_FORMAT_PREFIX "L"
+# else
+#  define _LONG_LONG_FORMAT_PREFIX "ll"
+# endif
+
 # if !defined PRId8 || @PRI_MACROS_BROKEN@
 #  undef PRId8
 #  ifdef INT8_MAX
 #  elif defined _MSC_VER || defined __MINGW32__
 #   define _PRI64_PREFIX "I64"
 #  elif @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1
-#   define _PRI64_PREFIX "ll"
+#   define _PRI64_PREFIX _LONG_LONG_FORMAT_PREFIX
 #  endif
 #  if !defined PRId64 || @PRI_MACROS_BROKEN@
 #   undef PRId64
 #  endif
 # endif
 # ifdef UINT64_MAX
-#  if INT64_MAX == LONG_MAX
+#  if UINT64_MAX == ULONG_MAX
 #   define _PRIu64_PREFIX "l"
 #  elif defined _MSC_VER || defined __MINGW32__
 #   define _PRIu64_PREFIX "I64"
-#  elif @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1
-#   define _PRIu64_PREFIX "ll"
+#  elif @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1
+#   define _PRIu64_PREFIX _LONG_LONG_FORMAT_PREFIX
 #  endif
 #  if !defined PRIo64 || @PRI_MACROS_BROKEN@
 #   undef PRIo64
 #  elif defined _MSC_VER || defined __MINGW32__
 #   define _SCN64_PREFIX "I64"
 #  elif @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1
-#   define _SCN64_PREFIX "ll"
+#   define _SCN64_PREFIX _LONG_LONG_FORMAT_PREFIX
 #  endif
 #  if !defined SCNd64 || @PRI_MACROS_BROKEN@
 #   undef SCNd64
 #  endif
 # endif
 # ifdef UINT64_MAX
-#  if INT64_MAX == LONG_MAX
+#  if UINT64_MAX == ULONG_MAX
 #   define _SCNu64_PREFIX "l"
 #  elif defined _MSC_VER || defined __MINGW32__
 #   define _SCNu64_PREFIX "I64"
-#  elif @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1
-#   define _SCNu64_PREFIX "ll"
+#  elif @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1
+#   define _SCNu64_PREFIX _LONG_LONG_FORMAT_PREFIX
 #  endif
 #  if !defined SCNo64 || @PRI_MACROS_BROKEN@
 #   undef SCNo64