]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Replace ISC_PRINT_QUADFORMAT with inttypes.h format constants
authorOndřej Surý <ondrej@sury.org>
Wed, 28 Mar 2018 12:56:40 +0000 (14:56 +0200)
committerOndřej Surý <ondrej@sury.org>
Wed, 8 Aug 2018 07:36:44 +0000 (09:36 +0200)
31 files changed:
bin/dig/dig.c
bin/named/main.c
bin/named/server.c
bin/named/statschannel.c
bin/named/zoneconf.c
configure
configure.in
contrib/dnsperf-2.1.0.0-1/dnsperf.c
contrib/dnsperf-2.1.0.0-1/resperf.c
lib/bind9/check.c
lib/dns/badcache.c
lib/dns/cache.c
lib/dns/rbt.c
lib/dns/rbtdb.c
lib/dns/resolver.c
lib/dns/rpz.c
lib/dns/tests/rbt_serialize_test.c
lib/dns/tests/rbt_test.c
lib/dns/tests/tsig_test.c
lib/dns/xfrin.c
lib/isc/buffer.c
lib/isc/include/isc/platform.h.in
lib/isc/include/isc/print.h
lib/isc/mem.c
lib/isc/tests/atomic_test.c
lib/isc/tests/hash_test.c
lib/isc/tests/task_test.c
lib/isc/unix/socket.c
lib/isc/win32/include/isc/platform.h.in
lib/isccfg/parser.c
lib/ns/update.c

index 26da77758d2ac0a9cedefe01e92fbebd4cc2f041..91dee0b0930c669bc214cdc5e9678911f4226627 100644 (file)
@@ -15,6 +15,7 @@
 #include <stdlib.h>
 #include <time.h>
 #include <ctype.h>
+#include <inttypes.h>
 
 #include <isc/app.h>
 #include <isc/netaddr.h>
