Skip to content

Commit

Permalink
Rename WIN32->_WIN32
Browse files Browse the repository at this point in the history
Fix more _WIN32
  • Loading branch information
isuruf authored and xoviat committed Dec 23, 2017
1 parent 92afe7b commit 17db496
Show file tree
Hide file tree
Showing 23 changed files with 71 additions and 30 deletions.
2 changes: 2 additions & 0 deletions runtime/flang/access3f.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
/* access3f.c - Implements LIB3F access subroutine. */

/* must include ent3f.h AFTER io3f.h */
#ifndef _WIN32
#include <unistd.h>
#endif

#include "io3f.h"
#include "ent3f.h"
Expand Down
2 changes: 1 addition & 1 deletion runtime/flang/alarm3f.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

/* alarm3f.c - Implements LIB3F alarm subprogram. */

#ifndef WINNT
#ifndef _WIN32
#include <signal.h>
#include "ent3f.h"

Expand Down
11 changes: 9 additions & 2 deletions runtime/flang/cdpowi.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,11 @@ ZMPLXFUNC_Z_I(__mth_i_cdpowi)
ZMPLXARGS_Z_I;
int k;
double fr, fi, gr, gi, tr, ti;
double complex z;
#ifndef _WIN32
static const double complex c1plusi0 = 1.0 + I*0;
#else
static const _Dcomplex c1plusi0 = {1.0, 0};
#endif

fr = 1;
fi = 0;
Expand All @@ -46,7 +49,11 @@ ZMPLXFUNC_Z_I(__mth_i_cdpowi)
gi = ti;
}

z = fr + I*fi;
#ifndef _WIN32
double complex z = fr + I*fi;
#else
_Dcomplex z = {fr, fi};
#endif
if (i < 0) {
ZMPLX_CALL_ZR_Z_Z(__mth_i_cddiv,z,c1plusi0,z);
}
Expand Down
12 changes: 10 additions & 2 deletions runtime/flang/cdpowk.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,11 @@ ZMPLXFUNC_Z_K(__mth_i_cdpowk)
ZMPLXARGS_Z_K;
long long k;
double fr, fi, gr, gi, tr, ti;
double complex z;
#ifndef _WIN32
static const double complex c1plusi0 = 1.0 + I*0;
#else
static const _Dcomplex c1plusi0 = {1.0, 0};
#endif

fr = 1;
fi = 0;
Expand All @@ -46,7 +49,12 @@ ZMPLXFUNC_Z_K(__mth_i_cdpowk)
gi = ti;
}

z = fr + I*fi;

#ifndef _WIN32
double complex z = fr + I*fi;
#else
_Dcomplex z = {fr, fi};
#endif
if (i < 0) {
ZMPLX_CALL_ZR_Z_Z(__mth_i_cddiv,z,c1plusi0,z);
}
Expand Down
2 changes: 2 additions & 0 deletions runtime/flang/chdir3f.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
/* chdir3f.c - Implements LIB3F chdir subprogram. */

/* must include ent3f.h AFTER io3f.h */
#ifndef _WIN32
#include <unistd.h>
#endif
#include "io3f.h"
#include "ent3f.h"

Expand Down
11 changes: 9 additions & 2 deletions runtime/flang/cpowi.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,11 @@ CMPLXFUNC_C_I(__mth_i_cpowi)
CMPLXARGS_C_I;
int k;
float fr, fi, gr, gi, tr, ti;
float complex c;
#ifndef _WIN32
static const float complex c1plusi0 = 1.0 + I*0;
#else
static const _Fcomplex c1plusi0 = {1.0, 0};
#endif

fr = 1;
fi = 0;
Expand All @@ -46,7 +49,11 @@ CMPLXFUNC_C_I(__mth_i_cpowi)
gi = ti;
}

