Loading...
Searching...
No Matches
Go to the documentation of this file.
10#define PRISM_DEFINES_H
25#define __STDC_FORMAT_MACROS
33#ifndef PRISM_DEPTH_MAXIMUM
34 #define PRISM_DEPTH_MAXIMUM 1000
42#ifndef PRISM_EXPORTED_FUNCTION
43# ifdef PRISM_EXPORT_SYMBOLS
45# define PRISM_EXPORTED_FUNCTION __declspec(dllexport) extern
47# define PRISM_EXPORTED_FUNCTION __attribute__((__visibility__("default"))) extern
50# define PRISM_EXPORTED_FUNCTION
61# if defined(__MINGW_PRINTF_FORMAT)
62# define PRISM_ATTRIBUTE_FORMAT(string_index, argument_index) __attribute__((format(__MINGW_PRINTF_FORMAT, string_index, argument_index)))
64# define PRISM_ATTRIBUTE_FORMAT(string_index, argument_index) __attribute__((format(printf, string_index, argument_index)))
66#elif defined(__clang__)
67# define PRISM_ATTRIBUTE_FORMAT(string_index, argument_index) __attribute__((__format__(__printf__, string_index, argument_index)))
69# define PRISM_ATTRIBUTE_FORMAT(string_index, argument_index)
78# define PRISM_ATTRIBUTE_UNUSED __attribute__((unused))
80# define PRISM_ATTRIBUTE_UNUSED
87#if defined(_MSC_VER) && !defined(inline)
88# define inline __inline
95#if !defined(snprintf) && defined(_MSC_VER) && (_MSC_VER < 1900)
96# define snprintf _snprintf
103#define PM_CONCATENATE(left, right) left ## right
110#if defined(_Static_assert)
111# define PM_STATIC_ASSERT(line, condition, message) _Static_assert(condition, message)
113# define PM_STATIC_ASSERT(line, condition, message) typedef char PM_CONCATENATE(static_assert_, line)[(condition) ? 1 : -1]
122# define PRISM_HAS_MMAP
125# ifdef _POSIX_MAPPED_FILES
126# define PRISM_HAS_MMAP
135#ifndef PRISM_HAS_NO_FILESYSTEM
136# define PRISM_HAS_FILESYSTEM
146 #define PRISM_ISINF(x) (!_finite(x))
148 #define PRISM_ISINF(x) isinf(x)
168#ifdef PRISM_XALLOCATOR
169 #include "prism_xallocator.h"
176 #define xmalloc malloc
184 #define xrealloc realloc
192 #define xcalloc calloc
208#ifdef PRISM_BUILD_MINIMAL
210 #define PRISM_EXCLUDE_SERIALIZATION
213 #define PRISM_EXCLUDE_JSON
216 #define PRISM_EXCLUDE_PACK
219 #define PRISM_EXCLUDE_PRETTYPRINT
222 #define PRISM_ENCODING_EXCLUDE_FULL
229#if defined(__GNUC__) || defined(__clang__)
231 #define PRISM_LIKELY(x) __builtin_expect(!!(x), 1)
234 #define PRISM_UNLIKELY(x) __builtin_expect(!!(x), 0)
237 #define PRISM_LIKELY(x) (x)
240 #define PRISM_UNLIKELY(x) (x)
247#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L
248 #define PRISM_FALLTHROUGH [[fallthrough]];
249#elif defined(__GNUC__) || defined(__clang__)
250 #define PRISM_FALLTHROUGH __attribute__((fallthrough));
251#elif defined(_MSC_VER)
252 #define PRISM_FALLTHROUGH __fallthrough;
254 #define PRISM_FALLTHROUGH