@@ -281,7 +282,7 @@ received(unsigned int bytes, isc_sockaddr_t *from, dig_query_t *query) {
 #endif
                if (query->lookup->doing_xfr) {
                        printf(";; XFR size: %u records (messages %u, "
-                              "bytes %" ISC_PRINT_QUADFORMAT "u)\n",
+                              "bytes %" PRIu64 ")\n",
                               query->rr_count, query->msg_count,
                               query->byte_count);
                } else {
@@ -299,14 +300,14 @@ received(unsigned int bytes, isc_sockaddr_t *from, dig_query_t *query) {
        } else if (query->lookup->identify && !short_form) {
                diff = isc_time_microdiff(&query->time_recv, &query->time_sent);
                if (query->lookup->use_usec)
-                       printf(";; Received %" ISC_PRINT_QUADFORMAT "u bytes "
+                       printf(";; Received %" PRIu64 " bytes "
                               "from %s(%s) in %ld us\n\n",
                               query->lookup->doing_xfr
                                 ? query->byte_count
                                 : (isc_uint64_t)bytes,
                               fromtext, query->userarg, (long) diff);
                else
-                       printf(";; Received %" ISC_PRINT_QUADFORMAT "u bytes "
+                       printf(";; Received %" PRIu64 " bytes "
                               "from %s(%s) in %ld ms\n\n",
                               query->lookup->doing_xfr
                                 ?  query->byte_count
@@ -360,10 +361,11 @@ say_message(dns_rdata_t *rdata, dig_query_t *query, isc_buffer_t *buf) {
                diff = isc_time_microdiff(&query->time_recv, &query->time_sent);
                ADD_STRING(buf, " from server ");
                ADD_STRING(buf, query->servname);
-               if (query->lookup->use_usec)
-                       snprintf(store, sizeof(store), " in %" ISC_PLATFORM_QUADFORMAT "u us.", diff);
-               else
-                       snprintf(store, sizeof(store), " in %" ISC_PLATFORM_QUADFORMAT "u ms.", diff / 1000);
+               if (query->lookup->use_usec) {
+                       snprintf(store, sizeof(store), " in %" PRIu64 " us.", diff);
+               } else {
+                       snprintf(store, sizeof(store), " in %" PRIu64 " ms.", diff / 1000);
+               }
                ADD_STRING(buf, store);
        }
        ADD_STRING(buf, "\n");
index 3e6e8efc11cb95295c79a4b5edaac31c00daa399..4a874eed7a346d2dce98308179e9c4df1f2dbaa1 100644 (file)
@@ -16,6 +16,7 @@
 #include <ctype.h>
 #include <stdlib.h>
 #include <string.h>
+#include <inttypes.h>
 
 #include <isc/app.h>
 #include <isc/backtrace.h>
@@ -1102,8 +1103,8 @@ setup(void) {
                isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
                              NAMED_LOGMODULE_MAIN, ISC_LOG_NOTICE,
                              "adjusted limit on open files from "
-                             "%" ISC_PRINT_QUADFORMAT "u to "
-                             "%" ISC_PRINT_QUADFORMAT "u",
+                             "%" PRIu64 " to "
+                             "%" PRIu64,
                              old_openfiles, named_g_initopenfiles);
        }
 
index 9ab3654ea3c1904241734f1d1af03c75790b4c08..c969d0b576062fd7bfb6406655880aca6ae6ffc8 100644 (file)
@@ -19,6 +19,7 @@
 #include <ctype.h>
 #include <sys/types.h>
 #include <sys/stat.h>
+#include <inttypes.h>
 
 #include <isc/aes.h>
 #include <isc/app.h>
@@ -3463,7 +3464,7 @@ configure_dnstap(const cfg_obj_t **maps, dns_view_t *view) {
                                cfg_obj_log(obj2, named_g_lctx,
                                    ISC_LOG_WARNING,
                                    "'dnstap-output size "
-                                   "%" ISC_PRINT_QUADFORMAT "u' "
+                                   "%" PRIu64 "' "
                                    "is too large for this "
                                    "system; reducing to %lu",
                                    max_size, (unsigned long)SIZE_MAX);
@@ -3890,7 +3891,7 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist,
                        cfg_obj_log(obj, named_g_lctx,
                                    ISC_LOG_WARNING,
                                    "'max-cache-size "
-                                   "%" ISC_PRINT_QUADFORMAT "u' "
+                                   "%" PRIu64 "' "
                                    "is too large for this "
                                    "system; reducing to %lu",
                                    value, (unsigned long)SIZE_MAX);
@@ -3914,8 +3915,8 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist,
                        cfg_obj_log(obj, named_g_lctx,
                                ISC_LOG_INFO,
                                "'max-cache-size %d%%' "
-                               "- setting to %" ISC_PRINT_QUADFORMAT "uMB "
-                               "(out of %" ISC_PRINT_QUADFORMAT "uMB)",
+                               "- setting to %" PRIu64 "MB "
+                               "(out of %" PRIu64 "MB)",
                                max_cache_size_percent,
                                (isc_uint64_t)(max_cache_size / (1024*1024)),
                                totalphys / (1024*1024));
@@ -6791,7 +6792,7 @@ set_limit(const cfg_obj_t **maps, const char *configname,
                      NAMED_LOGMODULE_SERVER,
                      result == ISC_R_SUCCESS ?
                        ISC_LOG_DEBUG(3) : ISC_LOG_WARNING,
-                     "set maximum %s to %" ISC_PRINT_QUADFORMAT "u: %s",
+                     "set maximum %s to %" PRIu64 ": %s",
                      description, value, isc_result_totext(result));
 }
 
@@ -7242,7 +7243,7 @@ setup_newzones(dns_view_t *view, cfg_obj_t *config, cfg_obj_t *vconfig,
                        cfg_obj_log(obj, named_g_lctx,
                                    ISC_LOG_ERROR,
                                    "'lmdb-mapsize "
-                                   "%" ISC_PRINT_QUADFORMAT "d' "
+                                   "%" PRId64 "' "
                                    "is too small",
                                    mapsize);
                        return (ISC_R_FAILURE);
@@ -7250,7 +7251,7 @@ setup_newzones(dns_view_t *view, cfg_obj_t *config, cfg_obj_t *vconfig,
                        cfg_obj_log(obj, named_g_lctx,
                                    ISC_LOG_ERROR,
                                    "'lmdb-mapsize "
-                                   "%" ISC_PRINT_QUADFORMAT "d' "
+                                   "%" PRId64 "' "
                                    "is too large",
                                    mapsize);
                        return (ISC_R_FAILURE);
@@ -7971,7 +7972,7 @@ load_configuration(const char *filename, named_server_t *server,
        if (result == ISC_R_SUCCESS && (isc_resourcevalue_t)maxsocks > nfiles) {
                isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
                              NAMED_LOGMODULE_SERVER, ISC_LOG_WARNING,
-                             "max open files (%" ISC_PRINT_QUADFORMAT "u)"
+                             "max open files (%" PRIu64 ")"
                              " is smaller than max sockets (%u)",
                              nfiles, maxsocks);
        }
index 5bf1853d2eea5ae2b2ec2128b6df5719c670104c..75ce76133d3f8312071ca0b05e671682974a28b6 100644 (file)
@@ -13,6 +13,8 @@
 
 #include <config.h>
 
+#include <inttypes.h>
+
 #include <isc/buffer.h>
 #include <isc/httpd.h>
 #include <isc/json.h>
@@ -1106,7 +1108,7 @@ dump_counters(isc_stats_t *stats, isc_statsformat_t type, void *arg,
                switch (dumparg.type) {
                case isc_statsformat_file:
                        fp = arg;
-                       fprintf(fp, "%20" ISC_PRINT_QUADFORMAT "u %s\n",
+                       fprintf(fp, "%20" PRIu64 " %s\n",
                                value, desc[idx]);
                        break;
                case isc_statsformat_xml:
@@ -1134,7 +1136,7 @@ dump_counters(isc_stats_t *stats, isc_statsformat_t type, void *arg,
                                                               ISC_XMLCHAR
                                                               "counter"));
                                TRY0(xmlTextWriterWriteFormatString(writer,
-                                       "%" ISC_PRINT_QUADFORMAT "u", value));
+                                       "%" PRIu64, value));
 
                                TRY0(xmlTextWriterEndElement(writer));
                                /* </counter> */
@@ -1151,7 +1153,7 @@ dump_counters(isc_stats_t *stats, isc_statsformat_t type, void *arg,
                                                                 ISC_XMLCHAR
                                                                 desc[idx]));
                                TRY0(xmlTextWriterWriteFormatString(writer,
-                                       "%" ISC_PRINT_QUADFORMAT "u", value));
+                                       "%" PRIu64, value));
                                TRY0(xmlTextWriterEndElement(writer));
                                /* counter */
                        }
@@ -1203,7 +1205,7 @@ rdtypestat_dump(dns_rdatastatstype_t type, isc_uint64_t val, void *arg) {
        switch (dumparg->type) {
        case isc_statsformat_file:
                fp = dumparg->arg;
-               fprintf(fp, "%20" ISC_PRINT_QUADFORMAT "u %s\n", val, typestr);
+               fprintf(fp, "%20" PRIu64 " %s\n", val, typestr);
                break;
        case isc_statsformat_xml:
 #ifdef HAVE_LIBXML2
@@ -1215,7 +1217,7 @@ rdtypestat_dump(dns_rdatastatstype_t type, isc_uint64_t val, void *arg) {
                                                 ISC_XMLCHAR typestr));
 
                TRY0(xmlTextWriterWriteFormatString(writer,
-                                              "%" ISC_PRINT_QUADFORMAT "u",
+                                              "%" PRIu64,
                                               val));
 
                TRY0(xmlTextWriterEndElement(writer)); /* type */
@@ -1282,7 +1284,7 @@ rdatasetstats_dump(dns_rdatastatstype_t type, isc_uint64_t val, void *arg) {
        switch (dumparg->type) {
        case isc_statsformat_file:
                fp = dumparg->arg;
-               fprintf(fp, "%20" ISC_PRINT_QUADFORMAT "u %s%s%s\n", val,
+               fprintf(fp, "%20" PRIu64 " %s%s%s\n", val,
                        stale ? "#" : "", nxrrset ? "!" : "", typestr);
                break;
        case isc_statsformat_xml:
@@ -1298,7 +1300,7 @@ rdatasetstats_dump(dns_rdatastatstype_t type, isc_uint64_t val, void *arg) {
 
                TRY0(xmlTextWriterStartElement(writer, ISC_XMLCHAR "counter"));
                TRY0(xmlTextWriterWriteFormatString(writer,
-                                              "%" ISC_PRINT_QUADFORMAT "u",
+                                              "%" PRIu64,
                                               val));
                TRY0(xmlTextWriterEndElement(writer)); /* counter */
 
@@ -1349,7 +1351,7 @@ opcodestat_dump(dns_opcode_t code, isc_uint64_t val, void *arg) {
        switch (dumparg->type) {
        case isc_statsformat_file:
                fp = dumparg->arg;
-               fprintf(fp, "%20" ISC_PRINT_QUADFORMAT "u %s\n", val, codebuf);
+               fprintf(fp, "%20" PRIu64 " %s\n", val, codebuf);
                break;
        case isc_statsformat_xml:
 #ifdef HAVE_LIBXML2
@@ -1358,7 +1360,7 @@ opcodestat_dump(dns_opcode_t code, isc_uint64_t val, void *arg) {
                TRY0(xmlTextWriterWriteAttribute(writer, ISC_XMLCHAR "name",
                                                 ISC_XMLCHAR codebuf ));
                TRY0(xmlTextWriterWriteFormatString(writer,
-                                               "%" ISC_PRINT_QUADFORMAT "u",
+                                               "%" PRIu64,
                                                val));
                TRY0(xmlTextWriterEndElement(writer)); /* counter */
 #endif
@@ -1406,7 +1408,7 @@ rcodestat_dump(dns_rcode_t code, isc_uint64_t val, void *arg) {
        switch (dumparg->type) {
        case isc_statsformat_file:
                fp = dumparg->arg;
-               fprintf(fp, "%20" ISC_PRINT_QUADFORMAT "u %s\n", val, codebuf);
+               fprintf(fp, "%20" PRIu64 " %s\n", val, codebuf);
                break;
        case isc_statsformat_xml:
 #ifdef HAVE_LIBXML2
@@ -1415,7 +1417,7 @@ rcodestat_dump(dns_rcode_t code, isc_uint64_t val, void *arg) {
                TRY0(xmlTextWriterWriteAttribute(writer, ISC_XMLCHAR "name",
                                                 ISC_XMLCHAR codebuf ));
                TRY0(xmlTextWriterWriteFormatString(writer,
-                                               "%" ISC_PRINT_QUADFORMAT "u",
+                                               "%" PRIu64,
                                                val));
                TRY0(xmlTextWriterEndElement(writer)); /* counter */
 #endif
index a8aad331c63adb1c9f77ededcc678d983e339dd3..98d0c319e03ee441a04c1405087704c9cc83208b 100644 (file)
@@ -11,6 +11,8 @@
 
 #include <config.h>
 
+#include <inttypes.h>
+
 #include <isc/buffer.h>
 #include <isc/file.h>
 #include <isc/mem.h>
@@ -1272,7 +1274,7 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
                                cfg_obj_log(obj, named_g_lctx,
                                            ISC_LOG_ERROR,
                                            "'max-journal-size "
-                                           "%" ISC_PRINT_QUADFORMAT "d' "
+                                           "%" PRId64 "' "
                                            "is too large",
                                            value);
                                RETERR(ISC_R_RANGE);
@@ -1405,7 +1407,7 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
                                cfg_obj_log(obj, named_g_lctx,
                                            ISC_LOG_ERROR,
                                            "'max-journal-size "
-                                           "%" ISC_PRINT_QUADFORMAT "d' "
+                                           "%" PRId64 "' "
                                            "is too large",
                                            value);
                                RETERR(ISC_R_RANGE);
index ae0b91dccfac279ddfdd87b95058c426ee0c0e34..49385509b30e7ecb08ba1af9fd67d6b9bec817ca 100755 (executable)
--- a/configure
+++ b/configure
@@ -727,7 +727,6 @@ ISC_PLATFORM_RLIMITTYPE
 ISC_PLATFORM_HAVESTATNSEC
 ISC_PLATFORM_HAVESYSUNH
 LIBCAP_LIBS
-ISC_PLATFORM_QUADFORMAT
 DST_EXTRA_SRCS
 DST_EXTRA_OBJS
 USE_ISC_SPNEGO
 
 
 
-# Determine the printf format characters to use when printing
-# values of type isc_int64_t. This will normally be "ll", but where
-# the compiler treats "long long" as a alias for "long" and printf
-# doesn't know about "long long" use "l".  Hopefully the sprintf
-# will produce a inconsistent result in the later case.  If the compiler
-# fails due to seeing "%lld" we fall back to "l".
-#
-# Digital Unix 4.0 (gcc?) (long long) is 64 bits as is its long. It uses
-# %ld even for (long long)/
-#
-# Win32 uses "%I64d", but that's defined elsewhere since we don't use
-# configure on Win32.
-#
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking printf format modifier for 64-bit integers" >&5
-$as_echo_n "checking printf format modifier for 64-bit integers... " >&6; }
-if test "$cross_compiling" = yes; then :
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: assuming target platform uses ll" >&5
-$as_echo "assuming target platform uses ll" >&6; }
-       ISC_PLATFORM_QUADFORMAT='#define ISC_PLATFORM_QUADFORMAT "ll"'
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-#include <stdio.h>
-main() {
-       long long int j = 0;
-       char buf[100];
-       buf[0] = 0;
-       sprintf(buf, "%lld", j);
-       exit((sizeof(long long int) != sizeof(long int))? 0 :
-            (strcmp(buf, "0") != 0));
-}
-
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ll" >&5
-$as_echo "ll" >&6; }
-       ISC_PLATFORM_QUADFORMAT='#define ISC_PLATFORM_QUADFORMAT "ll"'
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: l" >&5
-$as_echo "l" >&6; }
-       ISC_PLATFORM_QUADFORMAT='#define ISC_PLATFORM_QUADFORMAT "l"'
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-
-
-
 #
 # Security Stuff
 #
index 5b163f7e67fc87377bafc40ad4db50750241fc68..9dcd1ff8141c774b66fa11831d2a4ca6c661ef19 100644 (file)
@@ -2753,40 +2753,6 @@ AC_SUBST(USE_ISC_SPNEGO)
 AC_SUBST(DST_EXTRA_OBJS)
 AC_SUBST(DST_EXTRA_SRCS)
 
-# Determine the printf format characters to use when printing
-# values of type isc_int64_t. This will normally be "ll", but where
-# the compiler treats "long long" as a alias for "long" and printf
-# doesn't know about "long long" use "l".  Hopefully the sprintf
-# will produce a inconsistent result in the later case.  If the compiler
-# fails due to seeing "%lld" we fall back to "l".
-#
-# Digital Unix 4.0 (gcc?) (long long) is 64 bits as is its long. It uses
-# %ld even for (long long)/
-#
-# Win32 uses "%I64d", but that's defined elsewhere since we don't use
-# configure on Win32.
-#
-AC_MSG_CHECKING(printf format modifier for 64-bit integers)
-AC_TRY_RUN([
-#include <stdio.h>
-main() {
-       long long int j = 0;
-       char buf[100];
-       buf[0] = 0;
-       sprintf(buf, "%lld", j);
-       exit((sizeof(long long int) != sizeof(long int))? 0 :
-            (strcmp(buf, "0") != 0));
-} 
-],
-       [AC_MSG_RESULT(ll)
-       ISC_PLATFORM_QUADFORMAT='#define ISC_PLATFORM_QUADFORMAT "ll"'],
-       [AC_MSG_RESULT(l)
-       ISC_PLATFORM_QUADFORMAT='#define ISC_PLATFORM_QUADFORMAT "l"'],
-       [AC_MSG_RESULT(assuming target platform uses ll)
-       ISC_PLATFORM_QUADFORMAT='#define ISC_PLATFORM_QUADFORMAT "ll"'])
-AC_SUBST(ISC_PLATFORM_QUADFORMAT)
-
-
 #
 # Security Stuff
 #
index 67c5fc3ddb72374e4fca9c318dd857e3e1ba4bef..ba84de1a51a84053e7b29be83841a46ca6f13796 100644 (file)
@@ -36,6 +36,8 @@
  ***   DNS Performance Testing Tool
  ***/
 
+#include <inttypes.h>
+
 #include <errno.h>
 #include <math.h>
 #include <pthread.h>
@@ -278,16 +280,16 @@ print_statistics(const config_t *config, const times_t *times, stats_t *stats)
 
        printf("Statistics:\n\n");
 
-       printf("  %s sent:         %" ISC_PRINT_QUADFORMAT "u\n",
+       printf("  %s sent:         %" PRIu64 "\n",
                units, stats->num_sent);
-       printf("  %s completed:    %" ISC_PRINT_QUADFORMAT "u (%.2lf%%)\n",
+       printf("  %s completed:    %" PRIu64 " (%.2lf%%)\n",
               units, stats->num_completed,
               SAFE_DIV(100.0 * stats->num_completed, stats->num_sent));
-       printf("  %s lost:         %" ISC_PRINT_QUADFORMAT "u (%.2lf%%)\n",
+       printf("  %s lost:         %" PRIu64 " (%.2lf%%)\n",
               units, stats->num_timedout,
               SAFE_DIV(100.0 * stats->num_timedout, stats->num_sent));
        if (stats->num_interrupted > 0)
-               printf("  %s interrupted:  %" ISC_PRINT_QUADFORMAT "u "
+               printf("  %s interrupted:  %" PRIu64 " "
                        "(%.2lf%%)\n",
                       units, stats->num_interrupted,
                       SAFE_DIV(100.0 * stats->num_interrupted,
@@ -303,7 +305,7 @@ print_statistics(const config_t *config, const times_t *times, stats_t *stats)
                        first_rcode = ISC_FALSE;
                else
                        printf(", ");
-               printf("%s %" ISC_PRINT_QUADFORMAT "u (%.2lf%%)",
+               printf("%s %" PRIu64 " (%.2lf%%)",
                       perf_dns_rcode_strings[i], stats->rcodecounts[i],
                       (stats->rcodecounts[i] * 100.0) / stats->num_completed);
        }
index e94528e8025c0fbedc91c6ff81388c83b1624e76..7744d32d651f55225c0e85122fe0f3067f9c21f2 100644 (file)
@@ -41,6 +41,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
+#include <inttypes.h>
 
 #include <sys/time.h>
 
@@ -387,11 +388,11 @@ print_statistics(void) {
 
        printf("\nStatistics:\n\n");
 
-       printf("  Queries sent:         %" ISC_PRINT_QUADFORMAT "u\n",
+       printf("  Queries sent:         %" PRIu64 "\n",
                num_queries_sent);
-       printf("  Queries completed:    %" ISC_PRINT_QUADFORMAT "u\n",
+       printf("  Queries completed:    %" PRIu64 "\n",
                num_responses_received);
-       printf("  Queries lost:         %" ISC_PRINT_QUADFORMAT "u\n",
+       printf("  Queries lost:         %" PRIu64 "\n",
               num_queries_sent - num_responses_received);
        printf("  Response codes:       ");
        first_rcode = ISC_TRUE;
@@ -402,7 +403,7 @@ print_statistics(void) {
                        first_rcode = ISC_FALSE;
                else
                        printf(", ");
-               printf("%s %" ISC_PRINT_QUADFORMAT "u (%.2lf%%)",
+               printf("%s %" PRIu64 " (%.2lf%%)",
                       perf_dns_rcode_strings[i], rcodecounts[i],
                       (rcodecounts[i] * 100.0) / num_responses_received);
        }
index d796e3ba5afca2132ca371210cf7672393dbcb97..eb67ec20db031d4e8777b23b57869b199da7cbab 100644 (file)
@@ -14,6 +14,7 @@
 #include <config.h>
 
 #include <stdlib.h>
+#include <inttypes.h>
 
 #include <isc/aes.h>
 #include <isc/base64.h>
@@ -1565,7 +1566,7 @@ check_options(const cfg_obj_t *options, isc_log_t *logctx, isc_mem_t *mctx,
                        cfg_obj_log(obj, logctx,
                                    ISC_LOG_ERROR,
                                    "'lmdb-mapsize "
-                                   "%" ISC_PRINT_QUADFORMAT "d' "
+                                   "%" PRId64 "' "
                                    "is too small",
                                    mapsize);
                        if (result == ISC_R_SUCCESS)
@@ -1574,7 +1575,7 @@ check_options(const cfg_obj_t *options, isc_log_t *logctx, isc_mem_t *mctx,
                        cfg_obj_log(obj, logctx,
                                    ISC_LOG_ERROR,
                                    "'lmdb-mapsize "
-                                   "%" ISC_PRINT_QUADFORMAT "d' "
+                                   "%" PRId64 "' "
                                    "is too large",
                                    mapsize);
                        if (result == ISC_R_SUCCESS)
index d67ad955ab584ff1f32fe9452dd2c488e4511ebf..644b147fc28f6566cf3557ae10745c35b5796dbf 100644 (file)
@@ -13,6 +13,8 @@
 
 #include <config.h>
 
+#include <inttypes.h>
+
 #include <isc/buffer.h>
 #include <isc/log.h>
 #include <isc/hash.h>
@@ -429,7 +431,7 @@ dns_badcache_print(dns_badcache_t *bc, const char *cachename, FILE *fp) {
                        t = isc_time_microdiff(&bad->expire, &now);
                        t /= 1000;
                        fprintf(fp, "; %s/%s [ttl "
-                               "%" ISC_PLATFORM_QUADFORMAT "u]\n",
+                               "%" PRIu64 "]\n",
                                namebuf, typebuf, t);
                }
        }
index 9a2ca1ac562a03bd8a741a9e431b3cbab724415c..60669ab152922c03c8ed284187ff74b6ad56181b 100644 (file)
@@ -14,6 +14,8 @@
 
 #include <config.h>
 
+#include <inttypes.h>
+
 #include <isc/json.h>
 #include <isc/mem.h>
 #include <isc/print.h>
@@ -1401,47 +1403,47 @@ dns_cache_dumpstats(dns_cache_t *cache, FILE *fp) {
        getcounters(cache->stats, isc_statsformat_file,
                    dns_cachestatscounter_max, indices, values);
 
-       fprintf(fp, "%20" ISC_PRINT_QUADFORMAT "u %s\n",
+       fprintf(fp, "%20" PRIu64 " %s\n",
                values[dns_cachestatscounter_hits],
                "cache hits");
-       fprintf(fp, "%20" ISC_PRINT_QUADFORMAT "u %s\n",
+       fprintf(fp, "%20" PRIu64 " %s\n",
                values[dns_cachestatscounter_misses],
                "cache misses");
-       fprintf(fp, "%20" ISC_PRINT_QUADFORMAT "u %s\n",
+       fprintf(fp, "%20" PRIu64 " %s\n",
                values[dns_cachestatscounter_queryhits],
                "cache hits (from query)");
-       fprintf(fp, "%20" ISC_PRINT_QUADFORMAT "u %s\n",
+       fprintf(fp, "%20" PRIu64 " %s\n",
                values[dns_cachestatscounter_querymisses],
                "cache misses (from query)");
-       fprintf(fp, "%20" ISC_PRINT_QUADFORMAT "u %s\n",
+       fprintf(fp, "%20" PRIu64 " %s\n",
                values[dns_cachestatscounter_deletelru],
                "cache records deleted due to memory exhaustion");
-       fprintf(fp, "%20" ISC_PRINT_QUADFORMAT "u %s\n",
+       fprintf(fp, "%20" PRIu64 " %s\n",
                values[dns_cachestatscounter_deletettl],
                "cache records deleted due to TTL expiration");
        fprintf(fp, "%20u %s\n", dns_db_nodecount(cache->db),
                "cache database nodes");
-       fprintf(fp, "%20" ISC_PLATFORM_QUADFORMAT "u %s\n",
+       fprintf(fp, "%20" PRIu64 " %s\n",
                (isc_uint64_t) dns_db_hashsize(cache->db),
                "cache database hash buckets");
 
-       fprintf(fp, "%20" ISC_PLATFORM_QUADFORMAT "u %s\n",
+       fprintf(fp, "%20" PRIu64 " %s\n",
                (isc_uint64_t) isc_mem_total(cache->mctx),
                "cache tree memory total");
-       fprintf(fp, "%20" ISC_PLATFORM_QUADFORMAT "u %s\n",
+       fprintf(fp, "%20" PRIu64 " %s\n",
                (isc_uint64_t) isc_mem_inuse(cache->mctx),
                "cache tree memory in use");
-       fprintf(fp, "%20" ISC_PLATFORM_QUADFORMAT "u %s\n",
+       fprintf(fp, "%20" PRIu64 " %s\n",
                (isc_uint64_t) isc_mem_maxinuse(cache->mctx),
                "cache tree highest memory in use");
 
-       fprintf(fp, "%20" ISC_PLATFORM_QUADFORMAT "u %s\n",
+       fprintf(fp, "%20" PRIu64 " %s\n",
                (isc_uint64_t) isc_mem_total(cache->hmctx),
                "cache heap memory total");
-       fprintf(fp, "%20" ISC_PLATFORM_QUADFORMAT "u %s\n",
+       fprintf(fp, "%20" PRIu64 " %s\n",
                (isc_uint64_t) isc_mem_inuse(cache->hmctx),
                "cache heap memory in use");
-       fprintf(fp, "%20" ISC_PLATFORM_QUADFORMAT "u %s\n",
+       fprintf(fp, "%20" PRIu64 " %s\n",
                (isc_uint64_t) isc_mem_maxinuse(cache->hmctx),
                "cache heap highest memory in use");
 }
@@ -1456,7 +1458,7 @@ renderstat(const char *name, isc_uint64_t value, xmlTextWriterPtr writer) {
        TRY0(xmlTextWriterWriteAttribute(writer,
                                         ISC_XMLCHAR "name", ISC_XMLCHAR name));
        TRY0(xmlTextWriterWriteFormatString(writer,
-                                           "%" ISC_PRINT_QUADFORMAT "u",
+                                           "%" PRIu64 "",
                                            value));
        TRY0(xmlTextWriterEndElement(writer)); /* counter */
 
index c03e19c30bccead3de453b54c5b2e3a30d8a1ea0..918a97cdb2b73ee9eafb433676c56fac97f829d5 100644 (file)
@@ -14,9 +14,7 @@
 #include <config.h>
 
 #include <sys/stat.h>
-#ifdef HAVE_INTTYPES_H
 #include <inttypes.h> /* uintptr_t */
-#endif
 
 #include <isc/crc64.h>
 #include <isc/file.h>
index 01c7cd85e236639d276992bf1ef1823438d5536a..d1511a9aa6d4c9ccabcd9fd4133cc551e867f382 100644 (file)
@@ -15,9 +15,7 @@
 
 /* #define inline */
 
-#ifdef HAVE_INTTYPES_H
-#include <inttypes.h> /* uintptr_t */
-#endif
+#include <inttypes.h>
 
 #include <isc/crc64.h>
 #include <isc/event.h>
@@ -9849,8 +9847,8 @@ rehash_gluetable(rbtdb_version_t *version) {
        isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
                      DNS_LOGMODULE_ZONE, ISC_LOG_DEBUG(3),
                      "rehash_gluetable(): "
-                     "resized glue table from %"ISC_PRINT_QUADFORMAT"u to "
-                     "%"ISC_PRINT_QUADFORMAT"u",
+                     "resized glue table from %" PRIu64 " to "
+                     "%" PRIu64,
                      (isc_uint64_t) oldsize,
                      (isc_uint64_t) version->glue_table_size);
 
index 55fd1eeccca773df22dc9fdefd252426553febfc..7d938cd140ed65fed3c39a26fbbf73db092b8b72 100644 (file)
@@ -13,6 +13,7 @@
 
 #include <config.h>
 #include <ctype.h>
+#include <inttypes.h>
 
 #include <isc/counter.h>
 #include <isc/log.h>
@@ -10612,8 +10613,8 @@ dns_resolver_logfetch(dns_fetch_t *fetch, isc_log_t *lctx,
                dns_name_format(&fctx->domain, domainbuf, sizeof(domainbuf));
                isc_log_write(lctx, category, module, level,
                              "fetch completed at %s:%d for %s in "
-                             "%" ISC_PRINT_QUADFORMAT "u."
-                             "%06" ISC_PRINT_QUADFORMAT "u: %s/%s "
+                             "%" PRIu64 "."
+                             "%06" PRIu64 ": %s/%s "
                              "[domain:%s,referral:%u,restart:%u,qrysent:%u,"
                              "timeout:%u,lame:%u,quota:%u,neterr:%u,"
                              "badresp:%u,adberr:%u,findfail:%u,valfail:%u,"
index ecebe2715662c660b8d8c3b2793487b597d0af9e..2698e69aabd1fbad481481a87cbc25cfe1e9619b 100644 (file)
@@ -13,6 +13,8 @@
 
 #include <config.h>
 
+#include <inttypes.h>
+
 #include <isc/buffer.h>
 #include <isc/mem.h>
 #include <isc/net.h>
@@ -553,7 +555,7 @@ fix_qname_skip_recurse(dns_rpz_zones_t *rpzs) {
  set:
        isc_log_write(dns_lctx, DNS_LOGCATEGORY_RPZ, DNS_LOGMODULE_RBTDB,
                      DNS_RPZ_DEBUG_QUIET,
-                     "computed RPZ qname_skip_recurse mask=0x%llx",
+                     "computed RPZ qname_skip_recurse mask=0x%" PRIx64,
                      (isc_uint64_t) mask);
        rpzs->have.qname_skip_recurse = mask;
 }
@@ -1624,7 +1626,7 @@ dns_rpz_dbupdate_callback(dns_db_t *db, void *fn_arg) {
                                      DNS_LOGMODULE_MASTER, ISC_LOG_INFO,
                                      "rpz: %s: new zone version came "
                                      "too soon, deferring update for "
-                                     "%llu seconds", dname, defer);
+                                     "%" PRIu64 " seconds", dname, defer);
                        isc_interval_set(&interval, (unsigned int)defer, 0);
                        dns_db_currentversion(zone->db, &zone->dbversion);
                        result = isc_timer_reset(zone->updatetimer,
@@ -1814,7 +1816,7 @@ finish_update(dns_rpz_zone_t *rpz) {
                              DNS_LOGMODULE_MASTER, ISC_LOG_INFO,
                              "rpz: %s: new zone version came "
                              "too soon, deferring update for "
-                             "%llu seconds", dname, defer);
+                             "%" PRIu64 " seconds", dname, defer);
                isc_interval_set(&interval, (unsigned int)defer, 0);
                isc_timer_reset(rpz->updatetimer, isc_timertype_once,
                                NULL, &interval, ISC_TRUE);
index c84b705235a27afe1c83e1e1fcccf234aed1aa33..efe19c929ee01554cdb701938535528de0dfbc4d 100644 (file)
@@ -22,9 +22,7 @@
 #include <unistd.h>
 #include <sys/mman.h>
 
-#ifdef HAVE_INTTYPES_H
 #include <inttypes.h> /* uintptr_t */
-#endif
 
 #include <dns/rbt.h>
 #include <dns/fixedname.h>
index 3eb135acf6e0bb2eba0d1402482496c5e97392ce..6b1c7a51d60bfe58e1233f5a9f890ee6e45eda2a 100644 (file)
@@ -19,9 +19,7 @@
 #include <fcntl.h>
 #include <unistd.h>
 
-#ifdef HAVE_INTTYPES_H
 #include <inttypes.h> /* uintptr_t */
-#endif
 
 #include <dns/rbt.h>
 #include <dns/fixedname.h>
index 966053ee4da242f3e7264ba9a2360ca0d057a511..b2c8845a4d0a089c624993bcef2f6725639c0384 100644 (file)
@@ -16,6 +16,7 @@
 #include <atf-c.h>
 
 #include <unistd.h>
+#include <inttypes.h>
 
 #include <isc/mem.h>
 #include <isc/print.h>
 
 #include "dnstest.h"
 
-#ifdef HAVE_INTTYPES_H
-#include <inttypes.h> /* uintptr_t */
-#endif
-
 #define TEST_ORIGIN    "test"
 
 /*
index d67652dd0b7315cf7f236c4f719b9c246b1611d1..7ce5bc7a3ee3c4b3783b27fa641e3d2a3c0d253c 100644 (file)
@@ -14,6 +14,8 @@
 
 #include <config.h>
 
+#include <inttypes.h>
+
 #include <isc/mem.h>
 #include <isc/print.h>
 #include <isc/random.h>
@@ -1466,7 +1468,7 @@ maybe_free(dns_xfrin_ctx_t *xfr) {
        persec = (xfr->nbytes * 1000) / msecs;
        xfrin_log(xfr, ISC_LOG_INFO,
                  "Transfer completed: %d messages, %d records, "
-                 "%" ISC_PRINT_QUADFORMAT "u bytes, "
+                 "%" PRIu64 " bytes, "
                  "%u.%03u secs (%u bytes/sec)",
                  xfr->nmsg, xfr->nrecs, xfr->nbytes,
                  (unsigned int) (msecs / 1000), (unsigned int) (msecs % 1000),
index 095ee2530b09b5da25d4397423ab291481ac918a..56b38f9f62f080ef555a93e8462d1e82d0b82682 100644 (file)
@@ -13,6 +13,9 @@
 
 #include <config.h>
 
+#include <inttypes.h>
+#include <stdarg.h>
+
 #include <isc/buffer.h>
 #include <isc/mem.h>
 #include <isc/print.h>
@@ -20,8 +23,6 @@
 #include <isc/string.h>
 #include <isc/util.h>
 
-#include <stdarg.h>
-
 void
 isc__buffer_init(isc_buffer_t *b, void *base, unsigned int length) {
        /*
@@ -476,7 +477,7 @@ isc_buffer_putdecint(isc_buffer_t *b, isc_int64_t v) {
        REQUIRE(ISC_BUFFER_VALID(b));
 
        /* xxxwpk do it more low-level way ? */
-       l = snprintf(buf, 21, "%" ISC_PRINT_QUADFORMAT "d", v);
+       l = snprintf(buf, 21, "%" PRId64, v);
        RUNTIME_CHECK(l <= 21);
        if (ISC_UNLIKELY(b->autore)) {
                result = isc_buffer_reserve(&b, l);
index f542bd0115ff8f27571b1a864ca9822ca557d602..5688ad2d44a40b8b59a8263b8766f14d21a38591 100644 (file)
  ***/
 
 /*! \brief
- * The printf format string modifier to use with isc_uint64_t values.
- */
-@ISC_PLATFORM_QUADFORMAT@
 
 /*
  * If the system needs strlcpy(), ISC_PLATFORM_NEEDSTRLCPY will be defined.
index d38505f1fc9f596d6685331859a15e7bc2bbdd15..928d708b5bd81efe748618d3ee587b1b1e6d9164 100644 (file)
 #include <isc/lang.h>
 #include <isc/platform.h>
 
-/***
- *** Macros
- ***/
-#define ISC_PRINT_QUADFORMAT ISC_PLATFORM_QUADFORMAT
-
 /***
  *** Functions
  ***/
index ff541d54162922dda70ff36bde87d7aa8eab5c85..6ce761dff9040a79388802d85e01f8bf00ff43f8 100644 (file)
@@ -16,7 +16,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <stddef.h>
-
+#include <inttypes.h>
 #include <limits.h>
 
 #include <isc/bind9.h>
@@ -2369,33 +2369,33 @@ xml_renderctx(isc__mem_t *ctx, summarystat_t *summary,
        summary->total += ctx->total;
        TRY0(xmlTextWriterStartElement(writer, ISC_XMLCHAR "total"));
        TRY0(xmlTextWriterWriteFormatString(writer,
-                                           "%" ISC_PRINT_QUADFORMAT "u",
+                                           "%" PRIu64 "",
                                            (isc_uint64_t)ctx->total));
        TRY0(xmlTextWriterEndElement(writer)); /* total */
 
        summary->inuse += ctx->inuse;
        TRY0(xmlTextWriterStartElement(writer, ISC_XMLCHAR "inuse"));
        TRY0(xmlTextWriterWriteFormatString(writer,
-                                           "%" ISC_PRINT_QUADFORMAT "u",
+                                           "%" PRIu64 "",
                                            (isc_uint64_t)ctx->inuse));
        TRY0(xmlTextWriterEndElement(writer)); /* inuse */
 
        TRY0(xmlTextWriterStartElement(writer, ISC_XMLCHAR "maxinuse"));
        TRY0(xmlTextWriterWriteFormatString(writer,
-                                           "%" ISC_PRINT_QUADFORMAT "u",
+                                           "%" PRIu64 "",
                                            (isc_uint64_t)ctx->maxinuse));
        TRY0(xmlTextWriterEndElement(writer)); /* maxinuse */
 
        summary->malloced += ctx->malloced;
        TRY0(xmlTextWriterStartElement(writer, ISC_XMLCHAR "malloced"));
        TRY0(xmlTextWriterWriteFormatString(writer,
-                                           "%" ISC_PRINT_QUADFORMAT "u",
+                                           "%" PRIu64 "",
                                            (isc_uint64_t)ctx->malloced));
        TRY0(xmlTextWriterEndElement(writer)); /* malloced */
 
        TRY0(xmlTextWriterStartElement(writer, ISC_XMLCHAR "maxmalloced"));
        TRY0(xmlTextWriterWriteFormatString(writer,
-                                           "%" ISC_PRINT_QUADFORMAT "u",
+                                           "%" PRIu64 "",
                                            (isc_uint64_t)ctx->maxmalloced));
        TRY0(xmlTextWriterEndElement(writer)); /* maxmalloced */
 
@@ -2404,7 +2404,7 @@ xml_renderctx(isc__mem_t *ctx, summarystat_t *summary,
                summary->blocksize += ctx->basic_table_count *
                        NUM_BASIC_BLOCKS * ctx->mem_target;
                TRY0(xmlTextWriterWriteFormatString(writer,
-                                              "%" ISC_PRINT_QUADFORMAT "u",
+                                              "%" PRIu64 "",
                                               (isc_uint64_t)
                                               ctx->basic_table_count *
                                               NUM_BASIC_BLOCKS *
@@ -2420,13 +2420,13 @@ xml_renderctx(isc__mem_t *ctx, summarystat_t *summary,
 
        TRY0(xmlTextWriterStartElement(writer, ISC_XMLCHAR "hiwater"));
        TRY0(xmlTextWriterWriteFormatString(writer,
-                                           "%" ISC_PRINT_QUADFORMAT "u",
+                                           "%" PRIu64 "",
                                            (isc_uint64_t)ctx->hi_water));
        TRY0(xmlTextWriterEndElement(writer)); /* hiwater */
 
        TRY0(xmlTextWriterStartElement(writer, ISC_XMLCHAR "lowater"));
        TRY0(xmlTextWriterWriteFormatString(writer,
-                                           "%" ISC_PRINT_QUADFORMAT "u",
+                                           "%" PRIu64 "",
                                            (isc_uint64_t)ctx->lo_water));
        TRY0(xmlTextWriterEndElement(writer)); /* lowater */
 
@@ -2470,37 +2470,37 @@ isc_mem_renderxml(xmlTextWriterPtr writer) {
 
        TRY0(xmlTextWriterStartElement(writer, ISC_XMLCHAR "TotalUse"));
        TRY0(xmlTextWriterWriteFormatString(writer,
-                                           "%" ISC_PRINT_QUADFORMAT "u",
+                                           "%" PRIu64 "",
                                            summary.total));
        TRY0(xmlTextWriterEndElement(writer)); /* TotalUse */
 
        TRY0(xmlTextWriterStartElement(writer, ISC_XMLCHAR "InUse"));
        TRY0(xmlTextWriterWriteFormatString(writer,
-                                           "%" ISC_PRINT_QUADFORMAT "u",
+                                           "%" PRIu64 "",
                                            summary.inuse));
        TRY0(xmlTextWriterEndElement(writer)); /* InUse */
 
        TRY0(xmlTextWriterStartElement(writer, ISC_XMLCHAR "Malloced"));
        TRY0(xmlTextWriterWriteFormatString(writer,
-                                           "%" ISC_PRINT_QUADFORMAT "u",
+                                           "%" PRIu64 "",
                                            summary.malloced));
        TRY0(xmlTextWriterEndElement(writer)); /* InUse */
 
        TRY0(xmlTextWriterStartElement(writer, ISC_XMLCHAR "BlockSize"));
        TRY0(xmlTextWriterWriteFormatString(writer,
-                                           "%" ISC_PRINT_QUADFORMAT "u",
+                                           "%" PRIu64 "",
                                            summary.blocksize));
        TRY0(xmlTextWriterEndElement(writer)); /* BlockSize */
 
        TRY0(xmlTextWriterStartElement(writer, ISC_XMLCHAR "ContextSize"));
        TRY0(xmlTextWriterWriteFormatString(writer,
-                                           "%" ISC_PRINT_QUADFORMAT "u",
+                                           "%" PRIu64 "",
                                            summary.contextsize));
        TRY0(xmlTextWriterEndElement(writer)); /* ContextSize */
 
        TRY0(xmlTextWriterStartElement(writer, ISC_XMLCHAR "Lost"));
        TRY0(xmlTextWriterWriteFormatString(writer,
-                                           "%" ISC_PRINT_QUADFORMAT "u",
+                                           "%" PRIu64 "",
                                            lost));
        TRY0(xmlTextWriterEndElement(writer)); /* Lost */
 
index d38d84774bbc38dc9f9a9e4dd5fa9ef4ec0b26af..3d1e1352377781c8417bfad67d8c4c6d00a58227 100644 (file)
@@ -10,7 +10,9 @@
  */
 
 #include <config.h>
+
 #include <stdlib.h>
+#include <inttypes.h>
 
 #include <atf-c.h>
 
@@ -149,8 +151,8 @@ ATF_TC_BODY(atomic_xaddq, tc) {
 
        isc_test_end();
 
-       printf("64-bit counter %"ISC_PRINT_QUADFORMAT"d, "
-              "expected %"ISC_PRINT_QUADFORMAT"d\n",
+       printf("64-bit counter %" PRId64 ", "
+              "expected %" PRId64 "\n",
               counter_64, EXPECTED_COUNT_64);
 
        ATF_CHECK_EQ(counter_64, EXPECTED_COUNT_64);
@@ -304,8 +306,8 @@ ATF_TC_BODY(atomic_storeq, tc) {
               (isc_uint64_t) r);
        val |= ((isc_uint64_t) val << 32);
 
-       printf("64-bit store 0x%"ISC_PRINT_QUADFORMAT"x, "
-              "expected 0x%"ISC_PRINT_QUADFORMAT"x\n",
+       printf("64-bit store 0x%" PRIx64 ", "
+              "expected 0x%" PRIx64 "\n",
               (isc_uint64_t) store_64, val);
 
        ATF_CHECK_EQ((isc_uint64_t) store_64, val);
index 44ce7ac429a627a86699252744850f7b4de780be..4f7e721469752fa40e24e415ad9aaee255631ffc 100644 (file)
@@ -17,6 +17,7 @@
 
 #include <stdio.h>
 #include <string.h>
+#include <inttypes.h>
 
 #include <isc/hash.h>
 
@@ -1835,7 +1836,7 @@ ATF_TC_BODY(isc_crc64, tc) {
                }
                isc_crc64_final(&crc);
                snprintf(str, sizeof(str),
-                        "0x%016" ISC_PRINT_QUADFORMAT "X", crc);
+                        "0x%016" PRIX64, crc);
                ATF_CHECK_STREQ(str, testcase->result);
 
                testcase++;
index 49615f9b4a9d2d1c55c6d4c88a65f04f11360c67..9e4b61ac9d61ac68e78f072041423b7801dc4d50 100644 (file)
 
 #include <atf-c.h>
 
-#ifdef HAVE_INTTYPES_H
-#include <inttypes.h>  /* uintptr_t */
-#endif
 #include <stdlib.h>
 #include <unistd.h>
+#include <inttypes.h>
 
 #include <isc/condition.h>
 #include <isc/mem.h>
index b14f23c05a53f8c062265c98a315380a68840a52..6198a73d3b90a4abbbfe35400765f8ddb2c0e38f 100644 (file)
@@ -34,9 +34,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
-#ifdef HAVE_INTTYPES_H
-#include <inttypes.h> /* uintptr_t */
-#endif
+#include <inttypes.h>
 
 #include <isc/buffer.h>
 #include <isc/bufferlist.h>
index 283fc4f7e26740fa1abec2e588dc354b03b45245..87542f392655cd62eea8f55da52e2e56f988660c 100644 (file)
@@ -50,8 +50,6 @@
 #define ISC_PLATFORM_NEEDPTON
 #define ISC_PLATFORM_HAVESOCKADDRSTORAGE
 
-#define ISC_PLATFORM_QUADFORMAT "I64"
-
 #define ISC_PLATFORM_NEEDSTRSEP
 #define ISC_PLATFORM_NEEDSTRLCPY
 #define ISC_PLATFORM_NEEDSTRLCAT
index 3a10d713f6bf12b085715ec6a42e1fa8fce1393f..926a47731940574295cce96b1cf4d46dfe8b06c6 100644 (file)
@@ -14,6 +14,7 @@
 #include <config.h>
 
 #include <stdlib.h>
+#include <inttypes.h>
 
 #include <isc/buffer.h>
 #include <isc/dir.h>
@@ -976,7 +977,7 @@ void
 cfg_print_uint64(cfg_printer_t *pctx, const cfg_obj_t *obj) {
        char buf[32];
 
-       snprintf(buf, sizeof(buf), "%" ISC_PRINT_QUADFORMAT "u",
+       snprintf(buf, sizeof(buf), "%" PRIu64,
                 obj->value.uint64);
        cfg_print_cstr(pctx, buf);
 }
index fe077a1f501cde3fa2b82186e57baa85119b1cbe..39c0f1130a32892a43a041e6fa394143a4eda070 100644 (file)
@@ -11,6 +11,8 @@
 
 #include <config.h>
 
+#include <inttypes.h>
+
 #include <isc/netaddr.h>
 #include <isc/print.h>
 #include <isc/serial.h>
@@ -3196,8 +3198,8 @@ update_action(isc_task_t *task, isc_event_t *event) {
                        if (result == ISC_R_SUCCESS && records > maxrecords) {
                                update_log(client, zone, ISC_LOG_ERROR,
                                           "records in zone (%"
-                                          ISC_PRINT_QUADFORMAT
-                                          "u) exceeds max-records (%u)",
+                                          PRIu64
+                                          ") exceeds max-records (%u)",
                                           records, maxrecords);
                                result = DNS_R_TOOMANYRECORDS;
                                goto failure;