From e58b8ed4888ecf658d2d2db1e75da9bd8e651236 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Mon, 12 Aug 2024 16:01:16 +0900 Subject: [PATCH] replace _MSC_VER ifdefs with _WIN32 they are mostly about windows, not msvc. --- lib/exec.c | 2 +- lib/fileio.c | 4 ++-- lib/nbio.c | 8 ++++---- lib/nbio.h | 2 +- lib/report.c | 2 +- lib/timeutil.c | 2 +- lib/timeutil.h | 2 +- lib/xlog.c | 4 ++-- 8 files changed, 13 insertions(+), 13 deletions(-) diff --git a/lib/exec.c b/lib/exec.c index 2d98d85a..e40581c9 100644 --- a/lib/exec.c +++ b/lib/exec.c @@ -1183,7 +1183,7 @@ check_interrupt_interval_ms(struct exec_context *ctx) #define CHECK_INTERVAL_DEFAULT 1000 #define CHECK_INTERVAL_MIN 1 -#if !defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION) && !defined(_MSC_VER) +#if !defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION) && !defined(_WIN32) #define ADJUST_CHECK_INTERVAL #else #undef ADJUST_CHECK_INTERVAL diff --git a/lib/fileio.c b/lib/fileio.c index 00a9137f..1e12550f 100644 --- a/lib/fileio.c +++ b/lib/fileio.c @@ -3,7 +3,7 @@ #include #include #include -#if defined(_MSC_VER) +#if defined(_WIN32) #include #define open _open #define O_RDONLY _O_RDONLY @@ -26,7 +26,7 @@ typedef int ssize_t; * * NuttX doesn't have working mmap. */ -#if defined(__wasi__) || defined(__NuttX__) || defined(_MSC_VER) +#if defined(__wasi__) || defined(__NuttX__) || defined(_WIN32) #include diff --git a/lib/nbio.c b/lib/nbio.c index 1a1560e4..556e004a 100644 --- a/lib/nbio.c +++ b/lib/nbio.c @@ -9,7 +9,7 @@ #include #include #include -#if !defined(_MSC_VER) +#if !defined(_WIN32) #include #include #include @@ -26,7 +26,7 @@ #define funlockfile(f) #endif -#if !defined(_MSC_VER) +#if !defined(_WIN32) int set_nonblocking(int fd, bool nonblocking, bool *orig) { @@ -60,7 +60,7 @@ is_again(int error) int nbio_vfprintf(FILE *fp, const char *fmt, va_list ap) { -#if defined(_MSC_VER) +#if defined(_WIN32) return vfprintf(fp, fmt, ap); #else /* @@ -145,7 +145,7 @@ nbio_printf(const char *fmt, ...) return ret; } -#if !defined(_MSC_VER) +#if !defined(_WIN32) ssize_t nbio_getline(char **linep, size_t *linecapp, FILE *fp) { diff --git a/lib/nbio.h b/lib/nbio.h index 87e57343..f2c6a133 100644 --- a/lib/nbio.h +++ b/lib/nbio.h @@ -22,7 +22,7 @@ __BEGIN_EXTERN_C int nbio_vfprintf(FILE *fp, const char *fmt, va_list ap); int nbio_fprintf(FILE *fp, const char *fmt, ...) __printflike(2, 3); int nbio_printf(const char *fmt, ...) __printflike(1, 2); -#if !defined(_MSC_VER) +#if !defined(_WIN32) ssize_t nbio_getline(char **linep, size_t *linecapp, FILE *fp); int set_nonblocking(int fd, bool nonblocking, bool *orig); bool is_again(int error); diff --git a/lib/report.c b/lib/report.c index a6d0243a..46800382 100644 --- a/lib/report.c +++ b/lib/report.c @@ -11,7 +11,7 @@ #include "report.h" #include "xlog.h" -#if defined(_MSC_VER) +#if defined(_WIN32) int vasprintf(char **resultp, const char *fmt, va_list ap) { diff --git a/lib/timeutil.c b/lib/timeutil.c index 646f390d..2c94d5cb 100644 --- a/lib/timeutil.c +++ b/lib/timeutil.c @@ -125,7 +125,7 @@ timespec_to_ms(const struct timespec *tv) return ms1 + ms2; } -#if !defined(_MSC_VER) +#if !defined(_WIN32) int timespec_now(clockid_t id, struct timespec *a) { diff --git a/lib/timeutil.h b/lib/timeutil.h index 831987e3..8fcdb8d9 100644 --- a/lib/timeutil.h +++ b/lib/timeutil.h @@ -21,7 +21,7 @@ void timespec_sub(const struct timespec *a, const struct timespec *b, int timespec_from_ns(struct timespec *a, uint64_t ns); uint64_t timespec_to_ms(const struct timespec *tv); -#if !defined(_MSC_VER) +#if !defined(_WIN32) int timespec_now(clockid_t id, struct timespec *a); int abstime_from_reltime_ns(clockid_t id, struct timespec *abstime, diff --git a/lib/xlog.c b/lib/xlog.c index a29b2927..25662f9a 100644 --- a/lib/xlog.c +++ b/lib/xlog.c @@ -27,7 +27,7 @@ int xlog_tracing = 0; * * windows doesn't seem to hawe flockfile either. */ -#if defined(__wasi__) || defined(__NuttX__) || defined(_MSC_VER) +#if defined(__wasi__) || defined(__NuttX__) || defined(_WIN32) #define flockfile(f) #define funlockfile(f) #endif @@ -35,7 +35,7 @@ int xlog_tracing = 0; void xlog_vprintf(const char *fmt, va_list ap) { -#if defined(_MSC_VER) +#if defined(_WIN32) flockfile(stderr); nbio_vfprintf(stderr, fmt, ap); funlockfile(stderr);