sculpto
platform_detection.h
Go to the documentation of this file.
1/*!****************************************************************//*!*
2 * \file platform.h
3 * \brief Sculpto library platform definition module.
4 *
5 * \author Sabitov Kirill
6 * \date 22 June 2022
7 *********************************************************************/
8
9#pragma once
10
11// Check if platform is not defined already
12#if !defined(SCL_PLATFORM_WINDOWS) && \
13 !defined(SCL_PLATFORM_IOS) && \
14 !defined(SCL_PLATFORM_MACOS) && \
15 !defined(SCL_PLATFORM_ANDROID) && \
16 !defined(SCL_PLATFORM_LINUX)
17 // Platform detection using predefined macros
18# ifdef _WIN32
20# ifdef _WIN64
22# define SCL_PLATFORM_WINDOWS
23# else
25# error "x86 Builds are not supported!"
26# endif
27# elif defined(__APPLE__) || defined(__MACH__)
28# include <TargetConditionals.h>
33# if TARGET_IPHONE_SIMULATOR == 1
34# error "IOS simulator is not supported!"
35# elif TARGET_OS_IPHONE == 1
36# define SCL_PLATFORM_IOS
37# error "IOS is not supported!"
38# elif TARGET_OS_MAC == 1
39# define SCL_PLATFORM_MACOS
40# error "MacOS is not supported!"
41# else
42# error "Unknown Apple platform!"
43# endif
47# elif defined(__ANDROID__)
48# define SCL_PLATFORM_ANDROID
49# error "Android is not supported!"
50# elif defined(__linux__)
51# define SCL_PLATFORM_LINUX
52# error "Linux is not supported!"
53# else
55# error "Unknown platform!"
56# endif // End of platform detection
57#endif