Comment 41 for bug 1530229

Revision history for this message
In , Andrew Eikum (aeikum) wrote :

(In reply to Rafał Mużyło from comment #34)
> That check is nevertheless bogus - sizeof(gint64) by design is *always* 8.
>

With the correct glib headers for your architecture, yes, it is always 8. But without setting PKG_CONFIG_PATH to pick up the correct glib-2.0.pc file, it will be wrong. This is what the configure check is for.

[aeikum@aeikum ~]$ cat test.c
#include <stdio.h>
#include <glib-2.0/glib.h>

int main(int argc, char **argv)
{
    printf("%u\n", sizeof(gint64));
    return 0;
}
[aeikum@aeikum ~]$ gcc $(pkg-config --cflags --libs glib-2.0) -o test test.c
[aeikum@aeikum ~]$ ./test
8
[aeikum@aeikum ~]$ gcc -m32 $(pkg-config --cflags --libs glib-2.0) -o test test.c
[aeikum@aeikum ~]$ ./test
4
[aeikum@aeikum ~]$ gcc -m32 $(PKG_CONFIG_PATH=/usr/lib32/pkgconfig pkg-config --cflags --libs glib-2.0) -o test test.c
[aeikum@aeikum ~]$ ./test
8
[aeikum@aeikum ~]$