#endif /* _WIN32 */
#endif /* LargestIntegralTypePrintfFormat */
-/* Printf format used to display LargestIntegralType as unsigned. */
-#ifndef LargestIntegralTypePrintfUnsignedFormat
-#ifdef _WIN32
-#define LargestIntegralTypePrintfUnsignedFormat "%I64u"
-#else
-#define LargestIntegralTypePrintfUnsignedFormat "%llu"
-#endif /* _WIN32 */
-#endif /* LargestIntegralTypePrintfFormat */
-
/* Perform an unsigned cast to LargestIntegralType. */
#define cast_to_largest_integral_type(value) \
((LargestIntegralType)((size_t)(value)))
#include <malloc.h>
#endif
+#ifdef HAVE_INTTYPES_H
+#include <inttypes.h>
+#endif
+
#include <setjmp.h>
#include <stdarg.h>
#include <stddef.h>
#define PRIdS "Id"
#endif
+#ifndef PRIu64
+#define PRIu64 "I64u"
+#endif
+
#else /* _WIN32 */
#ifndef PRIdS
#define PRIdS "zd"
#endif
+#ifndef PRIu64
+#define PRIu64 "llu"
+#endif
+
#include <signal.h>
#endif /* _WIN32 */
if (succeeded) {
return 1;
}
- print_error(LargestIntegralTypePrintfUnsignedFormat
- "is %sin the set (", value, invert ? "" : "not ");
+ print_error("%" PRIu64 " is %sin the set (", value,
+ invert ? "" : "not ");
for (i = 0; i < size_of_set; i++) {
- print_error(LargestIntegralTypePrintfUnsignedFormat ", ", set[i]);
+ print_error("%" PRIu64 ", ", set[i]);
}
print_error(")\n");
}
if (value >= range_min && value <= range_max) {
return 1;
}
- print_error(LargestIntegralTypePrintfUnsignedFormat
- " is not within the range "
- LargestIntegralTypePrintfUnsignedFormat "-"
- LargestIntegralTypePrintfUnsignedFormat "\n",
+ print_error("%" PRIu64 " is not within the range %" PRIu64 "-%" PRIu64 "\n",
value, range_min, range_max);
return 0;
}
if (value < range_min || value > range_max) {
return 1;
}
- print_error(LargestIntegralTypePrintfUnsignedFormat
- " is within the range "
- LargestIntegralTypePrintfUnsignedFormat "-"
- LargestIntegralTypePrintfUnsignedFormat "\n",
+ print_error("%" PRIu64 " is within the range %" PRIu64 "-%" PRIu64 "\n",
value, range_min, range_max);
return 0;
}
if (result > valmax - 1) {
if (error > 0) {
- print_error("%s < 0, errno("
- LargestIntegralTypePrintfUnsignedFormat "): %s\n",
+ print_error("%s < 0, errno(%" PRIu64 "): %s\n",
expression, error, strerror(error));
} else {
print_error("%s < 0\n", expression);