1#pragma once
2
3// TO KEEP THE INCLUDE DEPENDENCY CLEAN, PLEASE DO NOT INCLUDE ANY OTHER
4// TAICHI HEADERS INTO THIS ONE.
5//
6// TODO(#2196): Once we can slim down "taichi/common/core.h", consider moving
7// the contents back to core.h and delete this file.
8#ifndef _CRT_SECURE_NO_WARNINGS
9#define _CRT_SECURE_NO_WARNINGS
10#endif
11
12// https://gcc.gnu.org/wiki/Visibility
13#if defined _WIN32 || defined _WIN64 || defined __CYGWIN__
14#ifdef __GNUC__
15#define TI_DLL_EXPORT __attribute__((dllexport))
16#else
17#define TI_DLL_EXPORT __declspec(dllexport)
18#endif // __GNUC__
19#else
20#define TI_DLL_EXPORT __attribute__((visibility("default")))
21#endif // defined _WIN32 || defined _WIN64 || defined __CYGWIN__
22
23// Windows
24#if defined(_WIN64)
25#define TI_PLATFORM_WINDOWS
26#endif
27
28#if defined(_WIN32) && !defined(_WIN64)
29static_assert(false, "32-bit Windows systems are not supported")
30#endif
31
32// Linux
33#if defined(__linux__)
34#if defined(ANDROID)
35#define TI_PLATFORM_ANDROID
36#else
37#define TI_PLATFORM_LINUX
38#endif
39#endif
40
41// OSX
42#if defined(__APPLE__)
43#define TI_PLATFORM_OSX
44#endif
45
46#if (defined(TI_PLATFORM_LINUX) || defined(TI_PLATFORM_OSX) || \
47 defined(__unix__))
48#define TI_PLATFORM_UNIX
49#endif
50