Commit ce53138f authored by Berdes's avatar Berdes Committed by thomie

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
parent c60704fc
......@@ -4,7 +4,7 @@
Useful Win32 bits
------------------------------------------------------------------------- */
#if defined(_MSC_VER) || defined(_WIN32)
#if defined(_WIN32)
#include "HsBase.h"
......
......@@ -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"
......
......@@ -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);
......
......@@ -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 )
{
......
......@@ -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));
......
......@@ -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>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment