Loading...
Searching...
No Matches
Defines.h
Go to the documentation of this file.
1/**************************************************************************************************
2 * This file is a part of Ultralight. *
3 * *
4 * See <https://ultralig.ht> for licensing and more. *
5 * *
6 * (C) 2024 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 UExport
21#else
22
23#include "Exports.h"
24
25// Require C++11 Support
26#if defined(_MSC_VER)
27# if _MSC_VER < 1800
28# error This project needs at least Visual Studio 2013 to build
29# endif
30#elif __cplusplus <= 199711L
31# error This project can only be compiled with a compiler that supports C++11
32#endif
33
34#if INTPTR_MAX == INT32_MAX
35# define UL_ARCH_32_BIT
36#elif INTPTR_MAX == INT64_MAX
37# define UL_ARCH_64_BIT
38#else
39# error "Unknown CPU architecture: environment not 32 or 64-bit."
40#endif
41
42#if defined(__aarch64__)
43# define UL_ARCH_ARM64
44# if defined(__APPLE__)
45# define UL_ARCH_ARM64_APPLE_SILICON
46# endif
47#endif
48
49#if defined(__WIN32__) || defined(_WIN32)
50# define _thread_local __declspec(thread)
51# ifndef _NATIVE_WCHAR_T_DEFINED
52# define DISABLE_NATIVE_WCHAR_T
53# endif
54#else
55# define _thread_local __thread
56#endif
57
58#ifndef UL_COMPILER_GCC_LIKE
59# define UL_COMPILER_GCC_LIKE (defined(__clang__) || defined(__GNUC__) || defined(__GNUG__))
60#endif
61
62#ifndef UL_ALWAYS_INLINE
63#if defined(UL_COMPILER_GCC_LIKE) && defined(NDEBUG)
64# define UL_ALWAYS_INLINE inline __attribute__((__always_inline__))
65# elif defined(_MSC_VER) && defined(NDEBUG)
66# define UL_ALWAYS_INLINE __forceinline
67# else
68# define UL_ALWAYS_INLINE inline
69# endif
70#endif
71
72#ifndef UL_UNLIKELY
73# if defined(UL_COMPILER_GCC_LIKE)
74# define UL_UNLIKELY(x) __builtin_expect(!!(x), 0)
75# else
76# define UL_UNLIKELY(x) (x)
77# endif
78#endif
79
80#endif
81
82#define ULTRALIGHT_VERSION "1.4.0"
83#define ULTRALIGHT_VERSION_MAJOR 1
84#define ULTRALIGHT_VERSION_MINOR 4
85#define ULTRALIGHT_VERSION_PATCH 0
86
87#define WEBKIT_VERSION "615.1.18.100.1"
88#define WEBKIT_VERSION_MAJOR 615
89#define WEBKIT_VERSION_MINOR 1
90#define WEBKIT_VERSION_TINY 18
91#define WEBKIT_VERSION_MICRO 100
92#define WEBKIT_VERSION_NANO 1
93
94#ifdef __cplusplus
95extern "C" {
96#endif
97
98///
99/// Full library version string (corresponds to ULTRALIGHT_VERSION)
100///
102
106
107///
108/// Full WebKit version string (corresponds to WEBKIT_VERSION)
109///
111
117
118#ifdef __cplusplus
119}
120#endif
#define UExport
Definition Exports.h:25
uint32_t UltralightVersionMinor()
uint32_t UltralightVersionPatch()
uint32_t WebKitVersionMinor()
uint32_t WebKitVersionNano()
uint32_t WebKitVersionMicro()
uint32_t WebKitVersionMajor()
uint32_t UltralightVersionMajor()
const char * WebKitVersionString()
Full WebKit version string (corresponds to WEBKIT_VERSION)
uint32_t WebKitVersionTiny()
const char * UltralightVersionString()
Full library version string (corresponds to ULTRALIGHT_VERSION)