# HG changeset patch # User Sean Egan # Date 1019426921 0 # Node ID 1fde0667976e912c075e3cf3639188bd5388cf5c # Parent 09e342b27eff77d462bd87b56b8dfd63c6eb6d56 [gaim-migrate @ 3177] Now EVERYBODY can compile! Whee! committer: Tailor Script diff -r 09e342b27eff -r 1fde0667976e acconfig.h --- a/acconfig.h Sun Apr 21 19:05:29 2002 +0000 +++ b/acconfig.h Sun Apr 21 22:08:41 2002 +0000 @@ -23,3 +23,5 @@ #undef STATIC_PROTO_INIT #endif #undef socklen_t +#undef HAVE_TM_GMTOFF +#undef HAVE_TIMEZONE diff -r 09e342b27eff -r 1fde0667976e configure.ac --- a/configure.ac Sun Apr 21 19:05:29 2002 +0000 +++ b/configure.ac Sun Apr 21 22:08:41 2002 +0000 @@ -256,6 +256,35 @@ AC_SUBST(XSS_LIBS) +dnl Shamelessly stolen from gnome-pim +dnl This determines, if struct tm containes tm_gmtoff field +dnl or we should use extern long int timezone. +dnl Actually this should go into acinclude.m4 +AC_DEFUN(GC_TIMEZONE, +[AC_REQUIRE([AC_STRUCT_TM])dnl +AC_CACHE_CHECK([for tm_gmtoff in struct tm], ac_cv_struct_tm_gmtoff, +[AC_TRY_COMPILE([#include +#include <$ac_cv_struct_tm>], [struct tm tm; tm.tm_gmtoff;], + ac_cv_struct_tm_gmtoff=yes, ac_cv_struct_tm_gmtoff=no)]) +if test "$ac_cv_struct_tm_gmtoff" = yes; then + AC_DEFINE(HAVE_TM_GMTOFF) +else + AC_CACHE_CHECK(for timezone, ac_cv_var_timezone, +[AC_TRY_LINK( +changequote(<<, >>)dnl +<<#include +extern long int timezone;>>, +changequote([, ])dnl +[long int l = timezone;], ac_cv_var_timezone=yes, ac_cv_var_timezone=no)]) + if test $ac_cv_var_timezone = yes; then + AC_DEFINE(HAVE_TIMEZONE) + fi +fi +]) + +GC_TIMEZONE + + dnl This was taken straight from X-Chat. dnl X-Chat is the greatest application ever, not only diff -r 09e342b27eff -r 1fde0667976e src/protocols/jabber/jabber.c --- a/src/protocols/jabber/jabber.c Sun Apr 21 19:05:29 2002 +0000 +++ b/src/protocols/jabber/jabber.c Sun Apr 21 22:08:41 2002 +0000 @@ -738,7 +738,17 @@ { t.tm_year -= 1900; t.tm_mon -= 1; - return mktime(&t) - t.tm_gmtoff; + return mktime(&t) + +#ifdef HAVE_TM_GMTOFF + t.tm_gmtoff +#else +# ifdef HAVE_TIMEZONE + timezone +# else + 0 +# endif +#endif + ; } return 0; }