[kaffe] CVS kaffe (riccardo): rationalized includes
Kaffe CVS
cvs-commits at kaffe.org
Thu Aug 18 16:40:34 PDT 2005
PatchSet 6840
Date: 2005/08/18 22:49:18
Author: riccardo
Branch: HEAD
Tag: (none)
Log:
rationalized includes
Members:
ChangeLog:1.4364->1.4365
config/config-std.h:1.16->1.17
libraries/clib/native/TimeZone.c:INITIAL->1.8
Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.4364 kaffe/ChangeLog:1.4365
--- kaffe/ChangeLog:1.4364 Thu Aug 18 22:31:21 2005
+++ kaffe/ChangeLog Thu Aug 18 22:49:18 2005
@@ -1,3 +1,9 @@
+2005-08-18 Riccardo Mottola <riccardo at kaffe.org>
+
+ Rationalized includes by decentralizing them to the .c files
+ config/config-std.h
+ libraries/clib/native/TimeZone.c
+
2005-08-18 Andreas Tobler <a.tobler at schweiz.ch>
* kaffe/kaffevm/jni/jni.c: Fix clobbering warnings all over.
@@ -22,6 +28,7 @@
Reported by: Riccardo Mottola <riccardo at kaffe.org>
2005-08-18 Riccardo Mottola <riccardo at kaffe.org>
+
* kaffe/kaffe/kaffevm/access.c: proper system header include
2005-08-18 Dalibor Topic <robilad at kaffe.org>
Index: kaffe/config/config-std.h
diff -u kaffe/config/config-std.h:1.16 kaffe/config/config-std.h:1.17
--- kaffe/config/config-std.h:1.16 Tue Jun 21 16:11:56 2005
+++ kaffe/config/config-std.h Thu Aug 18 22:49:21 2005
@@ -4,6 +4,10 @@
* Copyright (c) 1996, 1997
* Transvirtual Technologies, Inc. All rights reserved.
*
+ * Copyright (c) 2005
+ * Kaffe.org contributors, see ChangeLog for details. All rights reserved.
+ *
+ *
* See the file "license.terms" for information on usage and redistribution
* of this file.
*/
@@ -19,24 +23,7 @@
#include "config.h"
-#if defined(HAVE_STRING_H)
-#include <string.h>
-#endif
-#if defined(HAVE_UNISTD_H)
-#include <unistd.h>
-#endif
-#if defined (HAVE_TIME_H)
-#include <time.h>
-#endif
-#if defined(HAVE_SYS_TIME_H)
-#include <sys/time.h>
-#endif
-#if defined(HAVE_SYS_TYPES_H)
-#include <sys/types.h>
-#endif
-#if defined(HAVE_SYS_RESOURCE_H)
-#include <sys/resource.h>
-#endif
+
#if !defined (__CYGWIN__)
#if !defined(HAVE_WINDOWS_H) && defined(HAVE_WINNT_H)
#include <winnt.h>
===================================================================
Checking out kaffe/libraries/clib/native/TimeZone.c
RCS: /home/cvs/kaffe/kaffe/libraries/clib/native/TimeZone.c,v
VERS: 1.8
***************
--- /dev/null Sun Aug 4 19:57:58 2002
+++ kaffe/libraries/clib/native/TimeZone.c Thu Aug 18 23:40:34 2005
@@ -0,0 +1,45 @@
+/*
+ * java.util.TimeZone.c
+ *
+ * Copyright (c) 2003, 2004
+ * The Kaffe.org's team.
+ *
+ * See the file "license.terms" for information on usage and redistribution
+ * of this file.
+ *
+ * PORTABILITY NOTES
+ * tm->tm_zone is the preferred way to access time zone name
+ * on other sytem the use of the external
+ * extern char *tzname[]
+ * is attempted.
+ * On some systems the external symbol is present in the libc but is not exported in the headers
+ * I suggest in that case to put it in the respective md.h of that platform.
+ */
+#include "config.h"
+#include "config-std.h"
+
+#if defined (HAVE_TIME_H)
+#include <time.h>
+#endif
+
+#include <native.h>
+#include "java_util_VMTimeZone.h"
+
+struct Hjava_lang_String*
+java_util_VMTimeZone_getSystemTimeZoneId(void)
+{
+ char *tempZoneName = NULL;
+#if defined(HAVE_TM_ZONE)
+ struct tm *tempTimeStruct;
+ time_t tempTimeArithm;
+
+ tempTimeArithm = 0;
+ tempTimeStruct = localtime (&tempTimeArithm);
+ tempZoneName = tempTimeStruct->tm_zone;
+#elif defined(HAVE_TZNAME)
+ tzset();
+ tempZoneName = tzname[0]; /* read above for this external symbol */
+#endif /* defined(HAVE_TM_ZONE) */
+ assert(tempZoneName != NULL);
+ return stringC2Java(tempZoneName);
+}
More information about the kaffe
mailing list