Re: libgnome goption argument parsing and ABI stability



On Sun, 2006-01-15 at 20:35 +0100, Christian Persch wrote:
> Hi,
> 
> libgnome's gnome_program_init now supports GOption argument parsing. The
> gnome modules supply their GOptionGroup*'s via a hook func in the
> GnomeModuleInfo struct. The question in
> http://bugzilla.gnome.org/show_bug.cgi?id=326846 is now whether we can
> ABI-compatibly use a function pointer of type
> 
> typedef GOptionGroup* (*GnomeModuleGetGOptionGroupFunc) (void)
> 
> in the GnomeModuleInfo structure instead of gpointer
> (libgnome/libgnome/gnome-program.h):
> 
> -    gpointer    expansion1;
> +    GnomeModuleGetGOptionGroupFunc get_goption_group_func;
Looks ok on x86 I think...

$ uname -m
i686
$ cat abitest.c
#include <stdio.h>

typedef void (* fptr)(void);

int main(int argc, char *argv) {
        printf("sizeof(void *) == %d\n", sizeof(void *));
        printf("sizeof(fptr) == %d\n", sizeof(fptr));

        return 0;
}

$ gcc -o abitest abitest.c
$ ./abitest
sizeof(void *) == 4
sizeof(fptr) == 4


But I guess you knew that already ^o)

Ikke




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