This file notes some issues concerning how make Glade portable to different operating systems. (Note that this also applies to source code generated by Glade.) Type Conversion =============== If you need to convert gpointers to gints/guints and vice versa use the macros GPOINTER_TO_INT, GINT_TO_POINTER, GPOINTER_TO_UINT, GUINT_TO_POINTER, otherwise there are problems on Alphas. (These are defined in glib/glib.h) e.g. instead of: index = (gint) selection->data; use: index = GPOINTER_TO_INT (selection->data); Strings ======= If you need to include strings in the code which span multiple lines, don't use embedded newlines. e.g. instead of: fprintf(data->cfp, "#include #include \"%s\" #include \"%s\"\n\n", data->signal_h_filename, data->main_h_filename); use: fprintf(data->cfp, "#include \n" "#include \"%s\"\n" "#include \"%s\"\n\n", data->signal_h_filename, data->main_h_filename); (The compiler concatenates them into one string.) (gettext also prefers strings like this) Don't use the result of sprintf() or its relatives (A problem occurred when compiling on a Sparc LX + SunOS 4.1.3C + gcc 2.7.2.1). e.g. instead of: pos += sprintf (pos, "%i", count); use: sprintf (pos, "%i", count); pos += strlen (pos); Library Functions ================= I'm not too sure on this issue yet. Try to only use standard functions such as strlen(), strcmp() etc. (see if GTK uses it.) If you are unsure of the portability of a function make a note of it somewhere (in a comment at the top of the file?). Miscellaneous ============= Don't use special features of gcc, such as dynamic initializers: GList glist = { current_child, NULL, NULL }; Use this instead: GList glist = { NULL, NULL, NULL }; glist.data = current_child; Don't use empty structs. Damon, 8 July 1998.