r8713: Experiment to try and fix warnings on 64-bit machines without breaking
authorTim Potter <tpot@samba.org>
Fri, 22 Jul 2005 11:16:32 +0000 (11:16 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:29:57 +0000 (13:29 -0500)
32-bit ones.  Yes, this weird looking macros are part of C99.

source/build/m4/rewrite.m4
source/dsdb/samdb/samdb.c
source/include/includes.h

index 35482b6ceccfda2f902bf052e6d1eecac4a25756..fd19de5d17e7febfe676596e90fb4a82bf0ccce6 100644 (file)
@@ -63,7 +63,7 @@ AC_CHECK_HEADERS(sys/vfs.h sys/fs/s5param.h sys/filsys.h termios.h termio.h)
 AC_CHECK_HEADERS(fnmatch.h pwd.h sys/termio.h sys/time.h sys/statfs.h sys/statvfs.h stdarg.h sys/sockio.h)
 AC_CHECK_HEADERS(security/pam_modules.h security/_pam_macros.h dlfcn.h)
 AC_CHECK_HEADERS(sys/syslog.h syslog.h)
-AC_CHECK_HEADERS(stdint.h locale.h)
+AC_CHECK_HEADERS(stdint.h inttypes.h locale.h)
 AC_CHECK_HEADERS(shadow.h netdb.h netinet/in.h netinet/ip.h netinet/tcp.h netinet/in_systm.h netinet/in_ip.h)
 AC_CHECK_HEADERS(nss.h nss_common.h ns_api.h sys/security.h security/pam_appl.h)
 AC_CHECK_HEADERS(sys/capability.h syscall.h sys/syscall.h)
index 448e4292aa4c4f73c7b7ca001ab5214988c1d8ab..7811ca19651122435f06695f21178bc7789b4e05 100644 (file)
@@ -852,7 +852,7 @@ int samdb_msg_add_uint(struct ldb_context *sam_ldb, TALLOC_CTX *mem_ctx, struct
 int samdb_msg_add_int64(struct ldb_context *sam_ldb, TALLOC_CTX *mem_ctx, struct ldb_message *msg,
                        const char *attr_name, int64_t v)
 {
-       const char *s = talloc_asprintf(mem_ctx, "%lld", v);
+       const char *s = talloc_asprintf(mem_ctx, "%PRIi64", v);
        return samdb_msg_add_string(sam_ldb, mem_ctx, msg, attr_name, s);
 }
 
@@ -862,7 +862,7 @@ int samdb_msg_add_int64(struct ldb_context *sam_ldb, TALLOC_CTX *mem_ctx, struct
 int samdb_msg_add_uint64(struct ldb_context *sam_ldb, TALLOC_CTX *mem_ctx, struct ldb_message *msg,
                        const char *attr_name, uint64_t v)
 {
-       const char *s = talloc_asprintf(mem_ctx, "%llu", v);
+       const char *s = talloc_asprintf(mem_ctx, "%PRIu64", v);
        return samdb_msg_add_string(sam_ldb, mem_ctx, msg, attr_name, s);
 }
 
index 88ee4af3b05d4fdef46e249d50bc8dde66ac631d..58799d9b8696654892ccef9f9a22f04c73c952cd 100644 (file)
 #include <stdint.h>
 #endif
 
+#ifdef HAVE_INTTYPES_H
+#include <inttypes.h>
+#endif
+
 #ifdef HAVE_STRING_H
 #include <string.h>
 #endif