Re: glib on Symbian
- From: "Tor Lillqvist" <tml iki fi>
- To: sparkymat <csy0013 googlemail com>
- Cc: Biswajeet Dash symbian com, gtk+ dev <gtk-devel-list gnome org>
- Subject: Re: glib on Symbian
- Date: Fri, 5 Sep 2008 14:02:26 +0300
> For example, in gdate.c,
>
> static gboolean using_twodigit_years = FALSE;
>
> would become
>
> #if defined(__SYMBIAN32__) && defined(EMULATOR)
> PLS(using_twodigit_years,gdate, gboolean)
> #define using_twodigit_years (*FUNCTION_NAME(using_twodigit_years
> ,gdate)()
> #else
> static gboolean using_twodigit_years = FALSE;
> #endif
OK, I see, I think it would be cleaner to do it like this: in gdate.c
the only change would be to have:
GLIB_STATIC (gboolean, using_twodigit_years, FALSE);
and then have the GLIB_STATIC macro defined in some suitable header:
#if defined(__SYMBIAN32__) && defined(EMULATOR)
# define GLIB_STATIC(type, name, initvalue) \
PLS(name, type) \
static type PTR_name(void) \
{ \
static type value = initvalue; \
return &value; \
}
#else
# define GLIB_STATIC(type, name, initvalue) type name = initvalue
#endif
and then have a preprocessing script that changes all occurences of
identifiers that are seen in GLIB_STATIC() macros to
(*PTR_identiifier) instead, i.e. for instance it would change all uses
of using_twodigit_years to *(PTR_using_twodigit_years) after it sees
the GLIB_STATIC (gboolean, using_twodigit_years, FALSE) in gdate.c
(This is just a quick sketch, no idea if it actually would work in
general, etc.)
--tml
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]