c = fr + I*fi;
#ifndef _WIN32
float complex c = fr + I*fi;
#else
_Fcomplex c = {fr, fi};
#endif
if (i < 0) {
CMPLX_CALL_CR_C_C(__mth_i_cdiv,c,c1plusi0,c);
}
Expand Down
11 changes: 9 additions & 2 deletions runtime/flang/cpowk.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,11 @@ CMPLXFUNC_C_K(__mth_i_cpowk)
CMPLXARGS_C_K;
long long k;
float fr, fi, gr, gi, tr, ti;
float complex c;
#ifndef _WIN32
static const float complex c1plusi0 = 1.0 + I*0;
#else
static const _Fcomplex c1plusi0 = {1.0, 0};
#endif

fr = 1;
fi = 0;
Expand All @@ -46,7 +49,11 @@ CMPLXFUNC_C_K(__mth_i_cpowk)
gi = ti;
}

c = fr + I*fi;
#ifndef _WIN32
float complex c = fr + I*fi;
#else
_Fcomplex c = {fr, fi};
#endif
if (i < 0) {
CMPLX_CALL_CR_C_C(__mth_i_cdiv,c,c1plusi0,c);
}
Expand Down
4 changes: 3 additions & 1 deletion runtime/flang/dtime3f.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@
#include "ent3f.h"

#define _LIBC_LIMITS_H_
#ifndef _WIN32
#include <unistd.h>
#include <sys/types.h>
#include <sys/times.h>
#endif
#include <sys/types.h>
#include <limits.h>

#ifndef CLK_TCK
Expand Down
2 changes: 2 additions & 0 deletions runtime/flang/etime3f.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@

/* Not implemented for WINNT */

#ifndef _WIN32
#include <unistd.h>
#endif
#define _LIBC_LIMITS_H_
#include <sys/types.h>
#include <sys/times.h>
Expand Down
2 changes: 1 addition & 1 deletion runtime/flang/fork3f.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

/* fork3f.c - Implements LIB3F fork subprogram. */

#ifndef WINNT
#ifndef _WIN32

/* must include ent3f.h AFTER io3f.h */
#include "io3f.h"
Expand Down
2 changes: 1 addition & 1 deletion runtime/flang/fstat3f.c
Original file line number Diff line number Diff line change
Expand Up @@ -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(WINNT)
#if !defined(_WIN32)
statb[11] = b.st_blksize;
statb[12] = b.st_blocks;
#else
Expand Down
3 changes: 2 additions & 1 deletion runtime/flang/fstat643f.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

int ENT3F(FSTAT64, fstat64)(int *lu, long long *statb)
{
#if defined(TARGET_WIN) || defined(WIN32) || defined(WIN64)
#if defined(_WIN32)
/*
* 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
Expand Down Expand Up @@ -136,6 +136,7 @@ int ENT3F(FSTAT64, fstat64)(int *lu, long long *statb)
statb[10] = b.st_ctime;
statb[11] = b.st_blksize;
statb[12] = b.st_blocks;

return i;
#endif
}
2 changes: 1 addition & 1 deletion runtime/flang/getgid3f.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

/* getgid3f.c - Implements LIB3F getgid subprogram. */

#ifndef WINNT
#ifndef _WIN32

#include <unistd.h>
#include "ent3f.h"
Expand Down
3 changes: 2 additions & 1 deletion runtime/flang/getpid3f.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
/* getpid3f.c - Implements LIB3F getpid subprogram. */

#include "ent3f.h"
#ifndef _WIN32
#include <unistd.h>

#endif
int ENT3F(GETPID, getpid)() { return getpid(); }
2 changes: 1 addition & 1 deletion runtime/flang/getuid3f.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

/* getuid3f.c - Implements LIB3F getuid subprogram. */

#ifndef WINNT
#ifndef _WIN32

#include "ent3f.h"
#include <unistd.h>
Expand Down
2 changes: 1 addition & 1 deletion runtime/flang/lstat3f.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

/* lstat3f.c - Implements LIB3F lstat subprogram. */

#ifndef WINNT
#ifndef _WIN32

/* must include ent3f.h AFTER io3f.h */
#include <sys/stat.h>
Expand Down
4 changes: 3 additions & 1 deletion runtime/flang/timef3f.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@
#include "ent3f.h"

#define _LIBC_LIMITS_H_
#ifndef _WIN32
#include <unistd.h>
#include <sys/types.h>
#include <sys/times.h>
#endif
#include <sys/types.h>
#include <limits.h>

#ifndef CLK_TCK
Expand Down
2 changes: 1 addition & 1 deletion runtime/flang/times3f.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

/* times3f.c - Implements LIB3F times subprogram. */

#ifndef WINNT
#ifndef _WIN32

#include <sys/times.h>
#include "io3f.h"
Expand Down
8 changes: 4 additions & 4 deletions runtime/flangrti/iostdinit.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@

/* get environ */

#if defined(WIN32) || defined(WIN64)
#if defined(_WIN32)
/*
* enclose _fileno within parens to ensure calling the function rather than
* the _fileno function macro (if/when it exists).
*/
#define fileno(x) (_fileno)(x)
#endif

#if defined(WINNT)
#if defined(_WIN32)
#include <stdlib.h>
extern char **environ;
#elif defined(TARGET_OSX)
Expand Down Expand Up @@ -265,7 +265,7 @@ __io_fwrite(char *ptr, size_t size, size_t nitems, FILE *stream)
#endif
}

