diff options
author | jb <jb@138bc75d-0d04-0410-961f-82ee72b054a4> | 2017-03-15 13:46:35 +0000 |
---|---|---|
committer | jb <jb@138bc75d-0d04-0410-961f-82ee72b054a4> | 2017-03-15 13:46:35 +0000 |
commit | 2914a5e91bd9589564ebb740f17ca7909cdbe253 (patch) | |
tree | 517eb9e810d1d4db823a6e3c2112b664dc8f89ec /libgfortran/intrinsics | |
parent | 58afe09fd376e66746c252c1d9ca0b424761fb6e (diff) | |
download | gcc-2914a5e91bd9589564ebb740f17ca7909cdbe253.tar.gz |
Don't use Win32 functions on CYGWIN.
This was a workaround for a cygwin bug which was fixed 4 years ago,
and cygwin hasn't supported affected versions for a long time.
2017-03-15 NightStrike <nightstrike@gmail.com>
Janne Blomqvist <jb@gcc.gnu.org>
* intrinsics/random.c (getosrandom): Remove check for __CYGWIN__
preprocessor flag.
* intrinsics/system_clock.c: Likewise.
(system_clock_4): Likewise.
(system_clock_8): Likewise.
* intrinsics/time_1.h: Don't include windows.h if __CYGWIN__ is
defined.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@246162 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran/intrinsics')
-rw-r--r-- | libgfortran/intrinsics/random.c | 2 | ||||
-rw-r--r-- | libgfortran/intrinsics/system_clock.c | 8 | ||||
-rw-r--r-- | libgfortran/intrinsics/time_1.h | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/libgfortran/intrinsics/random.c b/libgfortran/intrinsics/random.c index 38036879362..2edfa82929c 100644 --- a/libgfortran/intrinsics/random.c +++ b/libgfortran/intrinsics/random.c @@ -304,7 +304,7 @@ static int getosrandom (void *buf, size_t buflen) { /* rand_s is available in MinGW-w64 but not plain MinGW. */ -#if defined(__MINGW64_VERSION_MAJOR) && !defined(__CYGWIN__) +#if defined(__MINGW64_VERSION_MAJOR) unsigned int* b = buf; for (unsigned i = 0; i < buflen / sizeof (unsigned int); i++) rand_s (&b[i]); diff --git a/libgfortran/intrinsics/system_clock.c b/libgfortran/intrinsics/system_clock.c index 606ef2739de..5674d493aff 100644 --- a/libgfortran/intrinsics/system_clock.c +++ b/libgfortran/intrinsics/system_clock.c @@ -29,7 +29,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #include "time_1.h" -#if !defined(__MINGW32__) && !defined(__CYGWIN__) +#if !defined(__MINGW32__) /* POSIX states that CLOCK_REALTIME must be present if clock_gettime is available, others are optional. */ @@ -99,7 +99,7 @@ gf_gettime_mono (time_t * secs, long * fracsecs, long * tck) #endif } -#endif /* !__MINGW32 && !__CYGWIN__ */ +#endif /* !__MINGW32__ */ extern void system_clock_4 (GFC_INTEGER_4 *count, GFC_INTEGER_4 *count_rate, @@ -121,7 +121,7 @@ void system_clock_4 (GFC_INTEGER_4 *count, GFC_INTEGER_4 *count_rate, GFC_INTEGER_4 *count_max) { -#if defined(__MINGW32__) || defined(__CYGWIN__) +#if defined(__MINGW32__) if (count) { /* Use GetTickCount here as the resolution and range is @@ -174,7 +174,7 @@ void system_clock_8 (GFC_INTEGER_8 *count, GFC_INTEGER_8 *count_rate, GFC_INTEGER_8 *count_max) { -#if defined(__MINGW32__) || defined(__CYGWIN__) +#if defined(__MINGW32__) LARGE_INTEGER cnt; LARGE_INTEGER freq; bool fail = false; diff --git a/libgfortran/intrinsics/time_1.h b/libgfortran/intrinsics/time_1.h index dbce3d4b517..95177dc9308 100644 --- a/libgfortran/intrinsics/time_1.h +++ b/libgfortran/intrinsics/time_1.h @@ -101,7 +101,7 @@ localtime_r (const time_t * timep, struct tm * result) CPU_TIME intrinsics. Returns 0 for success or -1 if no CPU time could be computed. */ -#if defined(__MINGW32__) || defined(__CYGWIN__) +#if defined(__MINGW32__) #define WIN32_LEAN_AND_MEAN #include <windows.h> |