mirror of
https://github.com/Ed94/metadesk.git
synced 2026-08-05 15:18:46 +00:00
starting to offload MD namespace for repo to gen_c11 .refactor script and gen_cpp17 to namespace macros
This commit is contained in:
@@ -30,6 +30,24 @@
|
||||
#define local_persist static
|
||||
#endif
|
||||
|
||||
#if MD_COMPILER_MSVC
|
||||
# define thread_static __declspec(thread)
|
||||
#elif MD_COMPILER_CLANG || MD_COMPILER_GCC
|
||||
# define thread_static __thread
|
||||
#endif
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Branch Predictor Hints
|
||||
|
||||
#if defined(__clang__)
|
||||
# define expect(expr, val) __builtin_expect((expr), (val))
|
||||
#else
|
||||
# define expect(expr, val) (expr)
|
||||
#endif
|
||||
|
||||
#define likely(expr) expect(expr,1)
|
||||
#define unlikely(expr) expect(expr,0)
|
||||
|
||||
#if MD_COMPILER_CPP
|
||||
# ifndef ccast
|
||||
# define ccast( type, value ) ( const_cast< type >( (value) ) )
|
||||
@@ -106,6 +124,17 @@
|
||||
# define MD_PARAM_DEFAULT
|
||||
#endif
|
||||
|
||||
#if MD_COMPILER_C
|
||||
#ifndef static_assert
|
||||
#undef static_assert
|
||||
#if MD_COMPILER_C && __STDC_VERSION__ >= 201112L
|
||||
#define static_assert(condition, message) _Static_assert(condition, message)
|
||||
#else
|
||||
#define static_assert(condition, message) typedef char static_assertion_##__LINE__[(condition)?1:-1]
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if MD_DONT_USE_NAMESPACE || MD_COMPILER_C
|
||||
# if MD_COMPILER_C
|
||||
# define MD_NS
|
||||
|
||||
Reference in New Issue
Block a user