Ultralight C++ API 1.3.0
Loading...
Searching...
No Matches
Defines.h
Go to the documentation of this file.
1/******************************************************************************
2 * This file is a part of Ultralight, an ultra-portable web-browser engine. *
3 * *
4 * See <https://ultralig.ht> for licensing and more. *
5 * *
6 * (C) 2023 Ultralight, Inc. *
7 *****************************************************************************/
8#pragma once
9
10// Needed for limit defines, like INTMAX_MAX, which is used by the std C++ library
11#ifndef __STDC_LIMIT_MACROS
12#define __STDC_LIMIT_MACROS
13#endif
14
15#include <cstdint>
16#include <cstddef>
17#include <limits.h>
18
19#ifdef SWIG
20#define AExport
21#else
22
23// Require C++11 Support
24#if defined(_MSC_VER)
25# if _MSC_VER < 1800
26# error This project needs at least Visual Studio 2013 to build
27# endif
28#elif __cplusplus <= 199711L
29# error This project can only be compiled with a compiler that supports C++11
30#endif
31
32#if defined(ULTRALIGHT_STATIC_BUILD)
33# define AExport
34#else
35# if defined(__WIN32__) || defined(_WIN32)
36# if defined(APPCORE_IMPLEMENTATION)
37# define AExport __declspec(dllexport)
38# else
39# define AExport __declspec(dllimport)
40# endif
41# else
42# define AExport __attribute__((visibility("default")))
43# endif
44#endif
45
46#if defined(__WIN32__) || defined(_WIN32)
47# define _thread_local __declspec(thread)
48# ifndef _NATIVE_WCHAR_T_DEFINED
49# define DISABLE_NATIVE_WCHAR_T
50# endif
51#else
52# define _thread_local __thread
53#endif
54
55#endif