[gom] gom: Fix build with C++ compilers



commit a371f7f3a39634654a3a9dc39ab39aeb25a6bced
Author: Jonathon Jongsma <jjongsma redhat com>
Date:   Thu May 8 14:05:26 2014 -0500

    gom: Fix build with C++ compilers
    
    By moving enum typedefs after the enum definition.
    
    Putting the typedefs above the enum makes compilation fail for C++ programs. Example error:
    
    /gom-filter.h:38:14: error: use of enum ‘_GomFilterMode’ without previous declaration
     typedef enum   _GomFilterMode    GomFilterMode;
                   ^
    
    https://bugzilla.gnome.org/show_bug.cgi?id=729831

 gom/gom-error.h  |    4 ++--
 gom/gom-filter.h |   10 +++++-----
 2 files changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/gom/gom-error.h b/gom/gom-error.h
index d2569f5..0c5f816 100644
--- a/gom/gom-error.h
+++ b/gom/gom-error.h
@@ -25,8 +25,6 @@ G_BEGIN_DECLS
 
 #define GOM_ERROR                  (gom_error_quark())
 
-typedef enum _GomError GomError;
-
 enum _GomError
 {
     GOM_ERROR_ADAPTER_OPEN,
@@ -37,6 +35,8 @@ enum _GomError
     GOM_ERROR_COMMAND_NO_REPOSITORY
 };
 
+typedef enum _GomError GomError;
+
 GQuark    gom_error_quark    (void) G_GNUC_CONST;
 GType     gom_error_get_type (void) G_GNUC_CONST;
 
diff --git a/gom/gom-filter.h b/gom/gom-filter.h
index 98c9486..62a9de9 100644
--- a/gom/gom-filter.h
+++ b/gom/gom-filter.h
@@ -32,11 +32,6 @@ G_BEGIN_DECLS
 #define GOM_IS_FILTER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass),  GOM_TYPE_FILTER))
 #define GOM_FILTER_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj),  GOM_TYPE_FILTER, GomFilterClass))
 
-typedef struct _GomFilter        GomFilter;
-typedef struct _GomFilterClass   GomFilterClass;
-typedef struct _GomFilterPrivate GomFilterPrivate;
-typedef enum   _GomFilterMode    GomFilterMode;
-
 enum _GomFilterMode
 {
    GOM_FILTER_SQL = 1,
@@ -51,6 +46,11 @@ enum _GomFilterMode
    GOM_FILTER_LIKE
 };
 
+typedef struct _GomFilter        GomFilter;
+typedef struct _GomFilterClass   GomFilterClass;
+typedef struct _GomFilterPrivate GomFilterPrivate;
+typedef enum   _GomFilterMode    GomFilterMode;
+
 struct _GomFilter
 {
    GObject parent;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]