2015-12-08 16:09:02

by Patrik Flykt

[permalink] [raw]
Subject: [PATCH] gdbus: Move typedefs for interwork with strict compilers

From: Grant Erickson <[email protected]>

Move enumeration type defintions AFTER the enumerations themselves are declared
and defined such that the header works with strict compilers.

This occurs when building a plugin, compiled with C++, and occurs on all of:

arm-none-linux-gnueabi-g++ (Sourcery G++ Lite 2010q1-202) 4.4.1
arm-poky-linux-gnueabi-g++ (GCC) 4.8.2
g++ (Ubuntu 4.8.4-2ubuntu1~14.04) 4.8.4
---

Hi,

This patch came up on the ConnMan mailing list, applies to Bluez too.

The patch is rebased to latest upstream and commit message amended with
more information.

Cheers,

Patrik


gdbus/gdbus.h | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/gdbus/gdbus.h b/gdbus/gdbus.h
index 9ece4b0..69fbc10 100644
--- a/gdbus/gdbus.h
+++ b/gdbus/gdbus.h
@@ -31,12 +31,6 @@ extern "C" {
#include <dbus/dbus.h>
#include <glib.h>

-typedef enum GDBusMethodFlags GDBusMethodFlags;
-typedef enum GDBusSignalFlags GDBusSignalFlags;
-typedef enum GDBusPropertyFlags GDBusPropertyFlags;
-typedef enum GDBusSecurityFlags GDBusSecurityFlags;
-typedef enum GDbusPropertyChangedFlags GDbusPropertyChangedFlags;
-
typedef struct GDBusArgInfo GDBusArgInfo;
typedef struct GDBusMethodTable GDBusMethodTable;
typedef struct GDBusSignalTable GDBusSignalTable;
@@ -120,6 +114,12 @@ enum GDbusPropertyChangedFlags {
G_DBUS_PROPERTY_CHANGED_FLAG_FLUSH = (1 << 0),
};

+typedef enum GDBusMethodFlags GDBusMethodFlags;
+typedef enum GDBusSignalFlags GDBusSignalFlags;
+typedef enum GDBusPropertyFlags GDBusPropertyFlags;
+typedef enum GDBusSecurityFlags GDBusSecurityFlags;
+typedef enum GDbusPropertyChangedFlags GDbusPropertyChangedFlags;
+
struct GDBusArgInfo {
const char *name;
const char *signature;
--
2.1.4



2015-12-09 19:40:02

by Patrik Flykt

[permalink] [raw]
Subject: Re: [PATCH] gdbus: Move typedefs for interwork with strict compilers


Hi,

On Wed, 2015-12-09 at 12:24 +0200, Johan Hedberg wrote:
> Hi Patrik,
>
> On Tue, Dec 08, 2015, Patrik Flykt wrote:
> > Move enumeration type defintions AFTER the enumerations themselves are declared
> > and defined such that the header works with strict compilers.
> >
> > This occurs when building a plugin, compiled with C++, and occurs on all of:
> >
> > arm-none-linux-gnueabi-g++ (Sourcery G++ Lite 2010q1-202) 4.4.1
> > arm-poky-linux-gnueabi-g++ (GCC) 4.8.2
> > g++ (Ubuntu 4.8.4-2ubuntu1~14.04) 4.8.4
> > ---
> >
> > Hi,
> >
> > This patch came up on the ConnMan mailing list, applies to Bluez too.
> >
> > The patch is rebased to latest upstream and commit message amended with
> > more information.
>
> Applied. Thanks.
>
> Johan

Thanks. ConnMan ./gdbus is now in sync with Bluez.

Cheers,

Patrik

_______________________________________________
connman mailing list
[email protected]
https://lists.01.org/mailman/listinfo/connman

2015-12-09 10:24:12

by Johan Hedberg

[permalink] [raw]
Subject: Re: [PATCH] gdbus: Move typedefs for interwork with strict compilers

Hi Patrik,

On Tue, Dec 08, 2015, Patrik Flykt wrote:
> Move enumeration type defintions AFTER the enumerations themselves are declared
> and defined such that the header works with strict compilers.
>
> This occurs when building a plugin, compiled with C++, and occurs on all of:
>
> arm-none-linux-gnueabi-g++ (Sourcery G++ Lite 2010q1-202) 4.4.1
> arm-poky-linux-gnueabi-g++ (GCC) 4.8.2
> g++ (Ubuntu 4.8.4-2ubuntu1~14.04) 4.8.4
> ---
>
> Hi,
>
> This patch came up on the ConnMan mailing list, applies to Bluez too.
>
> The patch is rebased to latest upstream and commit message amended with
> more information.

Applied. Thanks.

Johan
_______________________________________________
connman mailing list
[email protected]
https://lists.01.org/mailman/listinfo/connman