82 lines
2.6 KiB
C
82 lines
2.6 KiB
C
|
|
/* - | Copyright | ------------------------------------------------------------
|
||
|
|
Copyright (c) 2026 Randy Jordan
|
||
|
|
|
||
|
|
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||
|
|
this software and associated documentation files (the "Software"), to deal in
|
||
|
|
the Software without restriction, including without limitation the rights to
|
||
|
|
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||
|
|
of the Software, and to permit persons to whom the Software is furnished to do
|
||
|
|
so, subject to the following conditions:
|
||
|
|
|
||
|
|
The above copyright notice and this permission notice shall be included in all
|
||
|
|
copies or substantial portions of the Software.
|
||
|
|
|
||
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||
|
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||
|
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||
|
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||
|
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||
|
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||
|
|
SOFTWARE.
|
||
|
|
|
||
|
|
* --------------------------------------------------------------------------*/
|
||
|
|
#ifndef CI2_OS_H
|
||
|
|
#define CI2_OS_H
|
||
|
|
|
||
|
|
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__)
|
||
|
|
/* Entire windows platform */
|
||
|
|
#define CI2_WIN_APIVER 0x0600 // Vista
|
||
|
|
#define NOMINMAX // Don't define min/max macros
|
||
|
|
#define _CRT_SECURE_NO_WARNINGS // No unsafe C warnings
|
||
|
|
#define _CRT_RAND_S // TODO
|
||
|
|
#define OEMRESOURCE // GUI must be before windows.h
|
||
|
|
#include <windows.h> // haha
|
||
|
|
#define CI2_WINDOWS
|
||
|
|
|
||
|
|
#ifdef _WIN64
|
||
|
|
/* Windows (64-bit only) */
|
||
|
|
#define CI2_WINDOWS_64
|
||
|
|
#else
|
||
|
|
/* Windows (32-bit only) */
|
||
|
|
#define CI2_WINDOWS_32
|
||
|
|
#endif
|
||
|
|
|
||
|
|
#elif __APPLE__
|
||
|
|
#define CI2_UNIX
|
||
|
|
#define CI2_APPLE
|
||
|
|
#include <TargetConditionals.h>
|
||
|
|
#if TARGET_IPHONE_SIMULATOR
|
||
|
|
// iOS, tvOS, or watchOS Simulator
|
||
|
|
#define CI2_IOS
|
||
|
|
#elif TARGET_OS_MACCATALYST
|
||
|
|
// Mac's Catalyst (ports iOS API into Mac, like UIKit).
|
||
|
|
#define CI2_IOS
|
||
|
|
#elif TARGET_OS_IPHONE
|
||
|
|
// iOS, tvOS, or watchOS device
|
||
|
|
#define CI2_IOS
|
||
|
|
#elif TARGET_OS_MAC
|
||
|
|
// Other kinds of Apple platforms
|
||
|
|
#define CI2_OSX
|
||
|
|
#else
|
||
|
|
#error "Unknown Apple platform"
|
||
|
|
#endif
|
||
|
|
|
||
|
|
#elif __ANDROID__
|
||
|
|
#define CI2_UNIX
|
||
|
|
#define CI2_ANDROID
|
||
|
|
|
||
|
|
#elif __linux__
|
||
|
|
#define CI2_UNIX
|
||
|
|
|
||
|
|
#elif __unix__ // TODO BSD Variants
|
||
|
|
#define CI2_UNIX
|
||
|
|
|
||
|
|
#elif defined(_POSIX_VERSION)
|
||
|
|
#define CI2_POSIX
|
||
|
|
|
||
|
|
#else
|
||
|
|
#error "Unknown and unsupported operating system."
|
||
|
|
#endif
|
||
|
|
|
||
|
|
#endif // ci2_os.h
|