Skip to content

Commit

Permalink
Change WIN32 macro to _WIN32
Browse files Browse the repository at this point in the history
  • Loading branch information
abellgithub committed Jun 17, 2019
1 parent 949880e commit 162ff1c
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 10 deletions.
6 changes: 3 additions & 3 deletions pdal/PDALUtils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ inline MetadataNode toMetadata(const BOX3D& bounds)

inline int openProgress(const std::string& filename)
{
#ifdef WIN32
#ifdef _WIN32
return -1;
#else
int fd = open(filename.c_str(), O_WRONLY | O_NONBLOCK);
Expand All @@ -235,7 +235,7 @@ inline int openProgress(const std::string& filename)

inline void closeProgress(int fd)
{
#ifdef WIN32
#ifdef _WIN32
#else
if (fd >= 0)
close(fd);
Expand All @@ -246,7 +246,7 @@ inline void closeProgress(int fd)
inline void writeProgress(int fd, const std::string& type,
const std::string& text)
{
#ifdef WIN32
#ifdef _WIN32
#else
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-result"
Expand Down
8 changes: 4 additions & 4 deletions pdal/util/FileUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

#include <iostream>
#include <sstream>
#ifndef WIN32
#ifndef _WIN32
#include <glob.h>
#else
#include <codecvt>
Expand Down Expand Up @@ -73,7 +73,7 @@ std::string addTrailingSlash(std::string path)
return path;
}

#ifdef WIN32
#ifdef _WIN32
inline std::string fromNative(std::wstring const& in)
{
// TODO: C++11 define convert with static thread_local
Expand Down Expand Up @@ -285,7 +285,7 @@ std::string toAbsolutePath(const std::string& filename)
{
std::string result;
#ifdef WIN32
#ifdef _WIN32
char buf[MAX_PATH]
if (GetFullPathName(filename.c_str(), MAX_PATH, buf, NULL))
result = buf;
Expand Down Expand Up @@ -372,7 +372,7 @@ bool isAbsolutePath(const std::string& path)
void fileTimes(const std::string& filename, struct tm *createTime,
struct tm *modTime)
{
#ifdef WIN32
#ifdef _WIN32
std::wstring const wfilename(toNative(filename));
struct _stat statbuf;
_wstat(wfilename.c_str(), &statbuf);
Expand Down
2 changes: 1 addition & 1 deletion pdal/util/Utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ std::string Utils::demangle(const std::string& s)

int Utils::screenWidth()
{
#ifdef WIN32
#ifdef _WIN32
return 80;
#else
struct winsize ws;
Expand Down
1 change: 1 addition & 0 deletions scripts/docker/alpine/Dockerfile.dependencies
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ RUN \
curl-dev \
postgresql-dev \
sqlite-dev \
zstd-dev \
libcrypto1.1@edgemain \
xerces-c@edgetesting \
libspatialite-dev@edgetesting \
Expand Down
2 changes: 1 addition & 1 deletion test/unit/apps/TIndexTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ TEST(TIndex, test2)
TEST(TIndex, test3)
{
// No find on Windows.
#ifndef WIN32
#ifndef _WIN32
std::string outSpec(Support::temppath("tindex.out"));
std::string outPoints(Support::temppath("points.txt"));

Expand Down
2 changes: 1 addition & 1 deletion test/unit/apps/TranslateTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ TEST(TranslateTest, t3)
std::string meta = Support::temppath("meta.json");

EXPECT_EQ(runTranslate(in + " " + out + " --metadata " + meta, output), 0);
#ifndef WIN32
#ifndef _WIN32
Utils::run_shell_command("grep -c readers.las " + meta, output);
EXPECT_EQ(std::stoi(output), 1);
Utils::run_shell_command("grep -c writers.las " + meta, output);
Expand Down

0 comments on commit 162ff1c

Please sign in to comment.