patch2 darwin & libgcj

Tom Tromey tromey@redhat.com
Tue Jan 1 15:47:00 GMT 2002


>>>>> "Andreas" == Andreas Tobler <toa@pop.agri.ch> writes:

Andreas> P.S, I don't send the configure diff since I'm not sure about
Andreas> it. Do I have to provide this or is anyone else able to
Andreas> update it?

I'll regenerate configure when I check in the patch.  Don't send
configure diffs, as they just hide the real patch.

Andreas> +// check if a system has tzname or not. Not sure how to handle else
Andreas> +// darwin does not have the tzname so I tried a hack, need help here
Andreas> +// a.tobler@schweiz.ch 29122001
Andreas> +#ifdef HAVE_TZNAME
Andreas>    tzinfo = tzname;
Andreas> +#elif HAVE_TM_ZONE
Andreas> +  tzinfo = &tim->tm_zone;
Andreas> +#else
Andreas> + //what to do else ? 
Andreas> +#error neither tzname nor tm_zone defined
Andreas> +#endif

You want to check HAVE_TM_ZONE first.
If we have that then I think we want to use that as the main time
zone.
So you'd end up with something like:

      char *tz1, *tz2;
    #ifdef HAVE_TM_ZONE
      tz1 = tim->tm_zone;
      tz2 = NULL;
    #elif defined (HAVE_TZNAME)
      tz1 = tzname[0];
      tz2 = strcmp (tzname[0], tzname[1]) ? tzname[1] : NULL;
    #else
    #error etc
    #endif

Then change the remaining code in the method to use tz1 and tz2
instead of tzinfo (in fact, delete tzinfo).  Could you change the
patch to do this and resend it?

Tom



More information about the Gcc-patches mailing list