From 1a045d6ee5161cacffb843a950bc0d16451bc0d6 Mon Sep 17 00:00:00 2001 From: Vladimir Tamara Date: Mon, 27 Aug 2018 23:26:29 -0500 Subject: [PATCH] Using symbol __unix__ to improve portability --- .../source/XlsFormat/Auxiliary/HelpFunc.cpp | 2 +- Common/DocxFormat/Source/Base/Types_32.h | 2 +- DesktopEditor/agg-2.4/include/agg_math.h | 2 +- DesktopEditor/agg-2.4/include/agg_span_gradient.h | 2 +- DesktopEditor/common/File.cpp | 2 +- DesktopEditor/common/Types.h | 2 +- DesktopEditor/cximage/CxImage/ximainfo.cpp | 2 +- DesktopEditor/cximage/raw/libdcr.h | 2 +- DjVuFile/libdjvu/ByteStream.cpp | 10 +++++----- DjVuFile/libdjvu/DjVuDocument.cpp | 2 +- HtmlFile/HtmlFile.cpp | 2 +- OfficeUtils/src/zlib-1.2.3/contrib/minizip/miniunz.c | 2 +- PdfWriter/Src/Types.h | 2 +- 13 files changed, 17 insertions(+), 17 deletions(-) diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Auxiliary/HelpFunc.cpp b/ASCOfficeXlsFile2/source/XlsFormat/Auxiliary/HelpFunc.cpp index 00ca75ab0f7..8bee1597b69 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Auxiliary/HelpFunc.cpp +++ b/ASCOfficeXlsFile2/source/XlsFormat/Auxiliary/HelpFunc.cpp @@ -351,7 +351,7 @@ const std::wstring unescape_ST_Xstring(const std::wstring& wstr) while(true) { -#if defined(__linux__) || defined(_MAC) +#if defined(__unix__) || defined(_MAC) const auto it_range = boost::make_iterator_range(x_pos_noncopied, wstr_end); x_pos_next = boost::algorithm::find_first(it_range, L"_x").begin(); #else diff --git a/Common/DocxFormat/Source/Base/Types_32.h b/Common/DocxFormat/Source/Base/Types_32.h index 1a7e6be09de..1448d6be6be 100644 --- a/Common/DocxFormat/Source/Base/Types_32.h +++ b/Common/DocxFormat/Source/Base/Types_32.h @@ -45,7 +45,7 @@ typedef uint16_t _UINT16; typedef uint32_t _UINT32; typedef uint64_t _UINT64; -#elif __APPLE__ +#elif defined(__APPLE__) || defined(__unix__) #include "stdint.h" typedef int16_t _INT16; typedef int32_t _INT32; diff --git a/DesktopEditor/agg-2.4/include/agg_math.h b/DesktopEditor/agg-2.4/include/agg_math.h index 58d99bfa9ef..ef577d47d4f 100644 --- a/DesktopEditor/agg-2.4/include/agg_math.h +++ b/DesktopEditor/agg-2.4/include/agg_math.h @@ -431,7 +431,7 @@ namespace agg } } -#if defined(_LINUX) || defined(__APPLE__) +#if defined(__unix__) || defined(__APPLE__) inline double _hypot(const double& x, const double& y) { return sqrt(x * x + y * y); diff --git a/DesktopEditor/agg-2.4/include/agg_span_gradient.h b/DesktopEditor/agg-2.4/include/agg_span_gradient.h index 8543a4dcc2d..2a8c7345a58 100644 --- a/DesktopEditor/agg-2.4/include/agg_span_gradient.h +++ b/DesktopEditor/agg-2.4/include/agg_span_gradient.h @@ -24,7 +24,7 @@ namespace agg { -#if !defined(_LINUX) && !(defined(_WIN32) || defined (_WIN64)) && !defined(__APPLE__) +#if !defined(__unix__) && !(defined(_WIN32) || defined (_WIN64)) && !defined(__APPLE__) double _hypot(double x, double y) { return sqrt(x*x + y*y); diff --git a/DesktopEditor/common/File.cpp b/DesktopEditor/common/File.cpp index a0c5de31900..5144508a988 100644 --- a/DesktopEditor/common/File.cpp +++ b/DesktopEditor/common/File.cpp @@ -39,7 +39,7 @@ #include #endif -#if defined(__linux__) || defined(_MAC) && !defined(_IOS) +#if defined(__unix__) || defined(_MAC) && !defined(_IOS) #include #include #endif diff --git a/DesktopEditor/common/Types.h b/DesktopEditor/common/Types.h index e25da42ae73..25336d5c502 100644 --- a/DesktopEditor/common/Types.h +++ b/DesktopEditor/common/Types.h @@ -75,7 +75,7 @@ typedef int INT; typedef unsigned int UINT, *PUINT; typedef wchar_t WCHAR; -#ifdef __linux__ +#ifdef __unix__ #include typedef int64_t T_LONG64; typedef uint64_t T_ULONG64; diff --git a/DesktopEditor/cximage/CxImage/ximainfo.cpp b/DesktopEditor/cximage/CxImage/ximainfo.cpp index e3a278c0c0f..5d1b6cd1be8 100644 --- a/DesktopEditor/cximage/CxImage/ximainfo.cpp +++ b/DesktopEditor/cximage/CxImage/ximainfo.cpp @@ -5,7 +5,7 @@ #include "ximage.h" -#if defined(_LINUX) || defined(__APPLE__) +#if defined(__unix__) || defined(__APPLE__) #ifdef UNICODE #define _tcsnicmp(a,b,c) wcscasecmp(a,b) #else diff --git a/DesktopEditor/cximage/raw/libdcr.h b/DesktopEditor/cximage/raw/libdcr.h index 212c15a2e44..632d79cd06c 100644 --- a/DesktopEditor/cximage/raw/libdcr.h +++ b/DesktopEditor/cximage/raw/libdcr.h @@ -42,7 +42,7 @@ #include #endif -#if defined(_LINUX) || defined(__APPLE__) +#if defined(__unix__) || defined(__APPLE__) #include #include #define _swab swab diff --git a/DjVuFile/libdjvu/ByteStream.cpp b/DjVuFile/libdjvu/ByteStream.cpp index 37dfe0de215..ffe28560ac0 100644 --- a/DjVuFile/libdjvu/ByteStream.cpp +++ b/DjVuFile/libdjvu/ByteStream.cpp @@ -81,13 +81,13 @@ # include #endif -#ifdef UNIX +#ifdef __unix__ # ifndef HAS_MEMMAP # define HAS_MEMMAP 1 # endif #endif -#ifdef UNIX +#ifdef __unix__ # include # include # include @@ -673,13 +673,13 @@ urlfopen(const GURL &url,const char mode[]) #endif } -#ifdef UNIX +#ifdef __unix__ static int urlopen(const GURL &url, const int mode, const int perm) { return open((const char *)url.NativeFilename(),mode,perm); } -#endif /* UNIX */ +#endif /* __unix__ */ GUTF8String ByteStream::Stdio::init(const GURL &url, const char mode[]) @@ -1006,7 +1006,7 @@ ByteStream::create(const GURL &url,char const * const xmode) { GP retval; const char *mode = ((xmode) ? xmode : "rb"); -#ifdef UNIX +#ifdef __unix__ if (!strcmp(mode,"rb")) { int fd = urlopen(url,O_RDONLY,0777); diff --git a/DjVuFile/libdjvu/DjVuDocument.cpp b/DjVuFile/libdjvu/DjVuDocument.cpp index 020d8f22981..237ffc2b1ca 100644 --- a/DjVuFile/libdjvu/DjVuDocument.cpp +++ b/DjVuFile/libdjvu/DjVuDocument.cpp @@ -78,7 +78,7 @@ #include "debug.h" -#if defined(__linux__) || defined(LINUX) +#if defined(__unix__) || defined(LINUX) typedef unsigned int UINT; #endif diff --git a/HtmlFile/HtmlFile.cpp b/HtmlFile/HtmlFile.cpp index 27f67dac127..c8230ca236b 100644 --- a/HtmlFile/HtmlFile.cpp +++ b/HtmlFile/HtmlFile.cpp @@ -45,7 +45,7 @@ #include #include -#ifdef LINUX +#ifdef __unix__ #include #include #include diff --git a/OfficeUtils/src/zlib-1.2.3/contrib/minizip/miniunz.c b/OfficeUtils/src/zlib-1.2.3/contrib/minizip/miniunz.c index b6736689483..3faa589ce03 100644 --- a/OfficeUtils/src/zlib-1.2.3/contrib/minizip/miniunz.c +++ b/OfficeUtils/src/zlib-1.2.3/contrib/minizip/miniunz.c @@ -13,7 +13,7 @@ #include #include -#if defined(unix) || defined(_LINUX) +#if defined(__unix__) # include # include #else diff --git a/PdfWriter/Src/Types.h b/PdfWriter/Src/Types.h index d465bb2033d..74d3d5f7ae5 100644 --- a/PdfWriter/Src/Types.h +++ b/PdfWriter/Src/Types.h @@ -46,7 +46,7 @@ #include #include -#ifdef __linux__ +#ifdef __unix__ #include #endif