Hi Thomas,

Thomas Koenig via Fortran <fort...@gcc.gnu.org> wrote:

tested on a number of Darwin platforms old and new, and on
x86_64/powerpc64-linux,
OK for master?
… and backports to open branches?

One question...

+# ifdef __APPLE__
+#  include <crt_externs.h>
+#  define environ (*_NSGetEnviron ())

Is it guaranteed that crt_externs.h is present if __APPLE__
is defined?

__APPLE__ is defined by GCC when targetting macOS (actually by other compilers too,
although that’s probably not important for building libgfortran).

The header is present on all macOS systems supported by GCC (and at least two revisions
prior to the earliest that currently builds GCC open branches).

Of course, a user with -D on the command line can define it .. but then will get a build error - which is fine __APPLE__ is in the implementation namespace, the user gets what
they deserve ;)

We could be paranoid and write #if defined (__APPLE__) && __has_include(<crt_externs.h>)
but that seems over the top here.

If that's the case, OK for master and backports.

applied to master,
will deal with the backports along with other Darwin ones.
thanks
Iain

Reply via email to