use the compiler-defined _WIN32 define

Summary:
WIN32 is defined by windows.h. _WIN32 is defined by the compiler. The
latter is more reliable under refactoring.

Reviewed By: xavierd

Differential Revision: D47528663

fbshipit-source-id: 494f18d94968d9c8ea38fe395881e87c0368728e
This commit is contained in:
Chad Austin 2023-07-17 15:18:23 -07:00 committed by Facebook GitHub Bot
parent f4dfef01d0
commit 05ab2eb53d
2 changed files with 3 additions and 3 deletions

View File

@ -176,7 +176,7 @@ int main(int argc, char** argv) {
return 1;
}
#ifdef WIN32
#ifdef _WIN32
if (shouldRecordFilesystemSamples(FLAGS_interface)) {
std::cerr << "Filesystem sha1 not currently supported" << std::endl;
return 1;

View File

@ -122,7 +122,7 @@ inline fattr3 statToFattr3(const struct stat& stat) {
return fattr3{
/*type*/ modeToFtype3(stat.st_mode),
/*mode*/ modeToNfsMode(stat.st_mode),
#ifndef WIN32
#ifndef _WIN32
/*nlink*/ folly::to_narrow(stat.st_nlink),
/*uid*/ stat.st_uid,
/*gid*/ stat.st_gid,
@ -132,7 +132,7 @@ inline fattr3 statToFattr3(const struct stat& stat) {
/*gid*/ uint32_t(stat.st_gid),
#endif
/*size*/ folly::to_unsigned(stat.st_size),
#ifndef WIN32
#ifndef _WIN32
/*used*/ folly::to_unsigned(stat.st_blocks) * 512u,
#else
/*used*/ 0,