Skip to content

Commit

Permalink
Using symbol __unix__ to improve portability
Browse files Browse the repository at this point in the history
  • Loading branch information
vtamara committed Aug 28, 2018
1 parent 395e54c commit 1a045d6
Show file tree
Hide file tree
Showing 13 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion ASCOfficeXlsFile2/source/XlsFormat/Auxiliary/HelpFunc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Common/DocxFormat/Source/Base/Types_32.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion DesktopEditor/agg-2.4/include/agg_math.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion DesktopEditor/agg-2.4/include/agg_span_gradient.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion DesktopEditor/common/File.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
#include <windows.h>
#endif

#if defined(__linux__) || defined(_MAC) && !defined(_IOS)
#if defined(__unix__) || defined(_MAC) && !defined(_IOS)
#include <unistd.h>
#include <string.h>
#endif
Expand Down
2 changes: 1 addition & 1 deletion DesktopEditor/common/Types.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ typedef int INT;
typedef unsigned int UINT, *PUINT;
typedef wchar_t WCHAR;

#ifdef __linux__
#ifdef __unix__
#include <inttypes.h>
typedef int64_t T_LONG64;
typedef uint64_t T_ULONG64;
Expand Down
2 changes: 1 addition & 1 deletion DesktopEditor/cximage/CxImage/ximainfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion DesktopEditor/cximage/raw/libdcr.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
#include <sys/types.h>
#endif

#if defined(_LINUX) || defined(__APPLE__)
#if defined(__unix__) || defined(__APPLE__)
#include <setjmp.h>
#include <sys/types.h>
#define _swab swab
Expand Down
10 changes: 5 additions & 5 deletions DjVuFile/libdjvu/ByteStream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,13 @@
# include <io.h>
#endif

#ifdef UNIX
#ifdef __unix__
# ifndef HAS_MEMMAP
# define HAS_MEMMAP 1
# endif
#endif

#ifdef UNIX
#ifdef __unix__
# include <sys/types.h>
# include <sys/stat.h>
# include <unistd.h>
Expand Down Expand Up @@ -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[])
Expand Down Expand Up @@ -1006,7 +1006,7 @@ ByteStream::create(const GURL &url,char const * const xmode)
{
GP<ByteStream> retval;
const char *mode = ((xmode) ? xmode : "rb");
#ifdef UNIX
#ifdef __unix__
if (!strcmp(mode,"rb"))
{
int fd = urlopen(url,O_RDONLY,0777);
Expand Down
2 changes: 1 addition & 1 deletion DjVuFile/libdjvu/DjVuDocument.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@

#include "debug.h"

#if defined(__linux__) || defined(LINUX)
#if defined(__unix__) || defined(LINUX)
typedef unsigned int UINT;
#endif

Expand Down
2 changes: 1 addition & 1 deletion HtmlFile/HtmlFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
#include <vector>
#include <map>

#ifdef LINUX
#ifdef __unix__
#include <unistd.h>
#include <sys/wait.h>
#include <stdio.h>
Expand Down
2 changes: 1 addition & 1 deletion OfficeUtils/src/zlib-1.2.3/contrib/minizip/miniunz.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include <errno.h>
#include <fcntl.h>

#if defined(unix) || defined(_LINUX)
#if defined(__unix__)
# include <unistd.h>
# include <utime.h>
#else
Expand Down
2 changes: 1 addition & 1 deletion PdfWriter/Src/Types.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
#include <algorithm>
#include <math.h>

#ifdef __linux__
#ifdef __unix__
#include <string.h>
#endif

Expand Down

0 comments on commit 1a045d6

Please sign in to comment.