From b3ce0e3954bceb22ac631ae6867f381ea9396e57 Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Wed, 25 Oct 2017 20:03:04 -0500 Subject: [PATCH] Remove unnecessary changes --- lib/scutil/pgnewfil.c | 6 ++-- runtime/flang/alarm3f.c | 2 +- runtime/flang/assign.c | 4 +-- runtime/flang/async.c | 21 +++++------ runtime/flang/close.c | 2 +- runtime/flang/const.c | 2 +- runtime/flang/fmtconv.c | 10 +++--- runtime/flang/fmtread.c | 23 ++++++------- runtime/flang/fmtwrite.c | 44 ++++++++++++------------ runtime/flang/fork3f.c | 2 +- runtime/flang/fstat3f.c | 2 +- runtime/flang/fstat643f.c | 2 +- runtime/flang/getgid3f.c | 2 +- runtime/flang/getuid3f.c | 2 +- runtime/flang/irandm3f.c | 2 +- runtime/flang/lstat3f.c | 2 +- runtime/flang/lstat643f.c | 2 +- runtime/flang/mclock3f.c | 2 +- runtime/flang/times3f.c | 2 +- runtime/flangrti/iostdinit.c | 24 ++++++------- runtime/flangrti/ktrap.c | 2 +- runtime/flangrti/memalign.c | 6 ++-- runtime/flangrti/tempnam.c | 2 +- runtime/flangrti/trace.c | 4 +-- runtime/flangrti/x86_64-Linux/dumpregs.c | 4 +-- runtime/include/mthdecls.h | 11 +++--- tools/flang1/flang1exe/lz.c | 6 ++-- tools/flang1/flang1exe/main.c | 2 +- tools/flang1/utils/symtab/symini.cpp | 2 -- tools/flang2/flang2exe/main.c | 2 +- tools/shared/ccffinfo.c | 2 +- 31 files changed, 99 insertions(+), 102 deletions(-) diff --git a/lib/scutil/pgnewfil.c b/lib/scutil/pgnewfil.c index 590c678ed75..b72d504218d 100644 --- a/lib/scutil/pgnewfil.c +++ b/lib/scutil/pgnewfil.c @@ -29,7 +29,7 @@ #include #include -#if defined(_WIN32) +#if defined(HOST_WIN) #include #include #include @@ -312,7 +312,7 @@ pg_makenewfile(char *pfx, char *sfx, int make) if (!make) { break; } else { -#if defined(_WIN32) +#if defined(HOST_WIN) fd = _open(filename, _O_CREAT | _O_BINARY | _O_EXCL | _O_RDWR, _S_IWRITE); #else fd = open(filename, O_CREAT | O_EXCL | O_RDWR, S_IRUSR | S_IWUSR); @@ -358,7 +358,7 @@ pg_makenewdir(char *pfx, char *sfx, int make) if (r == -1 && errno == ENOENT) { if (make) { int err; -#if defined(_WIN32) || defined(WINNT) || defined(WIN64) +#if defined(HOST_WIN) || defined(WINNT) || defined(WIN64) err = _mkdir(filename); #else err = mkdir(filename, S_IRWXG | S_IRWXO | S_IXUSR | S_IWUSR | S_IRUSR); diff --git a/runtime/flang/alarm3f.c b/runtime/flang/alarm3f.c index 8cd9edc2224..da66a5d53d8 100644 --- a/runtime/flang/alarm3f.c +++ b/runtime/flang/alarm3f.c @@ -19,7 +19,7 @@ /* alarm3f.c - Implements LIB3F alarm subprogram. */ -#ifndef _WIN32 +#ifndef WINNT #include #include "ent3f.h" diff --git a/runtime/flang/assign.c b/runtime/flang/assign.c index 55fbf53e5a5..dc3efddd64f 100644 --- a/runtime/flang/assign.c +++ b/runtime/flang/assign.c @@ -210,8 +210,8 @@ __fortio_assign(char *item, /* where to store */ case __INT8: if (__ftn_32in64_) I64_MSH(valp->val.i8) = 0; - PP_INT4(item) = I64_LSH(valp->val.i8); - PP_INT4(item + 4) = I64_MSH(valp->val.i8); + PP_INT4(item) = valp->val.i8[0]; + PP_INT4(item + 4) = valp->val.i8[1]; break; case __REAL4: PP_REAL4(item) = (float)I64_LSH(valp->val.i8); diff --git a/runtime/flang/async.c b/runtime/flang/async.c index d5633ef2c3e..7cbc5f6b09f 100644 --- a/runtime/flang/async.c +++ b/runtime/flang/async.c @@ -27,7 +27,7 @@ * Fio_asy_close - called from close */ -#if !defined(_WIN32) +#if !defined(TARGET_WIN_X8664) #include #include #include @@ -52,7 +52,7 @@ struct asy_transaction_data { seekoffx_t off; }; -#if defined(_WIN32) +#if defined(TARGET_WIN_X8664) struct asy { FILE *fp; int fd; @@ -92,7 +92,7 @@ static int slime; /* internal wait for asynch i/o */ -#if defined(_WIN32) +#if defined(TARGET_WIN_X8664) static int asy_wait(struct asy *asy) { @@ -253,7 +253,7 @@ Fio_asy_open(FILE *fp, struct asy **pasy) { struct asy *asy; char *p; -#if defined(_WIN32) +#if defined(TARGET_WIN_X8664) HANDLE temp_handle; #endif asy = (struct asy *)calloc(sizeof(struct asy), 1); @@ -263,7 +263,7 @@ Fio_asy_open(FILE *fp, struct asy **pasy) } asy->fp = fp; asy->fd = __io_getfd(fp); -#if defined(_WIN32) +#if defined(TARGET_WIN_X8664) temp_handle = _get_osfhandle(asy->fd); asy->handle = ReOpenFile(temp_handle, GENERIC_READ | GENERIC_WRITE, @@ -287,13 +287,13 @@ Fio_asy_read(struct asy *asy, void *adr, long len) int n; int tn; -#if defined(_WIN32) +#if defined(TARGET_WIN_X8664) union Converter converter; #endif if (slime) printf("--Fio_asy_read %d %p %ld\n", asy->fd, adr, len); -#if defined(_WIN32) +#if defined(TARGET_WIN_X8664) if (asy->flags & ASY_IOACT) { /* i/o active? */ if (asy_wait(asy) == -1) { /* ..yes, wait */ return (-1); @@ -340,14 +340,14 @@ Fio_asy_write(struct asy *asy, void *adr, long len) { int n; int tn; -#if defined(_WIN32) +#if defined(TARGET_WIN_X8664) union Converter converter; #endif if (slime) printf("--Fio_asy_write %d %p %ld\n", asy->fd, adr, len); -#if defined(_WIN32) +#if defined(TARGET_WIN_X8664) if (asy->flags & ASY_IOACT) { /* i/o active? */ if (asy_wait(asy) == -1) { /* ..yes, wait */ return (-1); @@ -408,10 +408,11 @@ Fio_asy_close(struct asy *asy) if (asy->flags & ASY_IOACT) { /* i/o active? */ n = asy_wait(asy); } -#if defined(_WIN32) +#if defined(TARGET_WIN_X8664) /* Close the Re-opened handle that we created. */ CloseHandle(asy->handle); #endif free(asy); return (n); } + diff --git a/runtime/flang/close.c b/runtime/flang/close.c index 3ccf66b3f7d..754e433d74d 100644 --- a/runtime/flang/close.c +++ b/runtime/flang/close.c @@ -71,7 +71,7 @@ __fortio_close(FIO_FCB *f, int flag) else __fort_unlink(f->name); } -#ifdef _WIN32 +#ifdef WINNT else if (f->status == FIO_SCRATCH) unlink(f->name); #endif diff --git a/runtime/flang/const.c b/runtime/flang/const.c index ff888608e7e..5f2ee37a0cd 100644 --- a/runtime/flang/const.c +++ b/runtime/flang/const.c @@ -429,7 +429,7 @@ __get_size_of(int* idx) return __fort_size_of[*idx]; } -#ifdef _WIN32 +#ifdef WINNT /* pg access routines for data shared between windows dlls */ diff --git a/runtime/flang/fmtconv.c b/runtime/flang/fmtconv.c index dbe8ddbd7a9..4ace29cb41d 100644 --- a/runtime/flang/fmtconv.c +++ b/runtime/flang/fmtconv.c @@ -237,8 +237,8 @@ __fortio_default_convert(char *item, int type, break; case __LOG8: width = 2; - I64_LSH(i8val) = PP_LOG4(item); - I64_MSH(i8val) = PP_LOG4(item + 4); + i8val[0] = PP_LOG4(item); + i8val[1] = PP_LOG4(item + 4); if (I64_LSH(i8val) & GET_FIO_CNFG_TRUE_MASK) put_buf(width, "T", 1, 0); else @@ -366,7 +366,7 @@ __fortio_fmt_i8(FLANG_INT64 val, put_buf(width, p, len, neg); } else { /* Iw.0 gen's blanks if value is 0 */ - if (mn == 0 && I64_LSH(val) == 0 && I64_MSH(val) == 0) + if (mn == 0 && val[0] == 0 && val[1] == 0) neg = 0; put_buf(width, p, len, neg); if (mn > len) { @@ -394,8 +394,8 @@ conv_int8(FLANG_INT64 val, int *lenp, int *negp) FLANG_INT64 value; *negp = 0; - I64_LSH(value) = I64_LSH(val); - I64_MSH(value) = I64_MSH(val); + value[0] = val[0]; + value[1] = val[1]; if (__ftn_32in64_) { if (I64_LSH(value) & 0x80000000) I64_MSH(value) = -1; diff --git a/runtime/flang/fmtread.c b/runtime/flang/fmtread.c index a6fd82419a0..f1d716dc23e 100644 --- a/runtime/flang/fmtread.c +++ b/runtime/flang/fmtread.c @@ -1812,8 +1812,8 @@ fr_readnum(int code, char *item, int type) return __fortio_error(FIO_EERR_DATA_CONVERSION); } if (ty == __INT8) { - I64_MSH(i8val) = 0; - I64_LSH(i8val) = ival; + i8val[1] = 0; + i8val[0] = ival; } break; @@ -1876,11 +1876,9 @@ fr_readnum(int code, char *item, int type) idx++, w--; if (comma_seen) w -= 1; - if (w == 0) { - I64_LSH(i8val) = 0; - I64_MSH(i8val) = 0; - ival = 0; - } else { + if (w == 0) + ival = i8val[0] = i8val[1] = 0; + else { c = g->rec_buff[idx]; e = FALSE; /* sign flag */ if (ty == __INT8) { @@ -1894,8 +1892,7 @@ fr_readnum(int code, char *item, int type) */ int tmp_w = w; int cpos = idx; /* 'last' character copied */ - I64_MSH(i8val) = 0; - I64_LSH(i8val) = 0; + i8val[0] = i8val[1] = 0; tmp_idx = idx; while (--tmp_w > 0) { ++tmp_idx; @@ -2106,14 +2103,14 @@ fr_assign(char *item, int type, __BIGINT_T ival, FLANG_INT64 i8val, __BIGREAL_T case __LOG8: if (__ftn_32in64_) I64_MSH(i8val) = 0; - ((__INT4_T *)item)[0] = I64_LSH(i8val); - ((__INT4_T *)item)[1] = I64_MSH(i8val); + ((__INT4_T *)item)[0] = i8val[0]; + ((__INT4_T *)item)[1] = i8val[1]; break; case __INT8: if (__ftn_32in64_) I64_MSH(i8val) = 0; - ((__INT4_T *)item)[0] = I64_LSH(i8val); - ((__INT4_T *)item)[1] = I64_MSH(i8val); + ((__INT4_T *)item)[0] = i8val[0]; + ((__INT4_T *)item)[1] = i8val[1]; break; default: diff --git a/runtime/flang/fmtwrite.c b/runtime/flang/fmtwrite.c index 6f153f320b1..b920042f38a 100644 --- a/runtime/flang/fmtwrite.c +++ b/runtime/flang/fmtwrite.c @@ -1635,15 +1635,15 @@ fw_writenum(int code, char *item, int type) is_logical = TRUE; break; case __LOG8: - I64_LSH(i8val) = ((__INT4_T *)item)[0]; - I64_MSH(i8val) = ((__INT4_T *)item)[1]; + i8val[0] = ((__INT4_T *)item)[0]; + i8val[1] = ((__INT4_T *)item)[1]; ty = __INT8; w = 24; is_logical = TRUE; break; case __INT8: - I64_LSH(i8val) = ((__INT4_T *)item)[0]; - I64_MSH(i8val) = ((__INT4_T *)item)[1]; + i8val[0] = ((__INT4_T *)item)[0]; + i8val[1] = ((__INT4_T *)item)[1]; ty = __INT8; w = 24; break; @@ -1753,8 +1753,8 @@ fw_writenum(int code, char *item, int type) case __REAL8: case __REAL16: crc.r8 = dval; - I64_LSH(i8val) = I64_LSH(crc.i8v); - I64_MSH(i8val) = I64_MSH(crc.i8v); + i8val[0] = crc.i8v[0]; + i8val[1] = crc.i8v[1]; ty = __INT8; w = 24; break; @@ -1780,8 +1780,8 @@ fw_writenum(int code, char *item, int type) case __REAL8: case __REAL16: crc.r8 = dval; - I64_LSH(i8val) = I64_LSH(crc.i8v); - I64_MSH(i8val) = I64_MSH(crc.i8v); + i8val[0] = crc.i8v[0]; + i8val[1] = crc.i8v[1]; ty = __INT8; break; } @@ -1839,8 +1839,8 @@ fw_writenum(int code, char *item, int type) case __REAL8: case __REAL16: crc.r8 = dval; - I64_LSH(i8val) = I64_LSH(crc.i8v); - I64_MSH(i8val) = I64_MSH(crc.i8v); + i8val[0] = crc.i8v[0]; + i8val[1] = crc.i8v[1]; ty = __INT8; break; } @@ -1866,8 +1866,8 @@ fw_writenum(int code, char *item, int type) case __INT8: if (__fortio_check_format()) goto fmt_mismatch; - I64_LSH(i8val) = I64_LSH(crc.i8v); - I64_MSH(i8val) = I64_MSH(crc.i8v); + crc.i8v[0] = i8val[0]; + crc.i8v[1] = i8val[1]; dval = crc.r8; e = 2; ty = __REAL8; @@ -1908,8 +1908,8 @@ fw_writenum(int code, char *item, int type) case __INT8: if (__fortio_check_format()) goto fmt_mismatch; - I64_LSH(crc.i8v) = I64_LSH(i8val); - I64_MSH(crc.i8v) = I64_MSH(i8val); + crc.i8v[0] = i8val[0]; + crc.i8v[1] = i8val[1]; dval = crc.r8; w = REAL8_W; d = REAL8_D; @@ -1947,8 +1947,8 @@ fw_writenum(int code, char *item, int type) case __INT8: if (__fortio_check_format()) goto fmt_mismatch; - I64_LSH(crc.i8v) = I64_LSH(i8val); - I64_MSH(crc.i8v) = I64_MSH(i8val); + crc.i8v[0] = i8val[0]; + crc.i8v[1] = i8val[1]; dval = crc.r8; if (!e_flag) e = 2; @@ -1979,8 +1979,8 @@ fw_writenum(int code, char *item, int type) case __INT8: if (__fortio_check_format()) goto fmt_mismatch; - I64_LSH(crc.i8v) = I64_LSH(i8val); - I64_MSH(crc.i8v) = I64_MSH(i8val); + crc.i8v[0] = i8val[0]; + crc.i8v[1] = i8val[1]; dval = crc.r8; w = REAL8_W; d = REAL8_D; @@ -2009,8 +2009,8 @@ fw_writenum(int code, char *item, int type) case __INT8: if (__fortio_check_format()) goto fmt_mismatch; - I64_LSH(crc.i8v) = I64_LSH(i8val); - I64_MSH(crc.i8v) = I64_MSH(i8val); + crc.i8v[0] = i8val[0]; + crc.i8v[1] = i8val[1]; dval = crc.r8; ty = __REAL8; break; @@ -2031,8 +2031,8 @@ fw_writenum(int code, char *item, int type) case __INT8: if (__fortio_check_format()) goto fmt_mismatch; - I64_LSH(crc.i8v) = I64_LSH(i8val); - I64_MSH(crc.i8v) = I64_MSH(i8val); + crc.i8v[0] = i8val[0]; + crc.i8v[1] = i8val[1]; dval = crc.r8; w = REAL8_W; d = REAL8_D; diff --git a/runtime/flang/fork3f.c b/runtime/flang/fork3f.c index 87c28fd8c89..f9760afe9c2 100644 --- a/runtime/flang/fork3f.c +++ b/runtime/flang/fork3f.c @@ -19,7 +19,7 @@ /* fork3f.c - Implements LIB3F fork subprogram. */ -#ifndef _WIN32 +#ifndef WINNT /* must include ent3f.h AFTER io3f.h */ #include "io3f.h" diff --git a/runtime/flang/fstat3f.c b/runtime/flang/fstat3f.c index 82f70102685..960cb96d7b2 100644 --- a/runtime/flang/fstat3f.c +++ b/runtime/flang/fstat3f.c @@ -110,7 +110,7 @@ int ENT3F(FSTAT, fstat)(int *lu, int *statb) statb[8] = b.st_atime; statb[9] = b.st_mtime; statb[10] = b.st_ctime; -#if !defined(_WIN32) +#if !defined(WINNT) statb[11] = b.st_blksize; statb[12] = b.st_blocks; #else diff --git a/runtime/flang/fstat643f.c b/runtime/flang/fstat643f.c index 28ccc04a587..5317fe51d0b 100644 --- a/runtime/flang/fstat643f.c +++ b/runtime/flang/fstat643f.c @@ -27,7 +27,7 @@ int ENT3F(FSTAT64, fstat64)(int *lu, long long *statb) { -#if defined(_WIN32) +#if defined(TARGET_WIN) || defined(WIN32) || defined(WIN64) /* * The __int64_t members in the _stat64 are 8-byte aligned, thus the * st_size member is at offset 24. On WIN32, 64-bit ints are 4-byte diff --git a/runtime/flang/getgid3f.c b/runtime/flang/getgid3f.c index 98a6071910b..036d6dc030c 100644 --- a/runtime/flang/getgid3f.c +++ b/runtime/flang/getgid3f.c @@ -19,7 +19,7 @@ /* getgid3f.c - Implements LIB3F getgid subprogram. */ -#ifndef _WIN32 +#ifndef WINNT #include #include "ent3f.h" diff --git a/runtime/flang/getuid3f.c b/runtime/flang/getuid3f.c index 2bcc0694ade..4bbc9837e54 100644 --- a/runtime/flang/getuid3f.c +++ b/runtime/flang/getuid3f.c @@ -19,7 +19,7 @@ /* getuid3f.c - Implements LIB3F getuid subprogram. */ -#ifndef _WIN32 +#ifndef WINNT #include "ent3f.h" #include diff --git a/runtime/flang/irandm3f.c b/runtime/flang/irandm3f.c index 086bd17b7b9..a2fe5679508 100644 --- a/runtime/flang/irandm3f.c +++ b/runtime/flang/irandm3f.c @@ -21,7 +21,7 @@ #include "ent3f.h" -#ifdef _WIN32 +#ifdef WINNT int ENT3F(IRANDM, irandm)(int *flag) { diff --git a/runtime/flang/lstat3f.c b/runtime/flang/lstat3f.c index 2a3ddfe7d86..faac308c68c 100644 --- a/runtime/flang/lstat3f.c +++ b/runtime/flang/lstat3f.c @@ -19,7 +19,7 @@ /* lstat3f.c - Implements LIB3F lstat subprogram. */ -#ifndef _WIN32 +#ifndef WINNT /* must include ent3f.h AFTER io3f.h */ #include diff --git a/runtime/flang/lstat643f.c b/runtime/flang/lstat643f.c index d8c037e0de5..c6ff3090f5e 100644 --- a/runtime/flang/lstat643f.c +++ b/runtime/flang/lstat643f.c @@ -19,7 +19,7 @@ /* lstat3f.c - Implements 64-bit LIB3F lstat subprogram. */ -#ifndef _WIN32 +#ifndef WINNT /* must include ent3f.h AFTER io3f.h */ #include diff --git a/runtime/flang/mclock3f.c b/runtime/flang/mclock3f.c index 889113174dc..8752f726d72 100644 --- a/runtime/flang/mclock3f.c +++ b/runtime/flang/mclock3f.c @@ -22,7 +22,7 @@ /* assumes the Unix times system call */ -#if defined(_WIN32) +#if defined(WINNT) #include diff --git a/runtime/flang/times3f.c b/runtime/flang/times3f.c index c3b9b232fd3..0ac39c717b9 100644 --- a/runtime/flang/times3f.c +++ b/runtime/flang/times3f.c @@ -19,7 +19,7 @@ /* times3f.c - Implements LIB3F times subprogram. */ -#ifndef _WIN32 +#ifndef WINNT #include #include "io3f.h" diff --git a/runtime/flangrti/iostdinit.c b/runtime/flangrti/iostdinit.c index ad638a93d9c..9523a3714d8 100644 --- a/runtime/flangrti/iostdinit.c +++ b/runtime/flangrti/iostdinit.c @@ -16,7 +16,7 @@ */ #include -#if !defined(_WIN32) && !defined(ST100) +#if !defined(WINNT) && !defined(ST100) #include #include #endif @@ -25,7 +25,7 @@ /* get environ */ -#if defined(_WIN32) +#if defined(WIN32) || defined(WIN64) /* * enclose _fileno within parens to ensure calling the function rather than * the _fileno function macro (if/when it exists). @@ -33,7 +33,7 @@ #define fileno(x) (_fileno)(x) #endif -#if defined(_WIN32) +#if defined(WINNT) #include extern char **environ; #elif defined(TARGET_OSX) @@ -90,7 +90,7 @@ __io_stderr(void) /* convert macros to routines */ -#if defined(TARGET_WIN) || defined(_WIN32) +#if defined(TARGET_WIN) || defined(WIN32) #include int __io_fgetc(FILE *p) @@ -176,10 +176,10 @@ __io_isatty(int fd) int __io_binary_mode(void *fp) { -#if defined(_WIN32_WINNT) +#if defined(WINNT) #include -#if defined(_WIN64) || defined(_WIN32) +#if defined(WIN64) || defined(WIN32) #define O_BINARY _O_BINARY #endif @@ -203,10 +203,10 @@ __io_binary_mode(void *fp) int __io_setmode_binary(void *fp) { -#if defined(_WIN32_WINNT) +#if defined(WINNT) #include -#if defined(_WIN64) || defined(_WIN32) +#if defined(WIN64) || defined(WIN32) #define O_BINARY _O_BINARY #endif @@ -221,7 +221,7 @@ __io_setmode_binary(void *fp) int __io_ispipe(void *f) { -#if !defined(_WIN32) && !defined(ST100) +#if !defined(WINNT) && !defined(ST100) struct stat st; fstat(fileno((FILE *)f), &st); @@ -261,7 +261,7 @@ __io_fwrite(char *ptr, size_t size, size_t nitems, FILE *stream) #endif } -#if defined(_WIN32) +#if defined(WINNT) || defined(WIN64) || defined(WIN32) #if defined(PGI_CRTDLL) extern long *_imp___timezone_dll; /* for crtdll.dll */ @@ -279,14 +279,14 @@ __io_timezone(void *tm) { #if defined(SUN4) || defined(PPC) || defined(OSX86) return ((struct tm *)tm)->tm_gmtoff; -#elif defined(_WIN32) +#elif defined(WINNT) || defined(WIN64) || defined(WIN32) return (0); #else return -(timezone - (((struct tm *)tm)->tm_isdst ? 3600 : 0)); #endif } -#if defined(_WIN32) +#if (defined(WIN32) || defined(WIN64)) /* OT 10 */ void * _pgi_get_iob(int xx) { diff --git a/runtime/flangrti/ktrap.c b/runtime/flangrti/ktrap.c index 4de3e2fd09d..75676d7d0f9 100644 --- a/runtime/flangrti/ktrap.c +++ b/runtime/flangrti/ktrap.c @@ -19,7 +19,7 @@ * \brief IEEE trap support */ -#ifndef _WIN32 +#ifndef TARGET_WIN #include diff --git a/runtime/flangrti/memalign.c b/runtime/flangrti/memalign.c index 8d6271a024b..e2e01af2ac3 100644 --- a/runtime/flangrti/memalign.c +++ b/runtime/flangrti/memalign.c @@ -18,7 +18,7 @@ #include #include -#if defined(_WIN32) +#if (defined(WIN32) || defined(WIN64)) extern void *_aligned_malloc(); extern void _aligned_free(); #else @@ -50,7 +50,7 @@ __aligned_malloc(size_t sz, size_t aln) aln = 1 << s; } need = sz + MINALN; -#if defined(_WIN32) +#if (defined(WIN32) || defined(WIN64)) q = _aligned_malloc(need, aln); if (!q) return NULL; @@ -63,7 +63,7 @@ __aligned_malloc(size_t sz, size_t aln) void __aligned_free(void *p) { -#if defined(_WIN32) +#if (defined(WIN32) || defined(WIN64)) _aligned_free(p); #else free(p); diff --git a/runtime/flangrti/tempnam.c b/runtime/flangrti/tempnam.c index db5afc8ed8c..8562f2d222b 100644 --- a/runtime/flangrti/tempnam.c +++ b/runtime/flangrti/tempnam.c @@ -156,7 +156,7 @@ extern char *tempnam(char *, char *); char * __io_tempnam(char *dir, char *pfx) { -#if defined(_WIN32) +#if defined(WIN32) || defined(WIN64) return (_tempnam(dir, pfx)); #else return (tempnam(dir, pfx)); diff --git a/runtime/flangrti/trace.c b/runtime/flangrti/trace.c index 7dd5238a9fa..5c3ecb6f8ee 100644 --- a/runtime/flangrti/trace.c +++ b/runtime/flangrti/trace.c @@ -66,7 +66,7 @@ dbg_stop_before_exit(void) * 3 - traceback (signal) */ -#if defined(_WIN32) +#if defined(WIN32) || defined(WIN64) #define getpid _getpid #define _Exit _exit #endif @@ -143,7 +143,7 @@ __abort_init(char *path) int n; int neg; -#if defined(_WIN32) +#if defined(WINNT) fn = path; #endif p = getenv("TRACE_TERM"); diff --git a/runtime/flangrti/x86_64-Linux/dumpregs.c b/runtime/flangrti/x86_64-Linux/dumpregs.c index c4f31ced95f..1b5e147b329 100644 --- a/runtime/flangrti/x86_64-Linux/dumpregs.c +++ b/runtime/flangrti/x86_64-Linux/dumpregs.c @@ -15,7 +15,7 @@ * */ -#if !defined(_WIN32) +#if !defined(TARGET_WIN) #include #endif #include "stdioInterf.h" @@ -40,7 +40,7 @@ #define RSP 15 #define RIP 16 -#if defined(TARGET_OSX) || defined(_WIN32) +#if defined(TARGET_OSX) || defined(TARGET_WIN) /* no gregs and/or ucontext defined in for OSX or Windows */ void * getRegs(void *u) diff --git a/runtime/include/mthdecls.h b/runtime/include/mthdecls.h index 7abefa4385c..ddec42510f0 100644 --- a/runtime/include/mthdecls.h +++ b/runtime/include/mthdecls.h @@ -263,7 +263,7 @@ float __builtin_cimagf(float complex); single precision versions of the math.h functions, in which case the single precision versions should be used: */ -#if defined(_WIN32) +#if defined(WIN64) #define ACOSF acos #define ASINF asin @@ -326,7 +326,7 @@ float __builtin_cimagf(float complex); #define hypot _hypot #endif -#else /* #if defined (_WIN32) */ +#else /* #if defined (WIN64) */ #define ACOSF acosf #define ASINF asinf #define ATANF atanf @@ -372,7 +372,7 @@ float __builtin_cimagf(float complex); #define CTANHF ctanhf #define CTANF ctanf -#if defined(_WIN32) +#if defined(TARGET_WIN) #define BESSEL_J0F _j0 #define BESSEL_J1F _j1 #define BESSEL_JNF _jn @@ -422,7 +422,7 @@ float __builtin_cimagf(float complex); #define BESSEL_Y1 y1 #define BESSEL_YN yn #endif -#endif /* #if defined (WIN32) */ +#endif /* #if defined (WIN64) */ /* declarations for math functions */ @@ -580,7 +580,8 @@ ZMPLXDECL_Z(__mth_i_cdtanh); #endif -#if defined(_WIN32) + +#if defined(TARGET_WIN) /* the following are part of Open Tools 12, we build with Open Tools 10 */ /* extern double erf(double x); diff --git a/tools/flang1/flang1exe/lz.c b/tools/flang1/flang1exe/lz.c index a0a2edc90bc..ba57b5e2590 100644 --- a/tools/flang1/flang1exe/lz.c +++ b/tools/flang1/flang1exe/lz.c @@ -19,12 +19,12 @@ #include #include "gbldefs.h" -#if !defined(_WIN32) +#if !defined(HOST_WIN) #include #include #endif -#ifndef _WIN32 +#ifndef HOST_WIN #define USE_GETLINE 1 #endif @@ -195,7 +195,7 @@ lzrestore(lzhandle *lzh) { int l; fseek(lzh->file, lzh->savefile, SEEK_SET); -#if !defined(_WIN32) +#if !defined(HOST_WIN) if (lzh->inout) { ftruncate(fileno(lzh->file), lzh->savefile); } diff --git a/tools/flang1/flang1exe/main.c b/tools/flang1/flang1exe/main.c index f8e23d60883..7c2272d45ed 100644 --- a/tools/flang1/flang1exe/main.c +++ b/tools/flang1/flang1exe/main.c @@ -22,7 +22,7 @@ #include #include "flang/ArgParser/arg_parser.h" #include "error.h" -#if !defined(_WIN32) +#if !defined(TARGET_WIN) #include #endif #include diff --git a/tools/flang1/utils/symtab/symini.cpp b/tools/flang1/utils/symtab/symini.cpp index d2e72c0aed4..ea2169fc99d 100644 --- a/tools/flang1/utils/symtab/symini.cpp +++ b/tools/flang1/utils/symtab/symini.cpp @@ -175,9 +175,7 @@ class SyminiFE90 : public UtilityApplication // FIXME this initializes the global variable stb. In the future // STB should become a class with normal C++ class constructors, // and this call will not be necessary. - printf("asd"); sym_init_first(); - printf("qwe"); int output_file_argument = 0; for (int arg = 1; arg < argc; ++arg) { diff --git a/tools/flang2/flang2exe/main.c b/tools/flang2/flang2exe/main.c index b64b870e479..ddc2025b907 100644 --- a/tools/flang2/flang2exe/main.c +++ b/tools/flang2/flang2exe/main.c @@ -37,7 +37,7 @@ #include "llassem.h" #include "cgllvm.h" #include "outliner.h" -#if !defined(_WIN32) +#if !defined(TARGET_WIN) #include #endif #include diff --git a/tools/shared/ccffinfo.c b/tools/shared/ccffinfo.c index ae5b49a6320..50307f9fb6e 100644 --- a/tools/shared/ccffinfo.c +++ b/tools/shared/ccffinfo.c @@ -26,7 +26,7 @@ #include #include -#if !defined(_WIN32) +#if !defined(HOST_WIN) #include #endif #include "symtab.h"