Skip to content

Commit

Permalink
Fix checking Windows platform with preprocessor (#9460)
Browse files Browse the repository at this point in the history
Check _WIN32 instead of _MSC_VER because the later one is for MSVC only.
This fixes building with mingw-w64 toolchain which uses GCC or Clang.
  • Loading branch information
Biswa96 authored Feb 1, 2022
1 parent aa896f6 commit 7e5bfe8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/google/protobuf/io/zero_copy_stream_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
#include <chrono>
#include <thread>

#ifndef _MSC_VER
#ifndef _WIN32
#include <sys/socket.h>
#include <unistd.h>
#endif
Expand Down Expand Up @@ -764,7 +764,7 @@ TEST_F(IoTest, FileIo) {
}
}

#ifndef _MSC_VER
#ifndef _WIN32
// This tests the FileInputStream with a non blocking file. It opens a pipe in
// non blocking mode, then starts reading it. The writing thread starts writing
// 100ms after that.
Expand Down

0 comments on commit 7e5bfe8

Please sign in to comment.