dbus-protocol.h: compile under C++11
authorMarc Mutz <marc.mutz@kdab.com>
Thu, 16 Feb 2012 07:43:40 +0000 (08:43 +0100)
committerSimon McVittie <simon.mcvittie@collabora.co.uk>
Mon, 20 Feb 2012 11:23:15 +0000 (11:23 +0000)
C++11 compilers have a feature called 'user-defined string literals' which
allow arbitrary string suffixes to have user-defined meaning.

This makes code that concatenates macros with string literals without
intervening whitespace illegal under C++11. Fortunately, string literal
concatenation has allowed intervening whitespace since the dawn of time,
so the solution is to simply pad with spaces.

Tested (header) with GCC 4.7 (trunk).

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=46147
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
dbus/dbus-protocol.h

index 8aa15e5..60605ab 100644 (file)
@@ -456,7 +456,7 @@ extern "C" {
 /** XML system identifier of the introspection format version 1.0 */
 #define DBUS_INTROSPECT_1_0_XML_SYSTEM_IDENTIFIER "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd"
 /** XML document type declaration of the introspection format version 1.0 */
-#define DBUS_INTROSPECT_1_0_XML_DOCTYPE_DECL_NODE "<!DOCTYPE node PUBLIC \""DBUS_INTROSPECT_1_0_XML_PUBLIC_IDENTIFIER"\"\n\""DBUS_INTROSPECT_1_0_XML_SYSTEM_IDENTIFIER"\">\n"
+#define DBUS_INTROSPECT_1_0_XML_DOCTYPE_DECL_NODE "<!DOCTYPE node PUBLIC \"" DBUS_INTROSPECT_1_0_XML_PUBLIC_IDENTIFIER "\"\n\"" DBUS_INTROSPECT_1_0_XML_SYSTEM_IDENTIFIER "\">\n"
 
 /** @} */