Loading...
Searching...
No Matches
 
 
 
 
 
Go to the documentation of this file.
   10#define PRISM_DEFINES_H 
   25#define __STDC_FORMAT_MACROS 
   36#ifndef PRISM_DEPTH_MAXIMUM 
   37    #define PRISM_DEPTH_MAXIMUM 10000 
   45#ifndef PRISM_EXPORTED_FUNCTION 
   46#   ifdef PRISM_EXPORT_SYMBOLS 
   48#          define PRISM_EXPORTED_FUNCTION __declspec(dllexport) extern 
   50#          define PRISM_EXPORTED_FUNCTION __attribute__((__visibility__("default"))) extern 
   53#       define PRISM_EXPORTED_FUNCTION 
   64#   if defined(__MINGW_PRINTF_FORMAT) 
   65#       define PRISM_ATTRIBUTE_FORMAT(string_index, argument_index) __attribute__((format(__MINGW_PRINTF_FORMAT, string_index, argument_index))) 
   67#       define PRISM_ATTRIBUTE_FORMAT(string_index, argument_index) __attribute__((format(printf, string_index, argument_index))) 
   69#elif defined(__clang__) 
   70#   define PRISM_ATTRIBUTE_FORMAT(string_index, argument_index) __attribute__((__format__(__printf__, string_index, argument_index))) 
   72#   define PRISM_ATTRIBUTE_FORMAT(string_index, argument_index) 
   81#   define PRISM_ATTRIBUTE_UNUSED __attribute__((unused)) 
   83#   define PRISM_ATTRIBUTE_UNUSED 
   90#if defined(_MSC_VER) && !defined(inline) 
   91#   define inline __inline 
   98#if !defined(snprintf) && defined(_MSC_VER) && (_MSC_VER < 1900) 
   99#   define snprintf _snprintf 
  106#define PM_CONCATENATE(left, right) left ## right 
  113#if defined(_Static_assert) 
  114#   define PM_STATIC_ASSERT(line, condition, message) _Static_assert(condition, message) 
  116#   define PM_STATIC_ASSERT(line, condition, message) typedef char PM_CONCATENATE(static_assert_, line)[(condition) ? 1 : -1] 
  125#   define PRISM_HAS_MMAP 
  128#   ifdef _POSIX_MAPPED_FILES 
  129#       define PRISM_HAS_MMAP 
  138#ifndef PRISM_HAS_NO_FILESYSTEM 
  139#   define PRISM_HAS_FILESYSTEM 
  149    #define PRISM_ISINF(x) (!_finite(x)) 
  151    #define PRISM_ISINF(x) isinf(x) 
  171#ifdef PRISM_XALLOCATOR 
  172    #include "prism_xallocator.h" 
  179        #define xmalloc malloc 
  187        #define xrealloc realloc 
  195        #define xcalloc calloc 
  211#ifdef PRISM_BUILD_MINIMAL 
  213    #define PRISM_EXCLUDE_SERIALIZATION 
  216    #define PRISM_EXCLUDE_JSON 
  219    #define PRISM_EXCLUDE_PACK 
  222    #define PRISM_EXCLUDE_PRETTYPRINT 
  225    #define PRISM_ENCODING_EXCLUDE_FULL 
  232#if defined(__GNUC__) || defined(__clang__) 
  234    #define PRISM_LIKELY(x) __builtin_expect(!!(x), 1) 
  237    #define PRISM_UNLIKELY(x) __builtin_expect(!!(x), 0) 
  240    #define PRISM_LIKELY(x)   (x) 
  243    #define PRISM_UNLIKELY(x) (x) 
  250#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L  
  251    #define PRISM_FALLTHROUGH [[fallthrough]]; 
  252#elif defined(__GNUC__) || defined(__clang__) 
  253    #define PRISM_FALLTHROUGH __attribute__((fallthrough)); 
  254#elif defined(_MSC_VER) 
  255    #define PRISM_FALLTHROUGH __fallthrough; 
  257    #define PRISM_FALLTHROUGH