[prev in list] [next in list] [prev in thread] [next in thread]
List: freedesktop-dbus
Subject: [PATCH] Avoid -ansi warnings for long long (part of #717)
From: Simon McVittie <simon.mcvittie () collabora ! co ! uk>
Date: 2007-10-10 12:48:08
Message-ID: 20071010124808.GB4762 () carbon ! pseudorandom ! co ! uk
[Download RAW message or body]
[Attachment #2 (multipart/signed)]
[Attachment #4 (multipart/mixed)]
See attached.
["0010-Add-macro-DBUS_GNUC_EXTENSION-the-same-as-GLib-s-G_.patch" (text/x-diff)]
From 8725f91d5cb75abf9baef31e68a6bd207697378f Mon Sep 17 00:00:00 2001
From: Simon McVittie <simon.mcvittie@collabora.co.uk>
Date: Wed, 10 Oct 2007 13:02:57 +0100
Subject: [PATCH] Add macro DBUS_GNUC_EXTENSION (the same as GLib's G_GNUC_EXTENSION)
Part of a fix for bug 717.
---
dbus/dbus-macros.h | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/dbus/dbus-macros.h b/dbus/dbus-macros.h
index 461dff3..1ed6ea7 100644
--- a/dbus/dbus-macros.h
+++ b/dbus/dbus-macros.h
@@ -58,6 +58,12 @@
# define DBUS_DEPRECATED
#endif
+#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 8)
+# define DBUS_GNUC_EXTENSION __extension__
+#else
+# define DBUS_GNUC_EXTENSION
+#endif
+
/* Normally docs are in .c files, but there isn't a .c file for this. */
/**
* @defgroup DBusMacros Utility macros
@@ -118,6 +124,12 @@
* Please don't use this in your own code, consider it
* D-Bus internal.
*/
+/**
+ * @def DBUS_GNUC_EXTENSION
+ *
+ * Tells gcc not to warn about extensions to the C standard in the
+ * following expression, even if compiling with -pedantic.
+ */
/** @} */
--
1.5.3.4
["0011-Use-DBUS_GNUC_EXTENSION-to-avoid-ansi-pedantic-war.patch" (text/x-diff)]
From 4513223f370034aef60b7cbedc32b44c00b4a3e5 Mon Sep 17 00:00:00 2001
From: Simon McVittie <simon.mcvittie@collabora.co.uk>
Date: Wed, 10 Oct 2007 13:04:08 +0100
Subject: [PATCH] Use DBUS_GNUC_EXTENSION to avoid -ansi -pedantic warnings about use of long long. (#717)
---
dbus/dbus-arch-deps.h.in | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/dbus/dbus-arch-deps.h.in b/dbus/dbus-arch-deps.h.in
index 2a02a7f..65d406a 100644
--- a/dbus/dbus-arch-deps.h.in
+++ b/dbus/dbus-arch-deps.h.in
@@ -33,8 +33,8 @@ DBUS_BEGIN_DECLS
#if @DBUS_HAVE_INT64@
#define DBUS_HAVE_INT64 1
-typedef @DBUS_INT64_TYPE@ dbus_int64_t;
-typedef unsigned @DBUS_INT64_TYPE@ dbus_uint64_t;
+DBUS_GNUC_EXTENSION typedef @DBUS_INT64_TYPE@ dbus_int64_t;
+DBUS_GNUC_EXTENSION typedef unsigned @DBUS_INT64_TYPE@ dbus_uint64_t;
#define DBUS_INT64_CONSTANT(val) @DBUS_INT64_CONSTANT@
#define DBUS_UINT64_CONSTANT(val) @DBUS_UINT64_CONSTANT@
--
1.5.3.4
["0016-dbus-dbus-arch-deps.h.in-also-use-DBUS_GNUC_EXTENSI.patch" (text/x-diff)]
From 37b8e5fbcd8e62b8818ad7ac832aa55c6f85cde1 Mon Sep 17 00:00:00 2001
From: Simon McVittie <simon.mcvittie@collabora.co.uk>
Date: Wed, 10 Oct 2007 13:37:48 +0100
Subject: [PATCH] dbus/dbus-arch-deps.h.in: also use DBUS_GNUC_EXTENSION for \
DBUS_INT64_CONSTANT and UINT64 equivalent
---
dbus/dbus-arch-deps.h.in | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/dbus/dbus-arch-deps.h.in b/dbus/dbus-arch-deps.h.in
index 65d406a..a5180bd 100644
--- a/dbus/dbus-arch-deps.h.in
+++ b/dbus/dbus-arch-deps.h.in
@@ -36,8 +36,8 @@ DBUS_BEGIN_DECLS
DBUS_GNUC_EXTENSION typedef @DBUS_INT64_TYPE@ dbus_int64_t;
DBUS_GNUC_EXTENSION typedef unsigned @DBUS_INT64_TYPE@ dbus_uint64_t;
-#define DBUS_INT64_CONSTANT(val) @DBUS_INT64_CONSTANT@
-#define DBUS_UINT64_CONSTANT(val) @DBUS_UINT64_CONSTANT@
+#define DBUS_INT64_CONSTANT(val) (DBUS_GNUC_EXTENSION @DBUS_INT64_CONSTANT@)
+#define DBUS_UINT64_CONSTANT(val) (DBUS_GNUC_EXTENSION @DBUS_UINT64_CONSTANT@)
#else
#undef DBUS_HAVE_INT64
--
1.5.3.4
["signature.asc" (application/pgp-signature)]
_______________________________________________
dbus mailing list
dbus@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dbus
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic