classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cp-patches] [generics] RFC: fix generics branch compilation on Darw


From: Tom Tromey
Subject: Re: [cp-patches] [generics] RFC: fix generics branch compilation on Darwin
Date: 05 Dec 2005 08:48:46 -0700
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

>>>>> "Casey" == Casey Marshall <address@hidden> writes:

Casey> java_lang_VMSystem.c references 'extern char **environ,' which isn't
Casey> defined on Darwin. java_lang_VMProcess.c has a little #if that
Casey> defines this to a special function (_NSGetEnviron) for Darwin; the
Casey> attached patch does the same for VMSystem.

If we need the same code in 2 places we ought to put it in a header.

Casey> Does this look OK? I haven't tested this yet (I'm not entirely sure
Casey> how to do so; I've heard that jamvm can run this branch, so I'm going
Casey> to try that).

It is a bit more usual to check for 'environ' directly in configure
and then fall back to the other thing.  But, in this case this is not
of major importance.

Casey> +/* Some O/S's don't declare 'environ' */
Casey> +#if HAVE_CRT_EXTERNS_H
Casey> +/* Darwin does not have a variable named environ
Casey> +   but has a function which you can get the environ
Casey> +   variable with.  */
Casey> +#include <crt_externs.h>
Casey> +#define environ (*_NSGetEnviron())
Casey> +#endif /* HAVE_CRT_EXTERNS_H */
 [...]
Casey>  {
Casey> +#if !HAVE_CRT_EXTERNS_H
Casey>    extern char** environ;
Casey> +#endif /* HAVE_CRT_EXTERNS_H */

Just declare environ globally in the header file as well and update
java_lang_VMProcess.c.

Tom




reply via email to

[Prev in Thread] Current Thread [Next in Thread]