X-Git-Url: http://git.draconx.ca/gitweb/gob-dx.git/blobdiff_plain/b3db2950b11fc5f3abd9ecdae855746e2d19c836..573256d3bc21896c54c511d5c0e6927f09b4209e:/src/parse.y diff --git a/src/parse.y b/src/parse.y index 917476a..ded33fd 100644 --- a/src/parse.y +++ b/src/parse.y @@ -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);",