glib configure checks for the system support of the function clock_gettime and of the definition _POSIX_MONOTONIC_CLOCK to be >= 0, but in FreeBSD the latter is defined as -1 the code in gtimer.c checks for both HAVE_CLOCK_GETTIME and HAVE_MONOTONIC_CLOCK to be defined in order to use clock_gettime() and the struct timespec over struct timeval, defining USE_CLOCK_GETTIME to do so. But in the line 260 of gtimer.c instead of continue using USE_CLOCK_GETTIME to enable this functionality it uses HAVE_CLOCK_GETTIME, raising the following errors on Gentoo/FreeBSD: gtimer.c: In function 'IA__g_timer_elapsed': gtimer.c:264: error: 'struct timeval' has no member named 'tv_nsec' gtimer.c:264: error: 'struct timeval' has no member named 'tv_nsec' gtimer.c:266: error: 'struct timeval' has no member named 'tv_nsec' gtimer.c:270: error: 'struct timeval' has no member named 'tv_nsec' gtimer.c:270: error: 'struct timeval' has no member named 'tv_nsec' gtimer.c:270: error: 'struct timeval' has no member named 'tv_nsec' gtimer.c:273: error: 'struct timeval' has no member named 'tv_nsec' gtimer.c:282: error: 'struct timeval' has no member named 'tv_nsec' (as in without USE_CLOCK_GETTIME the GTimer variable is defined as struct timeval, which has the member tv_usec, but with USE_CLOCK_GETTIME it is defined as struct timespec, which has the member named tv_nsec)
Created attachment 99185 [details, diff] glib-2.12.4-clock_gettime.patch Proposed patch to fix this problem.
Fixed without revbump (build issue). Thanks!