natSystem.cc (init_properties): Call new function _Jv_platform_initProperties.

2002-04-07  Adam King <aking@dreammechanics.com>

	* java/lang/natSystem.cc (init_properties): Call new function
	_Jv_platform_initProperties.
	* win32 (_Jv_platform_initProperties): New function that adds Win32
	support for the System properties os.name, os.arch, os.version,
	user.name, user.home, and user.dir.
	* include/posix.h, include/win32.h, posix.cc: New function
	_Jv_platform_initProperties.

From-SVN: r51989
This commit is contained in:
Adam King 2002-04-07 11:27:00 +00:00 committed by Bryce McKinlay
parent 1abbe5b516
commit 455cd615c2
6 changed files with 167 additions and 16 deletions

View file

@ -333,22 +333,6 @@ java::lang::System::init_properties (void)
SET ("file.encoding", default_file_encoding);
#ifdef WIN32
SET ("file.separator", "\\");
SET ("path.separator", ";");
SET ("line.separator", "\r\n");
SET ("java.io.tmpdir", "C:\\temp");
#else
// Unix.
SET ("file.separator", "/");
SET ("path.separator", ":");
SET ("line.separator", "\n");
char *tmpdir = ::getenv("TMPDIR");
if (! tmpdir)
tmpdir = "/tmp";
SET ("java.io.tmpdir", tmpdir);
#endif
#ifdef HAVE_UNAME
struct utsname u;
if (! uname (&u))
@ -515,6 +499,10 @@ java::lang::System::init_properties (void)
newprops->put(JvNewStringLatin1 ("java.class.path"),
sb->toString ());
}
// Allow platform specific settings and overrides.
_Jv_platform_initProperties (newprops);
// Finally, set the field. This ensures that concurrent getProperty()
// calls will return initialized values without requiring them to be
// synchronized in the common case.