summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmake/config.h.cmake9
-rw-r--r--configure.ac9
2 files changed, 18 insertions, 0 deletions
diff --git a/cmake/config.h.cmake b/cmake/config.h.cmake
index 34592372..4215a903 100644
--- a/cmake/config.h.cmake
+++ b/cmake/config.h.cmake
@@ -6,6 +6,14 @@
/* indicate that we are building with cmake */
#define DBUS_CMAKE 1
+/* On Windows, we expect to be using msvcrt.dll-compatible printf
+ * (%I64u instead of %llu) unless otherwise specified. This must be
+ * done near the beginning of config.h, before we have included any
+ * system headers that might check the value of this macro. */
+#ifndef __USE_MINGW_ANSI_STDIO
+# define __USE_MINGW_ANSI_STDIO 0
+#endif
+
@AUTOPACKAGE_CONFIG_H_TEMPLATE@
/*
@@ -317,4 +325,5 @@
#cmakedefine01 HAVE_DECL_ENVIRON
#cmakedefine01 HAVE_DECL_LOG_PERROR
#cmakedefine01 HAVE_DECL_MSG_NOSIGNAL
+
#endif // _DBUS_CONFIG_H
diff --git a/configure.ac b/configure.ac
index 78f715b5..eb2314f2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1694,6 +1694,15 @@ AH_VERBATIM(_DARWIN_ENVIRON,
#endif
])
+AH_VERBATIM([USE_MINGW_ANSI_STDIO],
+[
+/* On Windows, we expect to be using msvcrt.dll-compatible printf
+ * (%I64u instead of %llu) unless otherwise specified */
+#ifndef __USE_MINGW_ANSI_STDIO
+# define __USE_MINGW_ANSI_STDIO 0
+#endif
+])
+
AC_ARG_ENABLE([stats],
[AS_HELP_STRING([--disable-stats],
[disable bus daemon usage statistics])],