56 |
|
|
57 |
#include "java_util_VMTimeZone.h" |
#include "java_util_VMTimeZone.h" |
58 |
|
|
59 |
size_t jint_to_charbuf (char* bufend, jint num); |
static size_t jint_to_charbuf (char* bufend, jint num); |
60 |
|
|
61 |
/** |
/** |
62 |
* This method returns a time zone id string which is in the form |
* This method returns a time zone id string which is in the form |
75 |
* TimeZone object. |
* TimeZone object. |
76 |
*/ |
*/ |
77 |
JNIEXPORT jstring JNICALL |
JNIEXPORT jstring JNICALL |
78 |
Java_java_util_VMTimeZone_getSystemTimeZoneId(JNIEnv *env, jclass clazz) |
Java_java_util_VMTimeZone_getSystemTimeZoneId(JNIEnv *env, |
79 |
|
jclass clazz |
80 |
|
__attribute__ ((__unused__))) |
81 |
{ |
{ |
82 |
struct tm tim; |
struct tm tim; |
83 |
#ifndef HAVE_LOCALTIME_R |
#ifndef HAVE_LOCALTIME_R |
149 |
to get GMT. */ |
to get GMT. */ |
150 |
tzoffset = -1L * tim.tm_gmtoff; |
tzoffset = -1L * tim.tm_gmtoff; |
151 |
#elif HAVE_UNDERSCORE_TIMEZONE |
#elif HAVE_UNDERSCORE_TIMEZONE |
152 |
tzoffset = _timezone; |
/* On some systems _timezone is actually defined as time_t. */ |
153 |
|
tzoffset = (long) _timezone; |
154 |
#elif HAVE_TIMEZONE |
#elif HAVE_TIMEZONE |
155 |
/* timezone is secs WEST of UTC. */ |
/* timezone is secs WEST of UTC. */ |
156 |
tzoffset = timezone; |
tzoffset = timezone; |