aboutsummaryrefslogtreecommitdiff
path: root/src/StormPort.h
diff options
context:
space:
mode:
authorLadislav Zezula <zezula@volny.cz>2021-05-15 19:56:19 +0200
committerGitHub <noreply@github.com>2021-05-15 19:56:19 +0200
commita7ebfbccb7eb16f4852a7fd3bd6a738ecb7db423 (patch)
tree19266c6af697656321e84eb3ac28adc5829eb68a /src/StormPort.h
parent1e9f1cb3218b3ce8cca7683966234bc19647ef6d (diff)
parent05d3a57b8a1ac88e22657290396a9b334a2bee1a (diff)
Merge pull request #223 from ladislav-zezula/CLANG_12_MAC
Clang 12 mac
Diffstat (limited to 'src/StormPort.h')
-rw-r--r--src/StormPort.h45
1 files changed, 12 insertions, 33 deletions
diff --git a/src/StormPort.h b/src/StormPort.h
index ba78d7f..d386414 100644
--- a/src/StormPort.h
+++ b/src/StormPort.h
@@ -94,8 +94,14 @@
#endif
#define PKEXPORT
- #define __SYS_ZLIB
- #define __SYS_BZLIB
+
+ #ifndef __SYS_ZLIB
+ #define __SYS_ZLIB
+ #endif
+
+ #ifndef __SYS_BZLIB
+ #define __SYS_BZLIB
+ #endif
#ifndef __BIG_ENDIAN__
#define STORMLIB_LITTLE_ENDIAN
@@ -271,14 +277,13 @@
#define STORMLIB_LITTLE_ENDIAN
#endif
- #define STORMLIB_LINUX
-
// Platforms with mmap support
#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
#include <sys/mman.h>
#define STORMLIB_HAS_MMAP
#endif
+ #define STORMLIB_LINUX
#define STORMLIB_PLATFORM_DEFINED
#endif
@@ -363,8 +368,8 @@
#define O_LARGEFILE 0
#endif
-// Platform-specific error codes for UNIX-based platforms
-#if defined(STORMLIB_MAC) || defined(STORMLIB_LINUX)
+// Platform-specific error codes for non-Windows platforms
+#ifndef ERROR_SUCCESS
#define ERROR_SUCCESS 0
#define ERROR_FILE_NOT_FOUND ENOENT
#define ERROR_ACCESS_DENIED EPERM
@@ -383,6 +388,7 @@
#define ERROR_FILE_CORRUPT 1004 // No such error code under Linux
#endif
+// Macros that can sometimes be missing
#ifndef _countof
#define _countof(x) (sizeof(x) / sizeof(x[0]))
#endif
@@ -436,31 +442,4 @@
#define BSWAP_TMPKHEADER(a) ConvertTMPKHeader((a))
#endif
-//-----------------------------------------------------------------------------
-// Macro for deprecated symbols
-
-/*
-#ifdef _MSC_VER
- #if _MSC_FULL_VER >= 140050320
- #define STORMLIB_DEPRECATED(_Text) __declspec(deprecated(_Text))
- #else
- #define STORMLIB_DEPRECATED(_Text) __declspec(deprecated)
- #endif
-#else
- #ifdef __GNUC__
- #define STORMLIB_DEPRECATED(_Text) __attribute__((deprecated))
- #else
- #define STORMLIB_DEPRECATED(_Text) __attribute__((deprecated(_Text)))
- #endif
-#endif
-
-// When a flag is deprecated, use this macro
-#ifndef _STORMLIB_NO_DEPRECATE
- #define STORMLIB_DEPRECATED_FLAG(type, oldflag, newflag) \
- const STORMLIB_DEPRECATED(#oldflag " is deprecated. Use " #newflag ". To supress this warning, define _STORMLIB_NO_DEPRECATE") static type oldflag = (type)newflag;
-#else
-#define STORMLIB_DEPRECATED_FLAG(type, oldflag, newflag) static type oldflag = (type)newflag;
-#endif
-*/
-
#endif // __STORMPORT_H__