From 76ed0c0a4bd74a140e0de578eb94f2fd969646bd Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Fri, 15 Oct 1999 16:53:41 +0000 Subject: gij.cc (main): Formatting fixes. * gij.cc (main): Formatting fixes. (_Jv_Compiler_Properties): Define. * java/lang/natSystem.cc (_Jv_Environment_Properties): Don't declare. (init_properties): Set properites from _Jv_Compiler_Properties. * include/java-props.h (_Jv_Compiler_Properties, _Jv_Environment_Properties): Declare. From-SVN: r30020 --- libjava/java/lang/natSystem.cc | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'libjava/java') diff --git a/libjava/java/lang/natSystem.cc b/libjava/java/lang/natSystem.cc index f146f3e..268c1cc 100644 --- a/libjava/java/lang/natSystem.cc +++ b/libjava/java/lang/natSystem.cc @@ -53,7 +53,6 @@ details. */ #define SystemClass _CL_Q34java4lang6System extern java::lang::Class SystemClass; -extern property_pair *_Jv_Environment_Properties; #if defined (ECOS) @@ -336,8 +335,8 @@ java::lang::System::init_properties (void) while (buf_r != NULL) { - int r = getpwuid_adaptor - (getpwuid_r, user_id, &pwd_r, buf_r, len_r, &pwd_entry); + int r = getpwuid_adaptor (getpwuid_r, user_id, &pwd_r, + buf_r, len_r, &pwd_entry); if (r == 0) break; else if (r != ERANGE) @@ -379,6 +378,19 @@ java::lang::System::init_properties (void) free (buffer); #endif + // Set some properties according to whatever was compiled in with + // `-D'. + for (int i = 0; _Jv_Compiler_Properties[i]; ++i) + { + const char *s, *p; + // Find the `='. + for (s = p = _Jv_Compiler_Properties[i]; *s && *s != '='; ++s) + ; + jstring name = JvNewStringLatin1 (p, s - p); + jstring val = JvNewStringLatin1 (*s == '=' ? s + 1 : s); + properties->put (name, val); + } + // Set the system properties from the user's environment. if (_Jv_Environment_Properties) { -- cgit v1.1