Skip to content

Commit 1a045d6

Browse files
committed
Using symbol __unix__ to improve portability
1 parent 395e54c commit 1a045d6

File tree

13 files changed

+17
-17
lines changed

13 files changed

+17
-17
lines changed

ASCOfficeXlsFile2/source/XlsFormat/Auxiliary/HelpFunc.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ const std::wstring unescape_ST_Xstring(const std::wstring& wstr)
351351

352352
while(true)
353353
{
354-
#if defined(__linux__) || defined(_MAC)
354+
#if defined(__unix__) || defined(_MAC)
355355
const auto it_range = boost::make_iterator_range(x_pos_noncopied, wstr_end);
356356
x_pos_next = boost::algorithm::find_first(it_range, L"_x").begin();
357357
#else

Common/DocxFormat/Source/Base/Types_32.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
typedef uint16_t _UINT16;
4646
typedef uint32_t _UINT32;
4747
typedef uint64_t _UINT64;
48-
#elif __APPLE__
48+
#elif defined(__APPLE__) || defined(__unix__)
4949
#include "stdint.h"
5050
typedef int16_t _INT16;
5151
typedef int32_t _INT32;

DesktopEditor/agg-2.4/include/agg_math.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ namespace agg
431431
}
432432
}
433433

434-
#if defined(_LINUX) || defined(__APPLE__)
434+
#if defined(__unix__) || defined(__APPLE__)
435435
inline double _hypot(const double& x, const double& y)
436436
{
437437
return sqrt(x * x + y * y);

DesktopEditor/agg-2.4/include/agg_span_gradient.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
namespace agg
2626
{
27-
#if !defined(_LINUX) && !(defined(_WIN32) || defined (_WIN64)) && !defined(__APPLE__)
27+
#if !defined(__unix__) && !(defined(_WIN32) || defined (_WIN64)) && !defined(__APPLE__)
2828
double _hypot(double x, double y)
2929
{
3030
return sqrt(x*x + y*y);

DesktopEditor/common/File.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
#include <windows.h>
4040
#endif
4141

42-
#if defined(__linux__) || defined(_MAC) && !defined(_IOS)
42+
#if defined(__unix__) || defined(_MAC) && !defined(_IOS)
4343
#include <unistd.h>
4444
#include <string.h>
4545
#endif

DesktopEditor/common/Types.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ typedef int INT;
7575
typedef unsigned int UINT, *PUINT;
7676
typedef wchar_t WCHAR;
7777

78-
#ifdef __linux__
78+
#ifdef __unix__
7979
#include <inttypes.h>
8080
typedef int64_t T_LONG64;
8181
typedef uint64_t T_ULONG64;

DesktopEditor/cximage/CxImage/ximainfo.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
#include "ximage.h"
77

8-
#if defined(_LINUX) || defined(__APPLE__)
8+
#if defined(__unix__) || defined(__APPLE__)
99
#ifdef UNICODE
1010
#define _tcsnicmp(a,b,c) wcscasecmp(a,b)
1111
#else

DesktopEditor/cximage/raw/libdcr.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
#include <sys/types.h>
4343
#endif
4444

45-
#if defined(_LINUX) || defined(__APPLE__)
45+
#if defined(__unix__) || defined(__APPLE__)
4646
#include <setjmp.h>
4747
#include <sys/types.h>
4848
#define _swab swab

DjVuFile/libdjvu/ByteStream.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,13 @@
8181
# include <io.h>
8282
#endif
8383

84-
#ifdef UNIX
84+
#ifdef __unix__
8585
# ifndef HAS_MEMMAP
8686
# define HAS_MEMMAP 1
8787
# endif
8888
#endif
8989

90-
#ifdef UNIX
90+
#ifdef __unix__
9191
# include <sys/types.h>
9292
# include <sys/stat.h>
9393
# include <unistd.h>
@@ -673,13 +673,13 @@ urlfopen(const GURL &url,const char mode[])
673673
#endif
674674
}
675675

676-
#ifdef UNIX
676+
#ifdef __unix__
677677
static int
678678
urlopen(const GURL &url, const int mode, const int perm)
679679
{
680680
return open((const char *)url.NativeFilename(),mode,perm);
681681
}
682-
#endif /* UNIX */
682+
#endif /* __unix__ */
683683

684684
GUTF8String
685685
ByteStream::Stdio::init(const GURL &url, const char mode[])
@@ -1006,7 +1006,7 @@ ByteStream::create(const GURL &url,char const * const xmode)
10061006
{
10071007
GP<ByteStream> retval;
10081008
const char *mode = ((xmode) ? xmode : "rb");
1009-
#ifdef UNIX
1009+
#ifdef __unix__
10101010
if (!strcmp(mode,"rb"))
10111011
{
10121012
int fd = urlopen(url,O_RDONLY,0777);

DjVuFile/libdjvu/DjVuDocument.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878

7979
#include "debug.h"
8080

81-
#if defined(__linux__) || defined(LINUX)
81+
#if defined(__unix__) || defined(LINUX)
8282
typedef unsigned int UINT;
8383
#endif
8484

HtmlFile/HtmlFile.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
#include <vector>
4646
#include <map>
4747

48-
#ifdef LINUX
48+
#ifdef __unix__
4949
#include <unistd.h>
5050
#include <sys/wait.h>
5151
#include <stdio.h>

OfficeUtils/src/zlib-1.2.3/contrib/minizip/miniunz.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#include <errno.h>
1414
#include <fcntl.h>
1515

16-
#if defined(unix) || defined(_LINUX)
16+
#if defined(__unix__)
1717
# include <unistd.h>
1818
# include <utime.h>
1919
#else

PdfWriter/Src/Types.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
#include <algorithm>
4747
#include <math.h>
4848

49-
#ifdef __linux__
49+
#ifdef __unix__
5050
#include <string.h>
5151
#endif
5252

0 commit comments

Comments
 (0)