mixing (exclusively) g_malloc and malloc, gint, and int



I'm working on some software to plot cellular automata (CA). I don't want to use gint or g_malloc in my CA code because then I would have to include the gtk libraries if I ever wanted to use the CA code out of the context of this app.

Is there something which will always be defined when a glib using app is compiled? then maybe I could add something to the CA c file like:

#ifndef GLIB
#define g_malloc malloc
#define gint int
#endif

then I could use g_malloc and gint in the code and it wouldn't matter if the libraries were not linked.

cali



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