/* 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
*
extern int ccode_line;
extern int line_no;
+extern gboolean for_cpp;
extern char *yytext;
root, prop->name);
g_free (cast);
} else if (strcmp (prop->gtktype, "BOXED") == 0) {
+ char *type = make_me_type (prop->extra_gtktype,
+ "G_TYPE_BOXED");
if (prop->extra_gtktype == NULL) {
error_print (GOB_ERROR, prop->line_no,
_("Property linking requested for BOXED, but "
"} "
"}",
root, prop->name,
- prop->extra_gtktype,
+ type,
root, prop->name,
- prop->extra_gtktype,
+ type,
root, prop->name);
get = g_strdup_printf("g_value_set_boxed (VAL, %s->%s);",
root, prop->name);
+ g_free (type);
} else {
char *set_func;
char *get_func;
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);",