]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Don't use Win32 functions on CYGWIN.
authorNightStrike <nightstrike@gmail.com>
Wed, 15 Mar 2017 13:46:35 +0000 (13:46 +0000)
committerJanne Blomqvist <jb@gcc.gnu.org>
Wed, 15 Mar 2017 13:46:35 +0000 (15:46 +0200)
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.

Co-Authored-By: Janne Blomqvist <jb@gcc.gnu.org>
From-SVN: r246162

libgfortran/ChangeLog
libgfortran/intrinsics/random.c
libgfortran/intrinsics/system_clock.c
libgfortran/intrinsics/time_1.h

index e6703700c4b35f3cc95e6d999549b2e123738a10..6ec73f6d51a91ac6e544654d52fab975da178242 100644 (file)
@@ -1,3 +1,14 @@
+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.
+
 2017-03-10  Thomas Koenig  <tkoenig@gcc.gnu.org>
 
        PR libfortran/79956
index 38036879362892e110266408b721e5c0833d5fca..2edfa82929cb178c956fc43e953809dbceea02dc 100644 (file)
@@ -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]);
index 606ef2739de91d84fdcd39aead12798146bf5365..5674d493affccc4a78ed4957e36ab58da5d5c173 100644 (file)
@@ -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;
index dbce3d4b5177f2131e53a25597a980d94073f853..95177dc930813da6677d7ac137c5ebfdd73d2251 100644 (file)
@@ -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>