[gthumb-list] Patch for FreeBSD building (2.14.3)




Here is a small patch that seems to correct the 2.14.3 build problem
for FreeBSD that I just reported.

I misspoke earlier when I said that HAVE_TM_GMTOFF was not getting defined.
in fact it appears that this symbol _is_ being properly defined within the
config.h file under FreeBSD.

Please note that this patch moves the reference to `timezone' down to a
more appropriate place in the code, and also, this patch provides a reasonable
default value (i.e. zero) to be used for the timezone offset (from GMT) for
systems that have neither a tm_gmtoff field in their struct tm structures
nor a timezone variable in libc.

It is, I believe clearly preferable to have at least some default value in
such cases, you know, rather than just using the (ramdom and uninitialized)
value of the local `offset' variable.


Regards,
rfg


P.S.  Even after this patch I am still encountering build problems with 2.14.3
on FreeBSD, but I will report on those later.


diff -rc2 gthumb/glib-utils.c gthumb/glib-utils.c
*** gthumb/glib-utils.c 2012-03-24 09:28:46.000000000 -0700
--- gthumb/glib-utils.c 2012-04-24 13:48:48.000000000 -0700
***************
*** 553,560 ****
        int offset;
  
-       offset = -timezone;
  #if defined (HAVE_TM_GMTOFF)
        offset = tm->tm_gmtoff;
  #elif defined (HAVE_TIMEZONE)
        if (tm->tm_isdst > 0) {
    #if defined (HAVE_ALTZONE)
--- 553,560 ----
        int offset;
  
  #if defined (HAVE_TM_GMTOFF)
        offset = tm->tm_gmtoff;
  #elif defined (HAVE_TIMEZONE)
+       offset = -timezone;
        if (tm->tm_isdst > 0) {
    #if defined (HAVE_ALTZONE)
***************
*** 565,568 ****
--- 565,570 ----
        } else
                offset = -timezone;
+ #else
+       offset = 0;
  #endif
  



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