[commit: ghc] master: Delete _MSC_VER when not necessary, fix #10511 (ce53138)

git at git.haskell.org git at git.haskell.org
Fri Jun 12 09:03:57 UTC 2015


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/ce53138ff0d156e9f229d0adab745d2d4cfaf582/ghc

>---------------------------------------------------------------

commit ce53138ff0d156e9f229d0adab745d2d4cfaf582
Author: Bernard Desmyter <bernarddesmyter at gmail.com>
Date:   Fri Jun 12 11:01:45 2015 +0200

    Delete _MSC_VER when not necessary, fix #10511
    
    Simplify some preprocessor expressions involving `_MSC_VER` because
    `_WIN32` is always defined when `_MSC_VER` is.
    
    Differential Revision: https://phabricator.haskell.org/D981


>---------------------------------------------------------------

ce53138ff0d156e9f229d0adab745d2d4cfaf582
 libraries/base/cbits/Win32Utils.c | 2 +-
 libraries/base/cbits/consUtils.c  | 2 +-
 libraries/base/cbits/inputReady.c | 4 ++--
 libraries/base/include/HsBase.h   | 4 ++--
 utils/hp2ps/Main.c                | 2 +-
 utils/touchy/touchy.c             | 2 +-
 6 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/libraries/base/cbits/Win32Utils.c b/libraries/base/cbits/Win32Utils.c
index 1b9292c..965adc2 100644
--- a/libraries/base/cbits/Win32Utils.c
+++ b/libraries/base/cbits/Win32Utils.c
@@ -4,7 +4,7 @@
    Useful Win32 bits
    ------------------------------------------------------------------------- */
 
-#if defined(_MSC_VER) || defined(_WIN32)
+#if defined(_WIN32)
 
 #include "HsBase.h"
 
diff --git a/libraries/base/cbits/consUtils.c b/libraries/base/cbits/consUtils.c
index c56be21..0c9202d 100644
--- a/libraries/base/cbits/consUtils.c
+++ b/libraries/base/cbits/consUtils.c
@@ -3,7 +3,7 @@
  *
  * Win32 Console API support
  */
-#if defined(_MSC_VER) || defined(_WIN32) || defined(__CYGWIN__)
+#if defined(_WIN32) || defined(__CYGWIN__)
 /* to the end */
 
 #include "consUtils.h"
diff --git a/libraries/base/cbits/inputReady.c b/libraries/base/cbits/inputReady.c
index edb4472..8714eea 100644
--- a/libraries/base/cbits/inputReady.c
+++ b/libraries/base/cbits/inputReady.c
@@ -17,7 +17,7 @@ int
 fdReady(int fd, int write, int msecs, int isSock)
 {
     if 
-#if defined(_MSC_VER) || defined(_WIN32)
+#if defined(_WIN32)
     ( isSock ) {
 #else
     ( 1 ) {
@@ -54,7 +54,7 @@ fdReady(int fd, int write, int msecs, int isSock)
 	/* 1 => Input ready, 0 => not ready, -1 => error */
 	return (ready);
     }
-#if defined(_MSC_VER) || defined(_WIN32)
+#if defined(_WIN32)
     else {
 	DWORD rc;
 	HANDLE hFile = (HANDLE)_get_osfhandle(fd);
diff --git a/libraries/base/include/HsBase.h b/libraries/base/include/HsBase.h
index 7afd5a5..a5512cc 100644
--- a/libraries/base/include/HsBase.h
+++ b/libraries/base/include/HsBase.h
@@ -298,7 +298,7 @@ __hscore_ftruncate( int fd, off_t where )
 INLINE int
 __hscore_setmode( int fd, HsBool toBin )
 {
-#if defined(_MSC_VER) || defined(_WIN32)
+#if defined(_WIN32)
   return setmode(fd,(toBin == HS_BOOL_TRUE) ? _O_BINARY : _O_TEXT);
 #else
   return 0;
@@ -383,7 +383,7 @@ __hscore_sizeof_termios( void )
 }
 #endif
 
-#if !defined(_MSC_VER) && !defined(_WIN32)
+#if !defined(_WIN32)
 INLINE HsInt
 __hscore_sizeof_sigset_t( void )
 {
diff --git a/utils/hp2ps/Main.c b/utils/hp2ps/Main.c
index 709bb13..74d1bce 100644
--- a/utils/hp2ps/Main.c
+++ b/utils/hp2ps/Main.c
@@ -143,7 +143,7 @@ nextarg: ;
     if (!filter) {
 	pathName = copystring(argv[0]);
 	DropSuffix(pathName, ".hp");
-#if defined(_MSC_VER) || defined(_WIN32)
+#if defined(_WIN32)
 	DropSuffix(pathName, ".exe");
 #endif
 	baseName = copystring(Basename(pathName));
diff --git a/utils/touchy/touchy.c b/utils/touchy/touchy.c
index a8ac146..88ababa 100644
--- a/utils/touchy/touchy.c
+++ b/utils/touchy/touchy.c
@@ -2,7 +2,7 @@
  * Simple 'touch' program for Windows
  *
  */
-#if !defined(_MSC_VER) && !defined(_WIN32)
+#if !defined(_WIN32)
 #error "Win32-only, the platform you're using is supposed to have 'touch' already."
 #else
 #include <stdio.h>



More information about the ghc-commits mailing list