Skip to content

Commit

Permalink
replace _MSC_VER ifdefs with _WIN32
Browse files Browse the repository at this point in the history
they are mostly about windows, not msvc.
  • Loading branch information
yamt committed Aug 12, 2024
1 parent 45cebeb commit e58b8ed
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion lib/exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions lib/fileio.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include <fcntl.h>
#include <stddef.h>
#include <sys/stat.h>
#if defined(_MSC_VER)
#if defined(_WIN32)
#include <io.h>
#define open _open
#define O_RDONLY _O_RDONLY
Expand All @@ -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 <stdlib.h>

Expand Down
8 changes: 4 additions & 4 deletions lib/nbio.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#if !defined(_MSC_VER)
#if !defined(_WIN32)
#include <fcntl.h>
#include <poll.h>
#include <unistd.h>
Expand All @@ -26,7 +26,7 @@
#define funlockfile(f)
#endif

#if !defined(_MSC_VER)
#if !defined(_WIN32)
int
set_nonblocking(int fd, bool nonblocking, bool *orig)
{
Expand Down Expand Up @@ -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
/*
Expand Down Expand Up @@ -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)
{
Expand Down
2 changes: 1 addition & 1 deletion lib/nbio.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion lib/report.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
2 changes: 1 addition & 1 deletion lib/timeutil.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
2 changes: 1 addition & 1 deletion lib/timeutil.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions lib/xlog.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ 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

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);
Expand Down

0 comments on commit e58b8ed

Please sign in to comment.