MyReadLocation(&machineLocation);   if (machineLocation.u.dlsDelta != 0) { JSLL_UI2L(us2s, PRMJ_USEC_PER_SEC);  JSLL_UI2L(dlsOffset, PRMJ_HOUR_SECONDS);   JSLL_MUL(dlsOffset, dlsOffset, us2s); } else { JSLL_I2L(dlsOffset, 0);
UInt32 macLocalSeconds = (local_time / PRMJ_USEC_PER_SEC) + gJanuaryFirst1970Seconds, utcSeconds; ConvertLocalTimeToUTC(macLocalSeconds, &utcSeconds); if ((utcSeconds - macLocalSeconds) == PRMJ_LocalGMTDifference()) return 0; else { JSLL_UI2L(us2s, PRMJ_USEC_PER_SEC); JSLL_UI2L(dlsOffset, PRMJ_HOUR_SECONDS); JSLL_MUL(dlsOffset, dlsOffset, us2s); return dlsOffset;
PRMJ_DSTOffset(JSInt64 local_time){    JSInt64 us2s;#ifdef XP_MAC    MachineLocation  machineLocation;    JSInt64 dlsOffset;    /*	Get the information about the local machine, including     *	its GMT offset and its daylight savings time info.     *	Convert each into wides that we can add to     *	startupTimeMicroSeconds.     */    MyReadLocation(&machineLocation);    /* Is Daylight Savings On?  If so, we need to add an hour to the offset. */    if (machineLocation.u.dlsDelta != 0) {	JSLL_UI2L(us2s, PRMJ_USEC_PER_SEC); /* seconds in a microseconds */	JSLL_UI2L(dlsOffset, PRMJ_HOUR_SECONDS);  /* seconds in one hour       */	JSLL_MUL(dlsOffset, dlsOffset, us2s);    } else {	JSLL_I2L(dlsOffset, 0);    }    return(dlsOffset);#else    time_t local;    JSInt32 diff;    JSInt64  maxtimet;    struct tm tm;    PRMJTime prtm;#if ( defined( USE_AUTOCONF ) && !defined( HAVE_LOCALTIME_R) ) || ( !defined ( USE_AUTOCONF ) && ( defined( XP_PC ) || defined( __FreeBSD__ ) || defined ( HPUX9 ) || defined ( SNI ) || defined ( NETBSD ) || defined ( OPENBSD ) || defined( RHAPSODY ) ) )    struct tm *ptm;#endif    JSLL_UI2L(us2s, PRMJ_USEC_PER_SEC);    JSLL_DIV(local_time, local_time, us2s);    /* get the maximum of time_t value */    JSLL_UI2L(maxtimet,PRMJ_MAX_UNIX_TIMET);    if(JSLL_CMP(local_time,>,maxtimet)){      JSLL_UI2L(local_time,PRMJ_MAX_UNIX_TIMET);    } else if(!JSLL_GE_ZERO(local_time)){      /*go ahead a day to make localtime work (does not work with 0) */      JSLL_UI2L(local_time,PRMJ_DAY_SECONDS);    }    JSLL_L2UI(local,local_time);    PRMJ_basetime(local_time,&prtm);#if ( defined( USE_AUTOCONF ) && !defined( HAVE_LOCALTIME_R) ) || ( !defined ( USE_AUTOCONF ) && ( defined( XP_PC ) || defined( __FreeBSD__ ) || defined ( HPUX9 ) || defined ( SNI ) || defined ( NETBSD ) || defined ( OPENBSD ) || defined( RHAPSODY ) ) )    ptm = localtime(&local);    if(!ptm){      return JSLL_ZERO;    }    tm = *ptm;#else    localtime_r(&local,&tm); /* get dst information */#endif    diff = ((tm.tm_hour - prtm.tm_hour) * PRMJ_HOUR_SECONDS) +	((tm.tm_min - prtm.tm_min) * 60);    if(diff < 0){	diff += PRMJ_DAY_SECONDS;    }    JSLL_UI2L(local_time,diff);    JSLL_MUL(local_time,local_time,us2s);    return(local_time);#endif}