23#define ALIB_VERSION 2402
24#define ALIB_REVISION 1
31#if !defined( ALIB_ALOX ) \
32 && !defined( ALIB_BITBUFFER ) \
33 && !defined( ALIB_BOXING ) \
34 && !defined( ALIB_CHARACTERS ) \
35 && !defined( ALIB_CLI ) \
36 && !defined( ALIB_CONFIGURATION) \
37 && !defined( ALIB_ENUMS ) \
38 && !defined( ALIB_EXPRESSIONS ) \
39 && !defined( ALIB_FILES ) \
40 && !defined( ALIB_MONOMEM ) \
41 && !defined( ALIB_SINGLETONS ) \
42 && !defined( ALIB_STRINGS ) \
43 && !defined( ALIB_CAMP ) \
44 && !defined( ALIB_TIME ) \
45 && !defined( ALIB_THREADS )
47# define ALIB_EXPRESSIONS 1
50# define ALIB_THREADS 1
51# define ALIB_BITBUFFER 1
54#if !defined(ALIB_ALOX )
57#if !defined(ALIB_BITBUFFER )
58# define ALIB_BITBUFFER 0
60#if !defined(ALIB_BOXING )
63#if !defined(ALIB_CLI )
66#if !defined(ALIB_CHARACTERS )
67# define ALIB_CHARACTERS 0
69#if !defined(ALIB_CONFIGURATION)
70# define ALIB_CONFIGURATION 0
72#if !defined(ALIB_ENUMS )
75#if !defined(ALIB_EXPRESSIONS )
76# define ALIB_EXPRESSIONS 0
78#if !defined(ALIB_FILES )
81#if !defined(ALIB_MONOMEM )
82# define ALIB_MONOMEM 0
84#if !defined(ALIB_SINGLETONS )
85# define ALIB_SINGLETONS 0
87#if !defined(ALIB_STRINGS )
88# define ALIB_STRINGS 0
90#if !defined(ALIB_CAMP )
93#if !defined(ALIB_TIME )
96#if !defined( ALIB_THREADS )
97# define ALIB_THREADS 0
105# undef ALIB_CONFIGURATION
106# define ALIB_CONFIGURATION 1
112#if ALIB_CONFIGURATION
126# define ALIB_STRINGS 1
128# define ALIB_BOXING 1
134# define ALIB_MONOMEM 1
138# define ALIB_MONOMEM 1
144# define ALIB_STRINGS 1
145# undef ALIB_SINGLETONS
146# define ALIB_SINGLETONS 1
150# define ALIB_STRINGS 1
153# undef ALIB_CHARACTERS
154# define ALIB_CHARACTERS 1
157# undef ALIB_SINGLETONS
158# define ALIB_SINGLETONS 1
159# undef ALIB_CHARACTERS
160# define ALIB_CHARACTERS 1
168#define ALIB_BITBUFFER 1
171#define ALIB_CHARACTERS 1
173#define ALIB_CONFIGURATION 1
175#define ALIB_EXPRESSIONS 1
177#define ALIB_MONOMEM 1
178#define ALIB_SINGLETONS 1
179#define ALIB_STRINGS 1
180#define ALIB_THREADS 1
188#define ALIB_DOCUMENTATION_URL "https://alib.dev/"
190#define ALIB_ASSERT_MODULE(modulename) \
191static_assert( ALIB_ ## modulename, \
192 "This module is not included in the ALib distribution/built. " \
193 "See " ALIB_DOCUMENTATION_URL "alib_manual.html for more information" ); \
199# define ALIB_IF_ALOX(...) __VA_ARGS__
200# define ALIB_IFN_ALOX(...)
202# define ALIB_IF_ALOX(...)
203# define ALIB_IFN_ALOX(...) __VA_ARGS__
207# define ALIB_IF_BITBUFFER(...) __VA_ARGS__
208# define ALIB_IFN_BITBUFFER(...)
210# define ALIB_IF_BITBUFFER(...)
211# define ALIB_IFN_BITBUFFER(...) __VA_ARGS__
215# define ALIB_IF_BOXING(...) __VA_ARGS__
216# define ALIB_IFN_BOXING(...)
218# define ALIB_IF_BOXING(...)
219# define ALIB_IFN_BOXING(...) __VA_ARGS__
223# define ALIB_IF_CHARACTERS(...) __VA_ARGS__
224# define ALIB_IFN_CHARACTERS(...)
226# define ALIB_IF_CHARACTERS(...)
227# define ALIB_IFN_CHARACTERS(...) __VA_ARGS__
231# define ALIB_IF_CLI(...) __VA_ARGS__
232# define ALIB_IFN_CLI(...)
234# define ALIB_IF_CLI(...)
235# define ALIB_IFN_CLI(...) __VA_ARGS__
238#if ALIB_CONFIGURATION
239# define ALIB_IF_CONFIGURATION(...) __VA_ARGS__
240# define ALIB_IFN_CONFIGURATION(...)
242# define ALIB_IF_CONFIGURATION(...)
243# define ALIB_IFN_CONFIGURATION(...) __VA_ARGS__
247# define ALIB_IF_ENUMS(...) __VA_ARGS__
248# define ALIB_IFN_ENUMS(...)
250# define ALIB_IF_ENUMS(...)
251# define ALIB_IFN_ENUMS(...) __VA_ARGS__
255# define ALIB_IF_EXPRESSIONS(...) __VA_ARGS__
256# define ALIB_IFN_EXPRESSIONS(...)
258# define ALIB_IF_EXPRESSIONS(...)
259# define ALIB_IFN_EXPRESSIONS(...) __VA_ARGS__
263# define ALIB_IF_FILES(...) __VA_ARGS__
264# define ALIB_IFN_FILES(...)
266# define ALIB_IF_FILES(...)
267# define ALIB_IFN_FILES(...) __VA_ARGS__
271# define ALIB_IF_MONOMEM(...) __VA_ARGS__
272# define ALIB_IFN_MONOMEM(...)
274# define ALIB_IF_MONOMEM(...)
275# define ALIB_IFN_MONOMEM(...) __VA_ARGS__
279# define ALIB_IF_SINGLETONS(...) __VA_ARGS__
280# define ALIB_IFN_SINGLETONS(...)
282# define ALIB_IF_SINGLETONS(...)
283# define ALIB_IFN_SINGLETONS(...) __VA_ARGS__
287# define ALIB_IF_STRINGS(...) __VA_ARGS__
288# define ALIB_IFN_STRINGS(...)
290# define ALIB_IF_STRINGS(...)
291# define ALIB_IFN_STRINGS(...) __VA_ARGS__
295# define ALIB_IF_CAMP(...) __VA_ARGS__
296# define ALIB_IFN_CAMP(...)
298# define ALIB_IF_CAMP(...)
299# define ALIB_IFN_CAMP(...) __VA_ARGS__
303# define ALIB_IF_THREADS(...) __VA_ARGS__
304# define ALIB_IFN_THREADS(...)
306# define ALIB_IF_THREADS(...)
307# define ALIB_IFN_THREADS(...) __VA_ARGS__
311# define ALIB_IF_TIME(...) __VA_ARGS__
312# define ALIB_IFN_TIME(...)
314# define ALIB_IF_TIME(...)
315# define ALIB_IFN_TIME(...) __VA_ARGS__
325#if !defined(ALIB_FEAT_SINGLETON_MAPPED)
327# define ALIB_FEAT_SINGLETON_MAPPED 1
329# define ALIB_FEAT_SINGLETON_MAPPED 0
334#if defined(__WCHAR_MAX__)
335 #if __WCHAR_MAX__ == 0x7FFFFFFF \
336 || __WCHAR_MAX__ == 0xFFFFFFFF
337 #define ALIB_SIZEOF_WCHAR_T 4
339 #define ALIB_SIZEOF_WCHAR_T 2
341#elif defined(_MSC_VER)
342 #define ALIB_SIZEOF_WCHAR_T 2
344# define ALIB_SIZEOF_WCHAR_T 4
349#if !defined(ALIB_CHARACTERS_WIDE)
350# if defined(_MSC_VER)
351# define ALIB_CHARACTERS_WIDE 1
353# define ALIB_CHARACTERS_WIDE 0
357#if !defined(ALIB_CHARACTERS_SIZEOF_WCHAR)
358# define ALIB_CHARACTERS_SIZEOF_WCHAR ALIB_SIZEOF_WCHAR_T
359#elif (ALIB_CHARACTERS_SIZEOF_WCHAR != 2) && (ALIB_CHARACTERS_SIZEOF_WCHAR != 4 )
360# error "Illegal value for symbol ALIB_CHARACTERS_SIZEOF_WCHAR given. Allowed is 2 or 4."
367#if !defined(ALIB_FEAT_BOXING_BIJECTIVE_INTEGRALS)
368# define ALIB_FEAT_BOXING_BIJECTIVE_INTEGRALS 0
371#if !defined(ALIB_FEAT_BOXING_BIJECTIVE_CHARACTERS)
372# define ALIB_FEAT_BOXING_BIJECTIVE_CHARACTERS 0
375#if !defined(ALIB_FEAT_BOXING_BIJECTIVE_FLOATS)
376# define ALIB_FEAT_BOXING_BIJECTIVE_FLOATS 0
379#if !defined(ALIB_DEBUG_BOXING)
380# define ALIB_DEBUG_BOXING 0
381#elif !ALIB_DEBUG && ALIB_DEBUG_BOXING
382# undef ALIB_DEBUG_BOXING
383# define ALIB_DEBUG_BOXING 0
384# pragma message "Symbol ALIB_DEBUG_BOXING set (from outside!) while ALIB_DEBUG is not. The symbol got disabled."
388#if !defined(ALIB_DEBUG_STRINGS)
389# define ALIB_DEBUG_STRINGS 0
390#elif !ALIB_DEBUG && ALIB_DEBUG_STRINGS
391# undef ALIB_DEBUG_STRINGS
392# define ALIB_DEBUG_STRINGS 0
393# pragma message "Symbol ALIB_DEBUG_STRINGS set (from outside!) while ALIB_DEBUG is not. The symbol got disabled."
397#if !defined(ALIB_DEBUG_MONOMEM)
398# define ALIB_DEBUG_MONOMEM 0
399#elif !ALIB_DEBUG && ALIB_DEBUG_MONOMEM
400# undef ALIB_DEBUG_MONOMEM
401# define ALIB_DEBUG_MONOMEM 0
402# pragma message "Symbol ALIB_DEBUG_MONOMEM set (from outside!) while ALIB_DEBUG is not. The symbol got disabled."
406#if !defined(ALIB_DEBUG_RESOURCES)
407# define ALIB_DEBUG_RESOURCES 0
408#elif !ALIB_DEBUG && ALIB_DEBUG_RESOURCES
409# undef ALIB_DEBUG_RESOURCES
410# define ALIB_DEBUG_RESOURCES 0
411# pragma message "Symbol ALIB_DEBUG_RESOURCES set (from outside!) while ALIB_DEBUG is not. The symbol got disabled."
415#if !defined(ALOX_DBG_LOG)
416# define ALOX_DBG_LOG ALIB_DEBUG
418#if !defined(ALOX_DBG_LOG_CI)
419# define ALOX_DBG_LOG_CI ALIB_DEBUG
422#if !defined(ALOX_REL_LOG)
423# define ALOX_REL_LOG 1
425#if !defined(ALOX_REL_LOG_CI)
426# define ALOX_REL_LOG_CI 0
432#if !defined(ALIB_DOX)
433 #define DOX_MARKER( marker )
438#if defined(__clang__)
439#elif defined(__INTEL_COMPILER)
440#elif defined(_MSC_VER)
441#elif defined(__GNUC__)
448#if !defined(ALIB_DEBUG)
449# if !defined(NDEBUG) || defined(_DEBUG) || defined(DEBUG)
457 #define ALIB_DBG(...) __VA_ARGS__
458 #define ALIB_REL(...)
459 #define ALIB_REL_DBG(releaseCode, ...) __VA_ARGS__
461 #define ALIB_DBG(...)
462 #define ALIB_REL(...) __VA_ARGS__
463 #define ALIB_REL_DBG(releaseCode, ...) releaseCode
470#if defined ( _MSC_VER )
472# error "ALib needs C++ standard 17. Microsoft compiler < v16.8 not supported. Compilation aborted"
474# if defined(_MSVC_LANG)
475# if _MSVC_LANG < 201703L
476# error "ALib needs C++ standard 17. Wrong compilation settings given."
477# elif _MSVC_LANG == 201703L
478# define ALIB_INTERNAL_DEDUCED_CPPVER 17
479# elif _MSVC_LANG == 202002L
480# define ALIB_INTERNAL_DEDUCED_CPPVER 20
481# elif _MSVC_LANG > 202002L
482# define ALIB_INTERNAL_DEDUCED_CPPVER 23
487#elif defined(__cplusplus)
488# if __cplusplus < 201703L
489# error "ALib needs C++ 17. Compilation aborted"
491# define ALIB_INTERNAL_DEDUCED_CPPVER 17
493# if __cplusplus == 202002L
494# undef ALIB_INTERNAL_DEDUCED_CPPVER
495# define ALIB_INTERNAL_DEDUCED_CPPVER 20
497# if __cplusplus > 202002L
498# undef ALIB_INTERNAL_DEDUCED_CPPVER
499# define ALIB_INTERNAL_DEDUCED_CPPVER 23
504#if !defined(ALIB_CPP_STANDARD)
505# if defined(ALIB_INTERNAL_DEDUCED_CPPVER)
506# define ALIB_CPP_STANDARD ALIB_INTERNAL_DEDUCED_CPPVER
508# error "Unknown compiler/toolchain. Can't deduce ALIB_CPP_STANDARD. Please provide this symbol 'manually' to the compiler."
511# if defined(ALIB_INTERNAL_DEDUCED_CPPVER)
512# if (ALIB_CPP_STANDARD != ALIB_INTERNAL_DEDUCED_CPPVER)
513# error "ALIB_CPP_STANDARD was explicitly passed to the compiler, but does not match the language standard deduced by ALib."
515# elif ALIB_CPP_STANDARD != 17 && ALIB_CPP_STANDARD != 20 && ALIB_CPP_STANDARD != 23
516# error "ALIB_CPP_STANDARD must be set to 17, 20 or 23."
521#if ALIB_CPP_STANDARD != 17 && ALIB_CPP_STANDARD != 20 && ALIB_CPP_STANDARD != 23
522# error "Error in header. This must never happen."
526#if ALIB_CPP_STANDARD >= 23
527# define ALIB_CPP_23(...) __VA_ARGS__
528# define ALIB_CPP_BEFORE_23(...)
530# define ALIB_CPP_23(...)
531# define ALIB_CPP_BEFORE_23(...) __VA_ARGS__
536#if defined( _MSC_VER ) && !defined( ALIB_API_NO_DLL )
537 #ifdef ALIB_API_IS_DLL
538 #define ALIB_API __declspec(dllexport)
540 #define ALIB_API __declspec(dllimport)
548#if defined( _MSC_VER )
549# define ALIB_FORCE_INLINE __forceinline
551# define ALIB_FORCE_INLINE __attribute__((always_inline)) inline
553#define ALIB_NO_RETURN [[ noreturn ]]
559 #define ALIB_WARNINGS_UNINITIALIZED_OFF \
560 _Pragma("GCC diagnostic push") \
561 _Pragma("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") \
563 #define ALIB_WARNINGS_ALLOW_NULL_POINTER_PASSING \
564 _Pragma("GCC diagnostic push") \
565 _Pragma("GCC diagnostic ignored \"-Wnonnull\"") \
567 #define ALIB_WARNINGS_ALLOW_UNSAFE_BUFFER_USAGE \
568 _Pragma("GCC diagnostic push") \
570 #define ALIB_WARNINGS_ALLOW_MACRO_REDEFINITION \
571 _Pragma("GCC diagnostic push") \
573 #define ALIB_WARNINGS_ALLOW_UNSAFE_FUNCTION_OR_VARIABLE \
574 _Pragma("GCC diagnostic push") \
576 #define ALIB_WARNINGS_MACRO_NOT_USED_OFF \
577 _Pragma("GCC diagnostic push") \
579 #define ALIB_WARNINGS_RESERVED_MACRO_NAME_OFF \
580 _Pragma("GCC diagnostic push") \
582 #define ALIB_WARNINGS_OVERLOAD_VIRTUAL_OFF \
583 _Pragma("GCC diagnostic push") \
585 #define ALIB_WARNINGS_ALLOW_SPARSE_ENUM_SWITCH \
586 _Pragma("GCC diagnostic push") \
587 _Pragma("GCC diagnostic ignored \"-Wswitch\"") \
589 #define ALIB_WARNINGS_ALLOW_BITWISE_SWITCH \
590 _Pragma("GCC diagnostic push") \
591 _Pragma("GCC diagnostic ignored \"-Wswitch\"") \
593 #define ALIB_WARNINGS_ALLOW_SHIFT_COUNT_OVERFLOW \
594 _Pragma("GCC diagnostic push") \
595 _Pragma("GCC diagnostic ignored \"-Wshift-count-overflow\"") \
597 #define ALIB_WARNINGS_IGNORE_UNUSED_PARAMETER \
598 _Pragma("GCC diagnostic push") \
599 _Pragma("GCC diagnostic ignored \"-Wunused-parameter\"") \
601 #define ALIB_WARNINGS_IGNORE_UNUSED_MACRO \
602 _Pragma("GCC diagnostic push") \
603 _Pragma("GCC diagnostic ignored \"-Wunused-macros\"") \
605 #define ALIB_WARNINGS_IGNORE_FUNCTION_TEMPLATE \
606 _Pragma("GCC diagnostic push") \
608 #define ALIB_WARNINGS_IGNORE_NOTHING_RETURNED \
609 _Pragma("GCC diagnostic push") \
610 _Pragma("GCC diagnostic ignored \"-Wreturn-type\"") \
612 #define ALIB_WARNINGS_IGNORE_INTEGRAL_CONSTANT_OVERFLOW \
613 _Pragma("GCC diagnostic push") \
615 #define ALIB_WARNINGS_IGNORE_RESERVED_IDENTIFIER \
616 _Pragma("GCC diagnostic push") \
618 #define ALIB_WARNINGS_IGNORE_DOCS \
619 _Pragma("GCC diagnostic push") \
621 #define ALIB_WARNINGS_IGNORE_INTEGER_OVERFLOW \
622 _Pragma("GCC diagnostic push") \
623 _Pragma("GCC diagnostic ignored \"-Wshift-count-overflow\"") \
625 #define ALIB_WARNINGS_RESTORE \
626 _Pragma("GCC diagnostic pop")
629 #define ALIB_FALLTHROUGH
631 #define ALIB_FALLTHROUGH [[gnu::fallthrough]];
634#elif defined(__clang__)
636 #define ALIB_WARNINGS_UNINITIALIZED_OFF \
637 _Pragma("clang diagnostic push") \
638 _Pragma("clang diagnostic ignored \"-Wuninitialized\"") \
639 _Pragma("clang diagnostic ignored \"-Wconditional-uninitialized\"") \
641 #define ALIB_WARNINGS_ALLOW_NULL_POINTER_PASSING \
642 _Pragma("clang diagnostic push") \
644 #define ALIB_WARNINGS_ALLOW_UNSAFE_BUFFER_USAGE \
645 _Pragma("clang diagnostic push") \
646 _Pragma("clang diagnostic ignored \"-Wunsafe-buffer-usage\"") \
648 #define ALIB_WARNINGS_OVERLOAD_VIRTUAL_OFF \
649 _Pragma("clang diagnostic push") \
650 _Pragma("clang diagnostic ignored \"-Woverloaded-virtual\"") \
652 #define ALIB_WARNINGS_ALLOW_MACRO_REDEFINITION \
653 _Pragma("clang diagnostic push") \
654 _Pragma("clang diagnostic ignored \"-Wmacro-redefined\"") \
656 #define ALIB_WARNINGS_ALLOW_UNSAFE_FUNCTION_OR_VARIABLE \
657 _Pragma("clang diagnostic push") \
658 _Pragma("clang diagnostic ignored \"-Wunused-macros\"") \
661 #define ALIB_WARNINGS_MACRO_NOT_USED_OFF \
662 _Pragma("clang diagnostic push") \
663 _Pragma("clang diagnostic ignored \"-Wunused-macros\"") \
665 #define ALIB_WARNINGS_RESERVED_MACRO_NAME_OFF \
666 _Pragma("clang diagnostic push") \
667 _Pragma("clang diagnostic ignored \"-Wreserved-macro-identifier\"") \
669 #define ALIB_WARNINGS_ALLOW_SPARSE_ENUM_SWITCH \
670 _Pragma("clang diagnostic push") \
671 _Pragma("clang diagnostic ignored \"-Wswitch\"") \
672 _Pragma("clang diagnostic ignored \"-Wswitch-enum\"") \
674 #define ALIB_WARNINGS_ALLOW_BITWISE_SWITCH \
675 _Pragma("clang diagnostic push") \
676 _Pragma("clang diagnostic ignored \"-Wswitch\"") \
677 _Pragma("clang diagnostic ignored \"-Wcovered-switch-default\"") \
679 #define ALIB_WARNINGS_ALLOW_SHIFT_COUNT_OVERFLOW \
680 _Pragma("clang diagnostic push") \
681 _Pragma("clang diagnostic ignored \"-Wshift-count-overflow\"") \
683 #define ALIB_WARNINGS_IGNORE_UNUSED_PARAMETER \
684 _Pragma("clang diagnostic push") \
685 _Pragma("clang diagnostic ignored \"-Wunused-parameter\"") \
687 #define ALIB_WARNINGS_IGNORE_UNUSED_MACRO \
688 _Pragma("clang diagnostic push") \
689 _Pragma("clang diagnostic ignored \"-Wunused-macros\"") \
691 #define ALIB_WARNINGS_IGNORE_FUNCTION_TEMPLATE \
692 _Pragma("clang diagnostic push") \
693 _Pragma("clang diagnostic ignored \"-Wunused-template\"") \
695 #define ALIB_WARNINGS_IGNORE_NOTHING_RETURNED \
696 _Pragma("clang diagnostic push") \
697 _Pragma("clang diagnostic ignored \"-Wreturn-type\"") \
699 #define ALIB_WARNINGS_IGNORE_INTEGRAL_CONSTANT_OVERFLOW \
700 _Pragma("clang diagnostic push") \
702 #define ALIB_WARNINGS_IGNORE_DOCS \
703 _Pragma("clang diagnostic push") \
704 _Pragma("clang diagnostic ignored \"-Wdocumentation\"") \
706 #define ALIB_WARNINGS_IGNORE_RESERVED_IDENTIFIER \
707 _Pragma("clang diagnostic push") \
708 _Pragma("clang diagnostic ignored \"-Wreserved-identifier\"") \
710 #define ALIB_WARNINGS_IGNORE_INTEGER_OVERFLOW \
711 _Pragma("clang diagnostic push") \
712 _Pragma("clang diagnostic ignored \"-Winteger-overflow\"") \
715 #define ALIB_WARNINGS_RESTORE \
716 _Pragma("clang diagnostic pop") \
718 #define ALIB_FALLTHROUGH [[clang::fallthrough]];
721#elif defined(_MSC_VER)
722 #define ALIB_WARNINGS_UNINITIALIZED_OFF \
723 __pragma(warning( push )) \
724 __pragma(warning( disable : 4701 )) \
726 #define ALIB_WARNINGS_ALLOW_NULL_POINTER_PASSING \
727 __pragma(warning( push )) \
729 #define ALIB_WARNINGS_ALLOW_UNSAFE_BUFFER_USAGE \
730 __pragma(warning( push )) \
732 #define ALIB_WARNINGS_MACRO_NOT_USED_OFF \
733 __pragma(warning( push )) \
735 #define ALIB_WARNINGS_RESERVED_MACRO_NAME_OFF \
736 __pragma(warning( push )) \
738 #define ALIB_WARNINGS_OVERLOAD_VIRTUAL_OFF \
739 __pragma(warning( push )) \
741 #define ALIB_WARNINGS_ALLOW_SPARSE_ENUM_SWITCH \
742 __pragma(warning( push )) \
744 #define ALIB_WARNINGS_ALLOW_SPARSE_ENUM_SWITCH \
745 __pragma(warning( push )) \
747 #define ALIB_WARNINGS_ALLOW_MACRO_REDEFINITION \
748 __pragma(warning( push )) \
749 __pragma(warning( disable : 4005 )) \
751 #define ALIB_WARNINGS_ALLOW_UNSAFE_FUNCTION_OR_VARIABLE \
752 __pragma(warning( push )) \
753 __pragma(warning( disable : 4996 )) \
755 #define ALIB_WARNINGS_ALLOW_BITWISE_SWITCH \
756 __pragma(warning( push )) \
758 #define ALIB_WARNINGS_ALLOW_SHIFT_COUNT_OVERFLOW \
759 __pragma(warning( push )) \
761 #define ALIB_WARNINGS_IGNORE_UNUSED_PARAMETER \
762 __pragma(warning( push )) \
764 #define ALIB_WARNINGS_IGNORE_UNUSED_MACRO \
765 __pragma(warning( push )) \
767 #define ALIB_WARNINGS_IGNORE_FUNCTION_TEMPLATE \
768 __pragma(warning( push )) \
770 #define ALIB_WARNINGS_IGNORE_NOTHING_RETURNED \
771 __pragma(warning( push )) \
772 __pragma(warning( disable : 4715 )) \
774 #define ALIB_WARNINGS_IGNORE_INTEGRAL_CONSTANT_OVERFLOW \
775 __pragma(warning( push )) \
776 __pragma(warning( disable : 4305 )) \
777 __pragma(warning( disable : 4307 )) \
778 __pragma(warning( disable : 4309 )) \
779 __pragma(warning( disable : 4310 )) \
780 __pragma(warning( disable : 4293 )) \
782 #define ALIB_WARNINGS_IGNORE_INTEGER_OVERFLOW \
783 __pragma(warning( push )) \
784 __pragma(warning( disable : 4293 )) \
786 #define ALIB_WARNINGS_IGNORE_DOCS \
787 __pragma(warning( push )) \
789 #define ALIB_WARNINGS_RESTORE \
790 __pragma(warning( pop )) \
792 #define ALIB_FALLTHROUGH
795 #define ALIB_WARNINGS_RESTORE
796 #define ALIB_FALLTHROUGH
803# define ALIB_NSTRINGIFY(a)
804# define ALIB_STRINGIFY(a)
806# define ALIB_STRINGIFY_X(a) A_CHAR( #a )
807# define ALIB_STRINGIFY(a) ALIB_STRINGIFY_X(a)
808# define ALIB_NSTRINGIFY_X(a) #a
809# define ALIB_NSTRINGIFY(a) ALIB_NSTRINGIFY_X(a)
812#define ALIB_CONCAT(a,b) a ## b
814#if defined(__clang__)
815# define ALIB_IDENTIFIER(prefix) ALIB_WARNINGS_IGNORE_RESERVED_IDENTIFIER \
816 ALIB_CONCAT(prefix, __LINE__) \
817 ALIB_WARNINGS_RESTORE
819# define ALIB_IDENTIFIER(prefix) ALIB_CONCAT(prefix, __LINE__)
827# define ALIB_COMMA_DBG ,
829# define ALIB_COMMA_DBG
834#if defined( __GNUC__ )
835# define ALIB_CALLER __FILE__, __LINE__, __func__
837#elif defined ( _MSC_VER )
838# define ALIB_CALLER __FILE__, __LINE__, __FUNCTION__
841# pragma message ("Unknown Platform in file: " __FILE__ )
845 #define ALIB_CALLER_PRUNED ALIB_CALLER
846 #define ALIB_CALLER_NULLED ALIB_CALLER
848 #define ALIB_CALLER_PRUNED
849 #define ALIB_CALLER_NULLED nullptr, 0, nullptr
854#define ALIB_STATIC_ASSERT( CondVariable, Cond, Message ) \
855{ constexpr bool CondVariable= Cond; \
856 static_assert( CondVariable, Message ); } \
858#define ALIB_STATIC_DENY( CondVariable, Cond, Message ) \
859{ constexpr bool CondVariable= !(Cond); \
860 static_assert( CondVariable, Message ); } \
865struct ALibTestGlobalNamespace;
866#define ALIB_ASSERT_GLOBAL_NAMESPACE \
867struct ALibTestGlobalNamespace; \
868static_assert(std::is_same<ALibTestGlobalNamespace, ::ALibTestGlobalNamespace>::value, \
869 "This is not the global namespace!");
895# if !defined (_ASSERT_H) && !defined(assert)
931 const char* msg1=
nullptr,
932 const char* msg2=
nullptr,
933 const char* msg3=
nullptr,
934 const char* msg4=
nullptr,
935 const char* msg5=
nullptr );
957 const int intValue );
974 int type ,
const char* topic,
975 int qtyMsgs,
const char** msgs );
980#define ALIB_ERROR(...) { alib::lang::DbgSimpleALibMsg( ALIB_CALLER_PRUNED, 0, __VA_ARGS__); }
981#define ALIB_WARNING(...) { alib::lang::DbgSimpleALibMsg( ALIB_CALLER_PRUNED, 1, __VA_ARGS__); }
982#define ALIB_MESSAGE(...) { alib::lang::DbgSimpleALibMsg( ALIB_CALLER_PRUNED, 2, __VA_ARGS__); }
983#define ALIB_ASSERT(cond) { if(!(cond)) ALIB_ERROR( "Assertion Failed" ); }
984#define ALIB_ASSERT_ERROR(cond, ...) { if(!(cond)) ALIB_ERROR( __VA_ARGS__ ); }
985#define ALIB_ASSERT_WARNING(cond, ...) { if(!(cond)) ALIB_WARNING( __VA_ARGS__ ); }
986#define ALIB_ASSERT_MESSAGE(cond, ...) { if(!(cond)) ALIB_MESSAGE( __VA_ARGS__ ); }
989 #define ALIB_ERROR(...) {}
990 #define ALIB_WARNING(...) {}
991 #define ALIB_MESSAGE(...) {}
992 #define ALIB_ASSERT(cond) {}
993 #define ALIB_ASSERT_ERROR(cond, ...) {}
994 #define ALIB_ASSERT_WARNING(cond, ...) {}
995 #define ALIB_ASSERT_MESSAGE(cond, ...) {}
999 #define ALIB_ASSERT_RESULT_EQUALS( func, value ) { auto result= func; assert(result == value); ((void) result); }
1000 #define ALIB_ASSERT_RESULT_NOT_EQUALS( func, value ) { auto result= func; assert(result != value); ((void) result); }
1001 #define ALIB_ASSERT_RESULT_GREATER_THAN(func, value ) { auto result= func; assert(result > value); ((void) result); }
1002 #define ALIB_ASSERT_RESULT_LESS_THAN( func, value ) { auto result= func; assert(result < value); ((void) result); }
1004 #define ALIB_ASSERT_RESULT_EQUALS( func, value ) { func; }
1005 #define ALIB_ASSERT_RESULT_NOT_EQUALS( func, value ) { func; }
1006 #define ALIB_ASSERT_RESULT_GREATER_THAN(func, value ) { func; }
1007 #define ALIB_ASSERT_RESULT_LESS_THAN( func, value ) { func; }
1014#if !defined(ALIB_AVOID_ANALYZER_WARNINGS )
1015# define ALIB_AVOID_ANALYZER_WARNINGS 1
1019#if !defined(ALIB_EXT_LIB_THREADS_AVAILABLE)
1020# define ALIB_EXT_LIB_THREADS_AVAILABLE 0
1022#if !defined(ALIB_FEAT_BOOST_REGEX)
1023# define ALIB_FEAT_BOOST_REGEX 0
1031#if ALIB_DEBUG && !ALIB_THREADS && ALIB_EXT_LIB_THREADS_AVAILABLE
1039# define ALIB_LOCK { alib::DbgCheckSingleThreaded(); }
1040# define ALIB_LOCK_WITH(VOID) { alib::DbgCheckSingleThreaded(); }
1042# define ALIB_LOCK { }
1043# define ALIB_LOCK_WITH(VOID) { }
1067#if !defined(ALIB_DOX)
1068# define ALIB_COMPILATION_FLAGS \
1069 (1<<0) * ALIB_DEBUG \
1070 + (1<<1) * ALIB_MONOMEM \
1071 + (1<<2) * ALIB_SINGLETONS \
1072 + (1<<3) * ALIB_CHARACTERS \
1073 + (1<<4) * ALIB_ENUMS \
1074 + (1<<5) * ALIB_TIME \
1075 + (1<<6) * ALIB_BOXING \
1076 + (1<<7) * ALIB_STRINGS \
1078 + (1<<0) * ALIB_BITBUFFER \
1079 + (1<<1) * ALIB_THREADS \
1080 + (1<<2) * ALIB_CAMP \
1081 + (1<<3) * ALIB_ALOX \
1082 + (1<<4) * ALIB_CLI \
1083 + (1<<5) * ALIB_CONFIGURATION \
1084 + (1<<6) * ALIB_EXPRESSIONS \
1085 + (1<<7) * ALIB_FILES \
1087 + (1<<0) * ALIB_FEAT_SINGLETON_MAPPED \
1088 + (1<<1) * ALIB_CHARACTERS_WIDE \
1089 + (1<<2) * (ALIB_CHARACTERS_SIZEOF_WCHAR == 4 ? 1 : 0) \
1090 + (1<<3) * ALIB_FEAT_BOXING_BIJECTIVE_INTEGRALS \
1091 + (1<<4) * ALIB_FEAT_BOXING_BIJECTIVE_CHARACTERS \
1092 + (1<<5) * ALIB_FEAT_BOXING_BIJECTIVE_FLOATS \
1093 + (1<<6) * ALIB_DEBUG_BOXING \
1094 + (1<<7) * ALIB_DEBUG_STRINGS \
1096 + (1<<0) * ALIB_DEBUG_MONOMEM \
1097 + (1<<1) * ALIB_DEBUG_RESOURCES \
1098 + (1<<2) * ALOX_DBG_LOG \
1099 + (1<<3) * ALOX_DBG_LOG_CI \
1100 + (1<<4) * ALOX_REL_LOG \
1101 + (1<<5) * ALOX_REL_LOG_CI
1132 TCompilationFlags compilationFlags = TCompilationFlags{ALIB_COMPILATION_FLAGS});
#define ALIB_SIZEOF_WCHAR_T
void(* DBG_SIMPLE_ALIB_MSG_PLUGIN)(const char *file, int line, const char *method, int type, const char *topic, int qtyMsgs, const char **msgs)
ALIB_API void DbgSimpleALibMsg(const char *file, int line, const char *method, int type, const char *topic, const char *msg1=nullptr, const char *msg2=nullptr, const char *msg3=nullptr, const char *msg4=nullptr, const char *msg5=nullptr)
ALIB_WARNINGS_ALLOW_UNSAFE_BUFFER_USAGE void AssertALibVersionAndFlags(int alibVersion, int alibRevision, TCompilationFlags compilationFlags)
void DbgCheckSingleThreaded()
bool NonCampModulesInitialized
ALIB_WARNINGS_ALLOW_UNSAFE_BUFFER_USAGE TCompilationFlags CompilationFlags
ALIB_WARNINGS_RESTORE void Bootstrap(int alibVersion, int alibRevision, TCompilationFlags compilationFlags)
CompilationFlagMeaningsEntry CompilationFlagMeanings[30]
const char * Name
The human readable meaning of the bit.
int Flag
The bit number in the bitset.
unsigned char bits[4]
The Flags.