summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2005-07-22 11:16:32 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:29:57 -0500
commita33c02612ad12b27ba2da1d3b9be0fb9bb339367 (patch)
tree7da362a7344e51b7f8bbe9afbeed3db04bb2af40
parent2c457eca252fd62a3429ca3db172b85c534bd2d7 (diff)
downloadsamba-a33c02612ad12b27ba2da1d3b9be0fb9bb339367.tar.gz
samba-a33c02612ad12b27ba2da1d3b9be0fb9bb339367.tar.bz2
samba-a33c02612ad12b27ba2da1d3b9be0fb9bb339367.zip
r8713: Experiment to try and fix warnings on 64-bit machines without breaking
32-bit ones. Yes, this weird looking macros are part of C99. (This used to be commit 7b316f119b8486b75ebe63b185c50fab82313e58)
-rw-r--r--source4/build/m4/rewrite.m42
-rw-r--r--source4/dsdb/samdb/samdb.c4
-rw-r--r--source4/include/includes.h4
3 files changed, 7 insertions, 3 deletions
diff --git a/source4/build/m4/rewrite.m4 b/source4/build/m4/rewrite.m4
index 35482b6cec..fd19de5d17 100644
--- a/source4/build/m4/rewrite.m4
+++ b/source4/build/m4/rewrite.m4
@@ -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)
diff --git a/source4/dsdb/samdb/samdb.c b/source4/dsdb/samdb/samdb.c
index 448e4292aa..7811ca1965 100644
--- a/source4/dsdb/samdb/samdb.c
+++ b/source4/dsdb/samdb/samdb.c
@@ -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);
}
diff --git a/source4/include/includes.h b/source4/include/includes.h
index 88ee4af3b0..58799d9b86 100644
--- a/source4/include/includes.h
+++ b/source4/include/includes.h
@@ -47,6 +47,10 @@
#include <stdint.h>
#endif
+#ifdef HAVE_INTTYPES_H
+#include <inttypes.h>
+#endif
+
#ifdef HAVE_STRING_H
#include <string.h>
#endif