1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2025-08-11 02:17:11 +02:00
Files
.github
bin
module
vendor
CPR
ConcurrentQueue
Fmt
JSMN
MaxmindDB
POCO
ApacheConnector
CppParser
CppUnit
Crypto
Data
Encodings
Foundation
cmake
include
Poco
Dynamic
ASCIIEncoding.h
AbstractCache.h
AbstractDelegate.h
AbstractEvent.h
AbstractObserver.h
AbstractPriorityDelegate.h
AbstractStrategy.h
AccessExpirationDecorator.h
AccessExpireCache.h
AccessExpireLRUCache.h
AccessExpireStrategy.h
ActiveDispatcher.h
ActiveMethod.h
ActiveResult.h
ActiveRunnable.h
ActiveStarter.h
Activity.h
Alignment.h
Any.h
ArchiveStrategy.h
Array.h
Ascii.h
AsyncChannel.h
AtomicCounter.h
AtomicFlag.h
AutoPtr.h
AutoReleasePool.h
Base32Decoder.h
Base32Encoder.h
Base64Decoder.h
Base64Encoder.h
BasicEvent.h
BinaryReader.h
BinaryWriter.h
Buffer.h
BufferAllocator.h
BufferedBidirectionalStreamBuf.h
BufferedStreamBuf.h
Bugcheck.h
ByteOrder.h
Channel.h
Checksum.h
ClassLibrary.h
ClassLoader.h
Clock.h
Condition.h
Config.h
Configurable.h
ConsoleChannel.h
CountingStream.h
DataURIStream.h
DataURIStreamFactory.h
DateTime.h
DateTimeFormat.h
DateTimeFormatter.h
DateTimeParser.h
Debugger.h
DefaultStrategy.h
DeflatingStream.h
Delegate.h
DigestEngine.h
DigestStream.h
DirectoryIterator.h
DirectoryIteratorStrategy.h
DirectoryIterator_UNIX.h
DirectoryIterator_WIN32U.h
DirectoryWatcher.h
DynamicAny.h
DynamicAnyHolder.h
DynamicFactory.h
DynamicStruct.h
Environment.h
Environment_UNIX.h
Environment_VX.h
Environment_WIN32U.h
Environment_WINCE.h
Error.h
ErrorHandler.h
Event.h
EventArgs.h
EventChannel.h
EventLogChannel.h
Event_POSIX.h
Event_VX.h
Event_WIN32.h
Exception.h
ExpirationDecorator.h
Expire.h
ExpireCache.h
ExpireLRUCache.h
ExpireStrategy.h
FIFOBuffer.h
FIFOBufferStream.h
FIFOEvent.h
FIFOStrategy.h
FPEnvironment.h
FPEnvironment_C99.h
FPEnvironment_DEC.h
FPEnvironment_DUMMY.h
FPEnvironment_QNX.h
FPEnvironment_SUN.h
FPEnvironment_WIN32.h
File.h
FileChannel.h
FileStream.h
FileStreamFactory.h
FileStream_POSIX.h
FileStream_WIN32.h
File_UNIX.h
File_VX.h
File_WIN32U.h
File_WINCE.h
Format.h
Formatter.h
FormattingChannel.h
Foundation.h
FunctionDelegate.h
FunctionPriorityDelegate.h
Glob.h
HMACEngine.h
Hash.h
HashFunction.h
HashMap.h
HashSet.h
HashStatistic.h
HashTable.h
HexBinaryDecoder.h
HexBinaryEncoder.h
InflatingStream.h
Instantiator.h
JSONString.h
KeyValueArgs.h
LRUCache.h
LRUStrategy.h
Latin1Encoding.h
Latin2Encoding.h
Latin9Encoding.h
LineEndingConverter.h
LinearHashTable.h
ListMap.h
LocalDateTime.h
LogFile.h
LogFile_STD.h
LogFile_WIN32U.h
LogStream.h
Logger.h
LoggingFactory.h
LoggingRegistry.h
MD4Engine.h
MD5Engine.h
Manifest.h
MemoryPool.h
MemoryStream.h
Message.h
MetaObject.h
MetaProgramming.h
Mutex.h
Mutex_POSIX.h
Mutex_VX.h
Mutex_WIN32.h
Mutex_WINCE.h
NObserver.h
NamedEvent.h
NamedEvent_Android.h
NamedEvent_UNIX.h
NamedEvent_WIN32U.h
NamedMutex.h
NamedMutex_Android.h
NamedMutex_UNIX.h
NamedMutex_WIN32U.h
NamedTuple.h
NestedDiagnosticContext.h
Notification.h
NotificationCenter.h
NotificationQueue.h
NotificationStrategy.h
NullChannel.h
NullStream.h
Nullable.h
NumberFormatter.h
NumberParser.h
NumericString.h
ObjectPool.h
Observer.h
Optional.h
OrderedMap.h
OrderedSet.h
PBKDF2Engine.h
Path.h
Path_UNIX.h
Path_WIN32U.h
Path_WINCE.h
PatternFormatter.h
Pipe.h
PipeImpl.h
PipeImpl_DUMMY.h
PipeImpl_POSIX.h
PipeImpl_WIN32.h
PipeStream.h
Platform.h
Platform_POSIX.h
Platform_VX.h
Platform_WIN32.h
Poco.h
PriorityDelegate.h
PriorityEvent.h
PriorityExpire.h
PriorityNotificationQueue.h
PriorityStrategy.h
Process.h
Process_UNIX.h
Process_VX.h
Process_WIN32U.h
Process_WINCE.h
PurgeStrategy.h
RWLock.h
RWLock_Android.h
RWLock_POSIX.h
RWLock_VX.h
RWLock_WIN32.h
RWLock_WINCE.h
Random.h
RandomStream.h
RecursiveDirectoryIterator.h
RecursiveDirectoryIteratorImpl.h
RefCountedObject.h
RegularExpression.h
RotateStrategy.h
Runnable.h
RunnableAdapter.h
SHA1Engine.h
SHA2Engine.h
ScopedLock.h
ScopedUnlock.h
Semaphore.h
Semaphore_POSIX.h
Semaphore_VX.h
Semaphore_WIN32.h
SharedLibrary.h
SharedLibrary_HPUX.h
SharedLibrary_UNIX.h
SharedLibrary_VX.h
SharedLibrary_WIN32U.h
SharedMemory.h
SharedMemory_DUMMY.h
SharedMemory_POSIX.h
SharedMemory_WIN32.h
SharedPtr.h
SignalHandler.h
SimpleFileChannel.h
SimpleHashTable.h
SingletonHolder.h
SortedDirectoryIterator.h
SplitterChannel.h
Stopwatch.h
StrategyCollection.h
StreamChannel.h
StreamConverter.h
StreamCopier.h
StreamTokenizer.h
StreamUtil.h
String.h
StringTokenizer.h
SynchronizedObject.h
SyslogChannel.h
Task.h
TaskManager.h
TaskNotification.h
TeeStream.h
TemporaryFile.h
TextBufferIterator.h
TextConverter.h
TextEncoding.h
TextIterator.h
Thread.h
ThreadLocal.h
ThreadPool.h
ThreadTarget.h
Thread_POSIX.h
Thread_VX.h
Thread_WIN32.h
Thread_WINCE.h
TimedNotificationQueue.h
Timer.h
Timespan.h
Timestamp.h
Timezone.h
Token.h
Tuple.h
TypeList.h
Types.h
URI.h
URIStreamFactory.h
URIStreamOpener.h
UTF16Encoding.h
UTF32Encoding.h
UTF8Encoding.h
UTF8String.h
UTFString.h
UUID.h
UUIDGenerator.h
UnWindows.h
UnbufferedStreamBuf.h
Unicode.h
UnicodeConverter.h
UniqueAccessExpireCache.h
UniqueAccessExpireLRUCache.h
UniqueAccessExpireStrategy.h
UniqueExpireCache.h
UniqueExpireLRUCache.h
UniqueExpireStrategy.h
ValidArgs.h
Version.h
Void.h
Windows1250Encoding.h
Windows1251Encoding.h
Windows1252Encoding.h
WindowsConsoleChannel.h
ordered_hash.h
ordered_map.h
ordered_set.h
zconf.h
zlib.h
samples
src
testsuite
wcelibcex-1.0
CMakeLists.txt
Foundation_vs140.sln
Foundation_vs140.vcxproj
Foundation_vs140.vcxproj.filters
Foundation_vs150.sln
Foundation_vs150.vcxproj
Foundation_vs150.vcxproj.filters
Foundation_vs160.sln
Foundation_vs160.vcxproj
Foundation_vs160.vcxproj.filters
Makefile
extradirs
JSON
JWT
MongoDB
Net
NetSSL_OpenSSL
NetSSL_Win
PDF
PageCompiler
PocoDoc
ProGen
Redis
SevenZip
Util
XML
Zip
appveyor
build
cmake
contrib
doc
packaging
patches
release
travis
.gitattributes
.gitignore
.gitmodules
.travis.yml
CHANGELOG
CMakeLists.txt
CODE_OF_CONDUCT.md
CONTRIBUTING.md
CONTRIBUTORS
LICENSE
Makefile
NEWS
README
README.md
VERSION
appveyor.yml
build_cmake.cmd
build_cmake.sh
build_vs140.cmd
build_vs150.cmd
build_vs160.cmd
buildwin.cmd
buildwin.ps1
components
configure
cppignore.lnx
cppignore.win
env.bat
env.sh
libversion
SimpleIni
Squirrel
TinyDir
ZMQ
CMakeLists.txt
.gitignore
.gitmodules
CMakeLists.txt
LICENSE
README.md
SqMod/vendor/POCO/Foundation/include/Poco/Platform.h
Sandu Liviu Catalin 4a6bfc086c Major plugin refactor and cleanup.
Switched to POCO library for unified platform/library interface.
Deprecated the external module API. It was creating more problems than solving.
Removed most built-in libraries in favor of system libraries for easier maintenance.
Cleaned and secured code with help from static analyzers.
2021-01-30 08:51:39 +02:00

