diff options
author | Tom Tromey <tromey@cygnus.com> | 1999-10-15 16:53:41 +0000 |
---|---|---|
committer | Tom Tromey <tromey@gcc.gnu.org> | 1999-10-15 16:53:41 +0000 |
commit | 76ed0c0a4bd74a140e0de578eb94f2fd969646bd (patch) | |
tree | d36cc38c405c94aa7604774dd40bb59ca0cc4485 /libjava/java | |
parent | 7cf41963391146126ec2d0064e8fb573fc0addf5 (diff) | |
download | gcc-76ed0c0a4bd74a140e0de578eb94f2fd969646bd.zip gcc-76ed0c0a4bd74a140e0de578eb94f2fd969646bd.tar.gz gcc-76ed0c0a4bd74a140e0de578eb94f2fd969646bd.tar.bz2 |
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
Diffstat (limited to 'libjava/java')
-rw-r--r-- | libjava/java/lang/natSystem.cc | 18 |
1 files changed, 15 insertions, 3 deletions
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) { |