From 19f0e98f58f5895d076bb763db75e00648cf9eba Mon Sep 17 00:00:00 2001 From: David Edelsohn Date: Sat, 4 May 2013 21:23:11 +0000 Subject: [PATCH] environ.c: Include unistd.h. * runtime/environ.c: Include unistd.h. * runtime/pause.c: Test HAVE_UNISTD_H. * runtime/stop.c: Same. * io/open.c: Same. * io/unix.c: Same. * io/read.c (si_max): Protect declaration of value. From-SVN: r198603 --- libgfortran/ChangeLog | 9 +++++++++ libgfortran/io/open.c | 4 ++++ libgfortran/io/read.c | 2 ++ libgfortran/io/unix.c | 3 +++ libgfortran/runtime/environ.c | 4 ++++ libgfortran/runtime/pause.c | 4 ++++ libgfortran/runtime/stop.c | 4 ++++ 7 files changed, 30 insertions(+) diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index 334220de476..54802747dc9 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,12 @@ +2013-05-04 David Edelsohn + + * runtime/environ.c: Include unistd.h. + * runtime/pause.c: Test HAVE_UNISTD_H. + * runtime/stop.c: Same. + * io/open.c: Same. + * io/unix.c: Same. + * io/read.c (si_max): Protect declaration of value. + 2013-04-29 Janne Blomqvist * intrinsics/system_clock (gf_gettime_mono): Use variable diff --git a/libgfortran/io/open.c b/libgfortran/io/open.c index 19fab1d683f..cca0ecc714f 100644 --- a/libgfortran/io/open.c +++ b/libgfortran/io/open.c @@ -26,7 +26,11 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #include "io.h" #include "fbuf.h" #include "unix.h" + +#ifdef HAVE_UNISTD_H #include +#endif + #include #include #include diff --git a/libgfortran/io/read.c b/libgfortran/io/read.c index 2da1048f8ae..d7d5c4167c7 100644 --- a/libgfortran/io/read.c +++ b/libgfortran/io/read.c @@ -91,7 +91,9 @@ set_integer (void *dest, GFC_INTEGER_LARGEST value, int length) GFC_UINTEGER_LARGEST si_max (int length) { +#if defined HAVE_GFC_REAL_16 || defined HAVE_GFC_REAL_10 GFC_UINTEGER_LARGEST value; +#endif switch (length) { diff --git a/libgfortran/io/unix.c b/libgfortran/io/unix.c index 08fe4fe5212..dd2715b6b6d 100644 --- a/libgfortran/io/unix.c +++ b/libgfortran/io/unix.c @@ -30,7 +30,10 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #include #include +#ifdef HAVE_UNISTD_H #include +#endif + #include #include #include diff --git a/libgfortran/runtime/environ.c b/libgfortran/runtime/environ.c index 8c09391f0c8..a29785bab21 100644 --- a/libgfortran/runtime/environ.c +++ b/libgfortran/runtime/environ.c @@ -28,6 +28,10 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #include #include +#ifdef HAVE_UNISTD_H +#include +#endif + /* Environment scanner. Examine the environment for controlling minor * aspects of the program's execution. Our philosophy here that the diff --git a/libgfortran/runtime/pause.c b/libgfortran/runtime/pause.c index ad69c95ca0f..f193314634e 100644 --- a/libgfortran/runtime/pause.c +++ b/libgfortran/runtime/pause.c @@ -25,7 +25,11 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #include "libgfortran.h" #include + +#ifdef HAVE_UNISTD_H #include +#endif + static void do_pause (void) diff --git a/libgfortran/runtime/stop.c b/libgfortran/runtime/stop.c index 1f0f453bcb3..4805412e761 100644 --- a/libgfortran/runtime/stop.c +++ b/libgfortran/runtime/stop.c @@ -26,7 +26,11 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #include "libgfortran.h" #include #include + +#ifdef HAVE_UNISTD_H #include +#endif + /* A numeric STOP statement. */