288 lines
8.9 KiB
C

//
// Platform.h
//
// Library: Foundation
// Package: Core
// Module: Platform
//
// Platform and architecture identification macros.
//
// NOTE: This file may be included from both C++ and C code, so it
// must not contain any C++ specific things.
//
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#ifndef Foundation_Platform_INCLUDED
#define Foundation_Platform_INCLUDED
//
// Platform Identification
//
#define POCO_OS_FREE_BSD 0x0001
#define POCO_OS_AIX 0x0002
#define POCO_OS_HPUX 0x0003
#define POCO_OS_TRU64 0x0004
#define POCO_OS_LINUX 0x0005
#define POCO_OS_MAC_OS_X 0x0006
#define POCO_OS_NET_BSD 0x0007
#define POCO_OS_OPEN_BSD 0x0008
#define POCO_OS_IRIX 0x0009
#define POCO_OS_SOLARIS 0x000a
#define POCO_OS_QNX 0x000b
#define POCO_OS_VXWORKS 0x000c
#define POCO_OS_CYGWIN 0x000d
#define POCO_OS_NACL 0x000e
#define POCO_OS_ANDROID 0x000f
#define POCO_OS_UNKNOWN_UNIX 0x00ff
#define POCO_OS_WINDOWS_NT 0x1001
#define POCO_OS_WINDOWS_CE 0x1011
#define POCO_OS_VMS 0x2001
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
#define POCO_OS_FAMILY_UNIX 1
#define POCO_OS_FAMILY_BSD 1
#define POCO_OS POCO_OS_FREE_BSD
#elif defined(_AIX) || defined(__TOS_AIX__)
#define POCO_OS_FAMILY_UNIX 1
#define POCO_OS POCO_OS_AIX
#elif defined(hpux) || defined(_hpux) || defined(__hpux)
#define POCO_OS_FAMILY_UNIX 1
#define POCO_OS POCO_OS_HPUX
#elif defined(__digital__) || defined(__osf__)
#define POCO_OS_FAMILY_UNIX 1
#define POCO_OS POCO_OS_TRU64
#elif defined(__NACL__)
#define POCO_OS_FAMILY_UNIX 1
#define POCO_OS POCO_OS_NACL
#elif defined(linux) || defined(__linux) || defined(__linux__) || defined(__TOS_LINUX__) || defined(EMSCRIPTEN)
#define POCO_OS_FAMILY_UNIX 1
#if defined(__ANDROID__)
#define POCO_OS POCO_OS_ANDROID
#else
#define POCO_OS POCO_OS_LINUX
#endif
#elif defined(__APPLE__) || defined(__TOS_MACOS__)
#define POCO_OS_FAMILY_UNIX 1
#define POCO_OS_FAMILY_BSD 1
#define POCO_OS POCO_OS_MAC_OS_X
#elif defined(__NetBSD__)
#define POCO_OS_FAMILY_UNIX 1
#define POCO_OS_FAMILY_BSD 1
#define POCO_OS POCO_OS_NET_BSD
#elif defined(__OpenBSD__)
#define POCO_OS_FAMILY_UNIX 1
#define POCO_OS_FAMILY_BSD 1
#define POCO_OS POCO_OS_OPEN_BSD
#elif defined(sgi) || defined(__sgi)
#define POCO_OS_FAMILY_UNIX 1
#define POCO_OS POCO_OS_IRIX
#elif defined(sun) || defined(__sun)
#define POCO_OS_FAMILY_UNIX 1
#define POCO_OS POCO_OS_SOLARIS
#elif defined(__QNX__)
#define POCO_OS_FAMILY_UNIX 1
#define POCO_OS POCO_OS_QNX
#elif defined(__CYGWIN__)
#define POCO_OS_FAMILY_UNIX 1
#define POCO_OS POCO_OS_CYGWIN
#elif defined(POCO_VXWORKS)
#define POCO_OS_FAMILY_UNIX 1
#define POCO_OS POCO_OS_VXWORKS
#elif defined(unix) || defined(__unix) || defined(__unix__)
#define POCO_OS_FAMILY_UNIX 1
#define POCO_OS POCO_OS_UNKNOWN_UNIX
#elif defined(_WIN32_WCE)
#define POCO_OS_FAMILY_WINDOWS 1
#define POCO_OS POCO_OS_WINDOWS_CE
#elif defined(_WIN32) || defined(_WIN64)
#define POCO_OS_FAMILY_WINDOWS 1
#define POCO_OS POCO_OS_WINDOWS_NT
#elif defined(__VMS)
#define POCO_OS_FAMILY_VMS 1
#define POCO_OS POCO_OS_VMS
#endif
#if !defined(POCO_OS)
#error "Unknown Platform."
#endif
//
// Hardware Architecture and Byte Order
//
#define POCO_ARCH_ALPHA 0x01
#define POCO_ARCH_IA32 0x02
#define POCO_ARCH_IA64 0x03
#define POCO_ARCH_MIPS 0x04
#define POCO_ARCH_HPPA 0x05
#define POCO_ARCH_PPC 0x06
#define POCO_ARCH_POWER 0x07
#define POCO_ARCH_SPARC 0x08
#define POCO_ARCH_AMD64 0x09
#define POCO_ARCH_ARM 0x0a
#define POCO_ARCH_M68K 0x0b
#define POCO_ARCH_S390 0x0c
#define POCO_ARCH_SH 0x0d
#define POCO_ARCH_NIOS2 0x0e
#define POCO_ARCH_AARCH64 0x0f
#define POCO_ARCH_ARM64 0x0f // same as POCO_ARCH_AARCH64
#define POCO_ARCH_RISCV64 0x10
#if defined(__ALPHA) || defined(__alpha) || defined(__alpha__) || defined(_M_ALPHA)
#define POCO_ARCH POCO_ARCH_ALPHA
#define POCO_ARCH_LITTLE_ENDIAN 1
#elif defined(i386) || defined(__i386) || defined(__i386__) || defined(_M_IX86) || defined(EMSCRIPTEN)
#define POCO_ARCH POCO_ARCH_IA32
#define POCO_ARCH_LITTLE_ENDIAN 1
#elif defined(_IA64) || defined(__IA64__) || defined(__ia64__) || defined(__ia64) || defined(_M_IA64)
#define POCO_ARCH POCO_ARCH_IA64
#if defined(hpux) || defined(_hpux)
#define POCO_ARCH_BIG_ENDIAN 1
#else
#define POCO_ARCH_LITTLE_ENDIAN 1
#endif
#elif defined(__x86_64__) || defined(_M_X64)
#define POCO_ARCH POCO_ARCH_AMD64
#define POCO_ARCH_LITTLE_ENDIAN 1
#elif defined(__mips__) || defined(__mips) || defined(__MIPS__) || defined(_M_MRX000)
#define POCO_ARCH POCO_ARCH_MIPS
#if defined(POCO_OS_FAMILY_WINDOWS)
// Is this OK? Supports windows only little endian??
#define POCO_ARCH_LITTLE_ENDIAN 1
#elif defined(__MIPSEB__) || defined(_MIPSEB) || defined(__MIPSEB)
#define POCO_ARCH_BIG_ENDIAN 1
#elif defined(__MIPSEL__) || defined(_MIPSEL) || defined(__MIPSEL)
#define POCO_ARCH_LITTLE_ENDIAN 1
#else
#error "MIPS but neither MIPSEL nor MIPSEB?"
#endif
#elif defined(__hppa) || defined(__hppa__)
#define POCO_ARCH POCO_ARCH_HPPA
#define POCO_ARCH_BIG_ENDIAN 1
#elif defined(__PPC) || defined(__POWERPC__) || defined(__powerpc) || defined(__PPC__) || \
defined(__powerpc__) || defined(__ppc__) || defined(__ppc) || defined(_ARCH_PPC) || defined(_M_PPC)
#define POCO_ARCH POCO_ARCH_PPC
#if defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
#define POCO_ARCH_LITTLE_ENDIAN 1
#else
#define POCO_ARCH_BIG_ENDIAN 1
#endif
#elif defined(_POWER) || defined(_ARCH_PWR) || defined(_ARCH_PWR2) || defined(_ARCH_PWR3) || \
defined(_ARCH_PWR4) || defined(__THW_RS6000)
#define POCO_ARCH POCO_ARCH_POWER
#define POCO_ARCH_BIG_ENDIAN 1
#elif defined(__sparc__) || defined(__sparc) || defined(sparc)
#define POCO_ARCH POCO_ARCH_SPARC
#define POCO_ARCH_BIG_ENDIAN 1
#elif defined(__arm__) || defined(__arm) || defined(ARM) || defined(_ARM_) || defined(__ARM__) || defined(_M_ARM)
#define POCO_ARCH POCO_ARCH_ARM
#if defined(__ARMEB__)
#define POCO_ARCH_BIG_ENDIAN 1
#else
#define POCO_ARCH_LITTLE_ENDIAN 1
#endif
#elif defined(__arm64__) || defined(__arm64)
#define POCO_ARCH POCO_ARCH_ARM64
#if defined(__ARMEB__)
#define POCO_ARCH_BIG_ENDIAN 1
#elif defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
#define POCO_ARCH_BIG_ENDIAN 1
#else
#define POCO_ARCH_LITTLE_ENDIAN 1
#endif
#elif defined(__m68k__)
#define POCO_ARCH POCO_ARCH_M68K
#define POCO_ARCH_BIG_ENDIAN 1
#elif defined(__s390__)
#define POCO_ARCH POCO_ARCH_S390
#define POCO_ARCH_BIG_ENDIAN 1
#elif defined(__sh__) || defined(__sh) || defined(SHx) || defined(_SHX_)
#define POCO_ARCH POCO_ARCH_SH
#if defined(__LITTLE_ENDIAN__) || (POCO_OS == POCO_OS_WINDOWS_CE)
#define POCO_ARCH_LITTLE_ENDIAN 1
#else
#define POCO_ARCH_BIG_ENDIAN 1
#endif
#elif defined (nios2) || defined(__nios2) || defined(__nios2__)
#define POCO_ARCH POCO_ARCH_NIOS2
#if defined(__nios2_little_endian) || defined(nios2_little_endian) || defined(__nios2_little_endian__)
#define POCO_ARCH_LITTLE_ENDIAN 1
#else
#define POCO_ARCH_BIG_ENDIAN 1
#endif
#elif defined(__AARCH64EL__)
#define POCO_ARCH POCO_ARCH_AARCH64
#define POCO_ARCH_LITTLE_ENDIAN 1
#elif defined(__AARCH64EB__)
#define POCO_ARCH POCO_ARCH_AARCH64
#define POCO_ARCH_BIG_ENDIAN 1
#elif defined(__riscv) && (__riscv_xlen == 64)
#define POCO_ARCH POCO_ARCH_RISCV64
#define POCO_ARCH_LITTLE_ENDIAN 1
#endif
#if defined(__clang__)
#define POCO_COMPILER_CLANG
#elif defined(_MSC_VER)
#define POCO_COMPILER_MSVC
#elif defined (__GNUC__)
#define POCO_COMPILER_GCC
#if defined (__MINGW32__) || defined (__MINGW64__)
#define POCO_COMPILER_MINGW
#endif
#elif defined (__MINGW32__) || defined (__MINGW64__)
#define POCO_COMPILER_MINGW
#elif defined (__INTEL_COMPILER) || defined(__ICC) || defined(__ECC) || defined(__ICL)
#define POCO_COMPILER_INTEL
#elif defined (__SUNPRO_CC)
#define POCO_COMPILER_SUN
#elif defined (__MWERKS__) || defined(__CWCC__)
#define POCO_COMPILER_CODEWARRIOR
#elif defined (__sgi) || defined(sgi)
#define POCO_COMPILER_SGI
#elif defined (__HP_aCC)
#define POCO_COMPILER_HP_ACC
#elif defined (__BORLANDC__) || defined(__CODEGEARC__)
#define POCO_COMPILER_CBUILDER
#elif defined (__DMC__)
#define POCO_COMPILER_DMARS
#elif defined (__DECCXX)
#define POCO_COMPILER_COMPAC
#elif (defined (__xlc__) || defined (__xlC__)) && defined(__IBMCPP__)
#define POCO_COMPILER_IBM_XLC // IBM XL C++
#elif defined (__IBMCPP__) && defined(__COMPILER_VER__)
#define POCO_COMPILER_IBM_XLC_ZOS // IBM z/OS C++
#endif
#ifdef __GNUC__
#define POCO_UNUSED __attribute__((unused))
#else
#define POCO_UNUSED
#endif // __GNUC__
#if !defined(POCO_ARCH)
#error "Unknown Hardware Architecture."
#endif
#if defined(POCO_OS_FAMILY_WINDOWS)
#define POCO_DEFAULT_NEWLINE_CHARS "\r\n"
#else
#define POCO_DEFAULT_NEWLINE_CHARS "\n"
#endif
#endif // Foundation_Platform_INCLUDED