#if defined(WINNT) || defined(WIN64) || defined(WIN32)
#if defined(_WIN32)

#if defined(PGI_CRTDLL)
extern long *_imp___timezone_dll; /* for crtdll.dll */
Expand All @@ -283,7 +283,7 @@ __io_timezone(void *tm)
{
#if defined(SUN4) || defined(PPC) || defined(OSX86)
return ((struct tm *)tm)->tm_gmtoff;
#elif defined(WINNT) || defined(WIN64) || defined(WIN32)
#elif defined(_WIN32)
return (0);
#else
return -(timezone - (((struct tm *)tm)->tm_isdst ? 3600 : 0));
Expand Down
2 changes: 1 addition & 1 deletion runtime/flangrti/ktrap.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* \brief IEEE trap support
*/

#ifndef TARGET_WIN
#ifndef _WIN32

#include <fenv.h>

Expand Down
6 changes: 3 additions & 3 deletions runtime/flangrti/memalign.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include <stdio.h>
#include <stdlib.h>

#if (defined(WIN32) || defined(WIN64))
#if defined(_WIN32)
extern void *_aligned_malloc();
extern void _aligned_free();
#else
Expand Down Expand Up @@ -50,7 +50,7 @@ __aligned_malloc(size_t sz, size_t aln)
aln = 1 << s;
}
need = sz + MINALN;
#if (defined(WIN32) || defined(WIN64))
#if defined(_WIN32)
q = _aligned_malloc(need, aln);
if (!q)
return NULL;
Expand All @@ -63,7 +63,7 @@ __aligned_malloc(size_t sz, size_t aln)
void
__aligned_free(void *p)
{
#if (defined(WIN32) || defined(WIN64))
#if defined(_WIN32)
_aligned_free(p);
#else
free(p);
Expand Down
2 changes: 1 addition & 1 deletion runtime/flangrti/tempnam.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ extern char *tempnam(char *, char *);
char *
__io_tempnam(char *dir, char *pfx)
{
#if defined(WIN32) || defined(WIN64)
#if defined(_WIN32)
return (_tempnam(dir, pfx));
#else
return (tempnam(dir, pfx));
Expand Down
4 changes: 2 additions & 2 deletions runtime/flangrti/trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ dbg_stop_before_exit(void)
* 3 - traceback (signal)
*/

#if defined(WIN32) || defined(WIN64)
#if defined(_WIN32)
#define getpid _getpid
#define _Exit _exit
#endif
Expand Down Expand Up @@ -143,7 +143,7 @@ __abort_init(char *path)
int n;
int neg;

#if defined(WINNT)
#if defined(_WIN32)
fn = path;
#endif
p = getenv("TRACE_TERM");
Expand Down

0 comments on commit 17db496

Please sign in to comment.