]> git.draconx.ca Git - gob-dx.git/blobdiff - src/parse.y
Release 2.0.9
[gob-dx.git] / src / parse.y
index 917476aa9e6d51799752abdf2a530e19f704186b..ded33fd4bc9e361e8f64f77845aa5b97da5d32a3 100644 (file)
@@ -1,6 +1,7 @@
 /* GOB C Preprocessor
  * Copyright (C) 1999-2000 the Free Software Foundation.
- * Copyright (C) 2001 George Lebl
+ * Copyright (C) 2000 Eazel, Inc.
+ * Copyright (C) 2001-2004 George (Jiri) Lebl
  *
  * Author: George Lebl
  *
@@ -77,6 +78,7 @@ int yylex(void);
 
 extern int ccode_line;
 extern int line_no;
+extern gboolean for_cpp;
 
 extern char *yytext;
 
@@ -551,14 +553,16 @@ property_link_and_export (Node *node)
                        get_func = g_strdup_printf ("g_value_get_%s", prop->gtktype);
                        g_strdown (get_func);
 
-                       if (strcmp (prop->gtktype, "FLAGS") == 0) {
-                               setcast = "(guint) ";
-                               getcast = to_free =
-                                       get_prop_enum_flag_cast (prop);
-                       } else if (strcmp (prop->gtktype, "ENUM") == 0) {
-                               setcast = "(gint) ";
-                               getcast = to_free =
-                                       get_prop_enum_flag_cast (prop);
+                       if (for_cpp) {
+                               if (strcmp (prop->gtktype, "FLAGS") == 0) {
+                                       setcast = "(guint) ";
+                                       getcast = to_free =
+                                               get_prop_enum_flag_cast (prop);
+                               } else if (strcmp (prop->gtktype, "ENUM") == 0) {
+                                       setcast = "(gint) ";
+                                       getcast = to_free =
+                                               get_prop_enum_flag_cast (prop);
+                               }
                        }
 
                        set = g_strdup_printf("%s->%s = %s%s (VAL);",