summaryrefslogtreecommitdiff
path: root/thirdparty
diff options
context:
space:
mode:
Diffstat (limited to 'thirdparty')
-rw-r--r--thirdparty/README.md16
-rw-r--r--thirdparty/doctest/doctest.h1358
-rw-r--r--thirdparty/freetype/src/autofit/afblue.dat1121
-rw-r--r--thirdparty/freetype/src/base/ftver.rc61
-rw-r--r--thirdparty/freetype/src/bdf/README152
-rw-r--r--thirdparty/freetype/src/gxvalid/README532
-rw-r--r--thirdparty/freetype/src/gzip/README.freetype22
-rw-r--r--thirdparty/freetype/src/gzip/patches/freetype-zlib.diff372
-rw-r--r--thirdparty/freetype/src/pcf/README96
-rw-r--r--thirdparty/freetype/src/psnames/rules.mk73
-rw-r--r--thirdparty/freetype/src/raster/module.mk23
-rw-r--r--thirdparty/recastnavigation/Recast/Include/RecastAlloc.h49
-rw-r--r--thirdparty/recastnavigation/Recast/Source/RecastContour.cpp4
-rw-r--r--thirdparty/recastnavigation/Recast/Source/RecastMeshDetail.cpp16
-rw-r--r--thirdparty/recastnavigation/Recast/Source/RecastRegion.cpp10
-rw-r--r--thirdparty/xatlas/xatlas.cpp5
16 files changed, 857 insertions, 3053 deletions
diff --git a/thirdparty/README.md b/thirdparty/README.md
index 8a595bc875..ab59d4fc18 100644
--- a/thirdparty/README.md
+++ b/thirdparty/README.md
@@ -62,10 +62,13 @@ Files extracted from upstream source:
## doctest
- Upstream: https://github.com/onqtam/doctest
-- Version: 2.4.4 (97d5a9447e66cd5e107b7a6c463be4a468a40496, 2020)
+- Version: 2.4.8 (7b9885133108ae301ddd16e2651320f54cafeba7, 2022)
- License: MIT
-Extracted from .zip provided. Extracted license and header only.
+Files extracted from upstream source:
+
+- `doctest/doctest.h` as `doctest.h`
+- `LICENSE.txt`
## embree
@@ -159,8 +162,9 @@ Files extracted from upstream source:
Files extracted from upstream source:
-- the `src/` folder, minus the `.mk` files and the `dlg` and `tools` subfolders
-- the `include/` folder, minus the `dlg` subfolder
+- `src/` folder, minus the `dlg` and `tools` subfolders
+ * These files can be removed: `.dat`, `.diff`, `.mk`, `.rc`, `README*`
+- `include/` folder, minus the `dlg` subfolder
- `LICENSE.TXT` and `docs/FTL.TXT`
@@ -547,7 +551,7 @@ Files extracted from upstream source:
## recastnavigation
- Upstream: https://github.com/recastnavigation/recastnavigation
-- Version: git (57610fa6ef31b39020231906f8c5d40eaa8294ae, 2019)
+- Version: git (5a870d427e47abd4a8e4ce58a95582ec049434d5, 2022)
- License: zlib
Files extracted from upstream source:
@@ -714,7 +718,7 @@ File extracted from upstream release tarball:
## xatlas
- Upstream: https://github.com/jpcy/xatlas
-- Version: git (ec707faeac3b95e6b416076a9509718cce105b6a, 2021)
+- Version: git (16ace528acd2cf1f16a7c0dde99c42c486488dbe, 2022)
- License: MIT
Files extracted from upstream source:
diff --git a/thirdparty/doctest/doctest.h b/thirdparty/doctest/doctest.h
index 42eb039979..d25f526827 100644
--- a/thirdparty/doctest/doctest.h
+++ b/thirdparty/doctest/doctest.h
@@ -11,7 +11,7 @@
// https://opensource.org/licenses/MIT
//
// The documentation can be found at the library's page:
-// https://github.com/onqtam/doctest/blob/master/doc/markdown/readme.md
+// https://github.com/doctest/doctest/blob/master/doc/markdown/readme.md
//
// =================================================================================================
// =================================================================================================
@@ -48,8 +48,16 @@
#define DOCTEST_VERSION_MAJOR 2
#define DOCTEST_VERSION_MINOR 4
-#define DOCTEST_VERSION_PATCH 6
-#define DOCTEST_VERSION_STR "2.4.6"
+#define DOCTEST_VERSION_PATCH 8
+
+// util we need here
+#define DOCTEST_TOSTR_IMPL(x) #x
+#define DOCTEST_TOSTR(x) DOCTEST_TOSTR_IMPL(x)
+
+#define DOCTEST_VERSION_STR \
+ DOCTEST_TOSTR(DOCTEST_VERSION_MAJOR) "." \
+ DOCTEST_TOSTR(DOCTEST_VERSION_MINOR) "." \
+ DOCTEST_TOSTR(DOCTEST_VERSION_PATCH)
#define DOCTEST_VERSION \
(DOCTEST_VERSION_MAJOR * 10000 + DOCTEST_VERSION_MINOR * 100 + DOCTEST_VERSION_PATCH)
@@ -137,85 +145,93 @@
// == COMPILER WARNINGS ============================================================================
// =================================================================================================
+// both the header and the implementation suppress all of these,
+// so it only makes sense to aggregrate them like so
+#define DOCTEST_SUPPRESS_COMMON_WARNINGS_PUSH \
+ DOCTEST_CLANG_SUPPRESS_WARNING_PUSH \
+ DOCTEST_CLANG_SUPPRESS_WARNING("-Wunknown-pragmas") \
+ DOCTEST_CLANG_SUPPRESS_WARNING("-Wweak-vtables") \
+ DOCTEST_CLANG_SUPPRESS_WARNING("-Wpadded") \
+ DOCTEST_CLANG_SUPPRESS_WARNING("-Wmissing-prototypes") \
+ DOCTEST_CLANG_SUPPRESS_WARNING("-Wunused-local-typedef") \
+ DOCTEST_CLANG_SUPPRESS_WARNING("-Wc++98-compat") \
+ DOCTEST_CLANG_SUPPRESS_WARNING("-Wc++98-compat-pedantic") \
+ \
+ DOCTEST_GCC_SUPPRESS_WARNING_PUSH \
+ DOCTEST_GCC_SUPPRESS_WARNING("-Wunknown-pragmas") \
+ DOCTEST_GCC_SUPPRESS_WARNING("-Wpragmas") \
+ DOCTEST_GCC_SUPPRESS_WARNING("-Weffc++") \
+ DOCTEST_GCC_SUPPRESS_WARNING("-Wstrict-overflow") \
+ DOCTEST_GCC_SUPPRESS_WARNING("-Wstrict-aliasing") \
+ DOCTEST_GCC_SUPPRESS_WARNING("-Wmissing-declarations") \
+ DOCTEST_GCC_SUPPRESS_WARNING("-Wunused-local-typedefs") \
+ DOCTEST_GCC_SUPPRESS_WARNING("-Wuseless-cast") \
+ DOCTEST_GCC_SUPPRESS_WARNING("-Wnoexcept") \
+ \
+ DOCTEST_MSVC_SUPPRESS_WARNING_PUSH \
+ /* these 4 also disabled globally via cmake: */ \
+ DOCTEST_MSVC_SUPPRESS_WARNING(4514) /* unreferenced inline function has been removed */ \
+ DOCTEST_MSVC_SUPPRESS_WARNING(4571) /* SEH related */ \
+ DOCTEST_MSVC_SUPPRESS_WARNING(4710) /* function not inlined */ \
+ DOCTEST_MSVC_SUPPRESS_WARNING(4711) /* function selected for inline expansion*/ \
+ /* */ \
+ DOCTEST_MSVC_SUPPRESS_WARNING(4616) /* invalid compiler warning */ \
+ DOCTEST_MSVC_SUPPRESS_WARNING(4619) /* invalid compiler warning */ \
+ DOCTEST_MSVC_SUPPRESS_WARNING(4996) /* The compiler encountered a deprecated declaration */ \
+ DOCTEST_MSVC_SUPPRESS_WARNING(4706) /* assignment within conditional expression */ \
+ DOCTEST_MSVC_SUPPRESS_WARNING(4512) /* 'class' : assignment operator could not be generated */ \
+ DOCTEST_MSVC_SUPPRESS_WARNING(4127) /* conditional expression is constant */ \
+ DOCTEST_MSVC_SUPPRESS_WARNING(4820) /* padding */ \
+ DOCTEST_MSVC_SUPPRESS_WARNING(4625) /* copy constructor was implicitly deleted */ \
+ DOCTEST_MSVC_SUPPRESS_WARNING(4626) /* assignment operator was implicitly deleted */ \
+ DOCTEST_MSVC_SUPPRESS_WARNING(5027) /* move assignment operator implicitly deleted */ \
+ DOCTEST_MSVC_SUPPRESS_WARNING(5026) /* move constructor was implicitly deleted */ \
+ DOCTEST_MSVC_SUPPRESS_WARNING(4640) /* construction of local static object not thread-safe */ \
+ DOCTEST_MSVC_SUPPRESS_WARNING(5045) /* Spectre mitigation for memory load */ \
+ /* static analysis */ \
+ DOCTEST_MSVC_SUPPRESS_WARNING(26439) /* Function may not throw. Declare it 'noexcept' */ \
+ DOCTEST_MSVC_SUPPRESS_WARNING(26495) /* Always initialize a member variable */ \
+ DOCTEST_MSVC_SUPPRESS_WARNING(26451) /* Arithmetic overflow ... */ \
+ DOCTEST_MSVC_SUPPRESS_WARNING(26444) /* Avoid unnamed objects with custom ctor and dtor... */ \
+ DOCTEST_MSVC_SUPPRESS_WARNING(26812) /* Prefer 'enum class' over 'enum' */
+
+#define DOCTEST_SUPPRESS_COMMON_WARNINGS_POP \
+ DOCTEST_CLANG_SUPPRESS_WARNING_POP \
+ DOCTEST_GCC_SUPPRESS_WARNING_POP \
+ DOCTEST_MSVC_SUPPRESS_WARNING_POP
+
+DOCTEST_SUPPRESS_COMMON_WARNINGS_PUSH
+
DOCTEST_CLANG_SUPPRESS_WARNING_PUSH
-DOCTEST_CLANG_SUPPRESS_WARNING("-Wunknown-pragmas")
DOCTEST_CLANG_SUPPRESS_WARNING("-Wnon-virtual-dtor")
-DOCTEST_CLANG_SUPPRESS_WARNING("-Wweak-vtables")
-DOCTEST_CLANG_SUPPRESS_WARNING("-Wpadded")
DOCTEST_CLANG_SUPPRESS_WARNING("-Wdeprecated")
-DOCTEST_CLANG_SUPPRESS_WARNING("-Wmissing-prototypes")
-DOCTEST_CLANG_SUPPRESS_WARNING("-Wunused-local-typedef")
-DOCTEST_CLANG_SUPPRESS_WARNING("-Wc++98-compat")
-DOCTEST_CLANG_SUPPRESS_WARNING("-Wc++98-compat-pedantic")
DOCTEST_GCC_SUPPRESS_WARNING_PUSH
-DOCTEST_GCC_SUPPRESS_WARNING("-Wunknown-pragmas")
-DOCTEST_GCC_SUPPRESS_WARNING("-Wpragmas")
-DOCTEST_GCC_SUPPRESS_WARNING("-Weffc++")
-DOCTEST_GCC_SUPPRESS_WARNING("-Wstrict-overflow")
-DOCTEST_GCC_SUPPRESS_WARNING("-Wstrict-aliasing")
DOCTEST_GCC_SUPPRESS_WARNING("-Wctor-dtor-privacy")
-DOCTEST_GCC_SUPPRESS_WARNING("-Wmissing-declarations")
DOCTEST_GCC_SUPPRESS_WARNING("-Wnon-virtual-dtor")
-DOCTEST_GCC_SUPPRESS_WARNING("-Wunused-local-typedefs")
-DOCTEST_GCC_SUPPRESS_WARNING("-Wuseless-cast")
-DOCTEST_GCC_SUPPRESS_WARNING("-Wnoexcept")
DOCTEST_GCC_SUPPRESS_WARNING("-Wsign-promo")
DOCTEST_MSVC_SUPPRESS_WARNING_PUSH
-DOCTEST_MSVC_SUPPRESS_WARNING(4616) // invalid compiler warning
-DOCTEST_MSVC_SUPPRESS_WARNING(4619) // invalid compiler warning
-DOCTEST_MSVC_SUPPRESS_WARNING(4996) // The compiler encountered a deprecated declaration
-DOCTEST_MSVC_SUPPRESS_WARNING(4706) // assignment within conditional expression
-DOCTEST_MSVC_SUPPRESS_WARNING(4512) // 'class' : assignment operator could not be generated
-DOCTEST_MSVC_SUPPRESS_WARNING(4127) // conditional expression is constant
-DOCTEST_MSVC_SUPPRESS_WARNING(4820) // padding
-DOCTEST_MSVC_SUPPRESS_WARNING(4625) // copy constructor was implicitly defined as deleted
-DOCTEST_MSVC_SUPPRESS_WARNING(4626) // assignment operator was implicitly defined as deleted
-DOCTEST_MSVC_SUPPRESS_WARNING(5027) // move assignment operator was implicitly defined as deleted
-DOCTEST_MSVC_SUPPRESS_WARNING(5026) // move constructor was implicitly defined as deleted
DOCTEST_MSVC_SUPPRESS_WARNING(4623) // default constructor was implicitly defined as deleted
-DOCTEST_MSVC_SUPPRESS_WARNING(4640) // construction of local static object is not thread-safe
-// static analysis
-DOCTEST_MSVC_SUPPRESS_WARNING(26439) // This kind of function may not throw. Declare it 'noexcept'
-DOCTEST_MSVC_SUPPRESS_WARNING(26495) // Always initialize a member variable
-DOCTEST_MSVC_SUPPRESS_WARNING(26451) // Arithmetic overflow ...
-DOCTEST_MSVC_SUPPRESS_WARNING(26444) // Avoid unnamed objects with custom construction and dtr...
-DOCTEST_MSVC_SUPPRESS_WARNING(26812) // Prefer 'enum class' over 'enum'
-
-// 4548 - expression before comma has no effect; expected expression with side - effect
-// 4265 - class has virtual functions, but destructor is not virtual
-// 4986 - exception specification does not match previous declaration
-// 4350 - behavior change: 'member1' called instead of 'member2'
-// 4668 - 'x' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
-// 4365 - conversion from 'int' to 'unsigned long', signed/unsigned mismatch
-// 4774 - format string expected in argument 'x' is not a string literal
-// 4820 - padding in structs
-
-// only 4 should be disabled globally:
-// - 4514 # unreferenced inline function has been removed
-// - 4571 # SEH related
-// - 4710 # function not inlined
-// - 4711 # function 'x' selected for automatic inline expansion
#define DOCTEST_MAKE_STD_HEADERS_CLEAN_FROM_WARNINGS_ON_WALL_BEGIN \
DOCTEST_MSVC_SUPPRESS_WARNING_PUSH \
- DOCTEST_MSVC_SUPPRESS_WARNING(4548) \
- DOCTEST_MSVC_SUPPRESS_WARNING(4265) \
- DOCTEST_MSVC_SUPPRESS_WARNING(4986) \
- DOCTEST_MSVC_SUPPRESS_WARNING(4350) \
- DOCTEST_MSVC_SUPPRESS_WARNING(4668) \
- DOCTEST_MSVC_SUPPRESS_WARNING(4365) \
- DOCTEST_MSVC_SUPPRESS_WARNING(4774) \
- DOCTEST_MSVC_SUPPRESS_WARNING(4820) \
- DOCTEST_MSVC_SUPPRESS_WARNING(4625) \
- DOCTEST_MSVC_SUPPRESS_WARNING(4626) \
- DOCTEST_MSVC_SUPPRESS_WARNING(5027) \
- DOCTEST_MSVC_SUPPRESS_WARNING(5026) \
- DOCTEST_MSVC_SUPPRESS_WARNING(4623) \
- DOCTEST_MSVC_SUPPRESS_WARNING(5039) \
- DOCTEST_MSVC_SUPPRESS_WARNING(5045) \
- DOCTEST_MSVC_SUPPRESS_WARNING(5105)
+ DOCTEST_MSVC_SUPPRESS_WARNING(4548) /* before comma no effect; expected side - effect */ \
+ DOCTEST_MSVC_SUPPRESS_WARNING(4265) /* virtual functions, but destructor is not virtual */ \
+ DOCTEST_MSVC_SUPPRESS_WARNING(4986) /* exception specification does not match previous */ \
+ DOCTEST_MSVC_SUPPRESS_WARNING(4350) /* 'member1' called instead of 'member2' */ \
+ DOCTEST_MSVC_SUPPRESS_WARNING(4668) /* not defined as a preprocessor macro */ \
+ DOCTEST_MSVC_SUPPRESS_WARNING(4365) /* signed/unsigned mismatch */ \
+ DOCTEST_MSVC_SUPPRESS_WARNING(4774) /* format string not a string literal */ \
+ DOCTEST_MSVC_SUPPRESS_WARNING(4820) /* padding */ \
+ DOCTEST_MSVC_SUPPRESS_WARNING(4625) /* copy constructor was implicitly deleted */ \
+ DOCTEST_MSVC_SUPPRESS_WARNING(4626) /* assignment operator was implicitly deleted */ \
+ DOCTEST_MSVC_SUPPRESS_WARNING(5027) /* move assignment operator implicitly deleted */ \
+ DOCTEST_MSVC_SUPPRESS_WARNING(5026) /* move constructor was implicitly deleted */ \
+ DOCTEST_MSVC_SUPPRESS_WARNING(4623) /* default constructor was implicitly deleted */ \
+ DOCTEST_MSVC_SUPPRESS_WARNING(5039) /* pointer to pot. throwing function passed to extern C */ \
+ DOCTEST_MSVC_SUPPRESS_WARNING(5045) /* Spectre mitigation for memory load */ \
+ DOCTEST_MSVC_SUPPRESS_WARNING(5105) /* macro producing 'defined' has undefined behavior */
#define DOCTEST_MAKE_STD_HEADERS_CLEAN_FROM_WARNINGS_ON_WALL_END DOCTEST_MSVC_SUPPRESS_WARNING_POP
@@ -228,6 +244,7 @@ DOCTEST_MSVC_SUPPRESS_WARNING(26812) // Prefer 'enum class' over 'enum'
// GCC C++11 feature support table: https://gcc.gnu.org/projects/cxx-status.html
// MSVC version table:
// https://en.wikipedia.org/wiki/Microsoft_Visual_C%2B%2B#Internal_version_numbering
+// MSVC++ 14.3 (17) _MSC_VER == 1930 (Visual Studio 2022)
// MSVC++ 14.2 (16) _MSC_VER == 1920 (Visual Studio 2019)
// MSVC++ 14.1 (15) _MSC_VER == 1910 (Visual Studio 2017)
// MSVC++ 14.0 _MSC_VER == 1900 (Visual Studio 2015)
@@ -237,6 +254,10 @@ DOCTEST_MSVC_SUPPRESS_WARNING(26812) // Prefer 'enum class' over 'enum'
// MSVC++ 9.0 _MSC_VER == 1500 (Visual Studio 2008)
// MSVC++ 8.0 _MSC_VER == 1400 (Visual Studio 2005)
+// Universal Windows Platform support
+#if defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_APP)
+#define DOCTEST_CONFIG_NO_WINDOWS_SEH
+#endif // WINAPI_FAMILY
#if DOCTEST_MSVC && !defined(DOCTEST_CONFIG_WINDOWS_SEH)
#define DOCTEST_CONFIG_WINDOWS_SEH
#endif // MSVC
@@ -312,13 +333,29 @@ DOCTEST_MSVC_SUPPRESS_WARNING(26812) // Prefer 'enum class' over 'enum'
#endif
#ifndef DOCTEST_NORETURN
+#if DOCTEST_MSVC && (DOCTEST_MSVC < DOCTEST_COMPILER(19, 0, 0))
+#define DOCTEST_NORETURN
+#else // DOCTEST_MSVC
#define DOCTEST_NORETURN [[noreturn]]
+#endif // DOCTEST_MSVC
#endif // DOCTEST_NORETURN
#ifndef DOCTEST_NOEXCEPT
+#if DOCTEST_MSVC && (DOCTEST_MSVC < DOCTEST_COMPILER(19, 0, 0))
+#define DOCTEST_NOEXCEPT
+#else // DOCTEST_MSVC
#define DOCTEST_NOEXCEPT noexcept
+#endif // DOCTEST_MSVC
#endif // DOCTEST_NOEXCEPT
+#ifndef DOCTEST_CONSTEXPR
+#if DOCTEST_MSVC && (DOCTEST_MSVC < DOCTEST_COMPILER(19, 0, 0))
+#define DOCTEST_CONSTEXPR const
+#else // DOCTEST_MSVC
+#define DOCTEST_CONSTEXPR constexpr
+#endif // DOCTEST_MSVC
+#endif // DOCTEST_CONSTEXPR
+
// =================================================================================================
// == FEATURE DETECTION END ========================================================================
// =================================================================================================
@@ -332,8 +369,6 @@ DOCTEST_MSVC_SUPPRESS_WARNING(26812) // Prefer 'enum class' over 'enum'
#define DOCTEST_ANONYMOUS(x) DOCTEST_CAT(x, __LINE__)
#endif // __COUNTER__
-#define DOCTEST_TOSTR(x) #x
-
#ifndef DOCTEST_CONFIG_ASSERTION_PARAMETERS_BY_VALUE
#define DOCTEST_REF_WRAP(x) x&
#else // DOCTEST_CONFIG_ASSERTION_PARAMETERS_BY_VALUE
@@ -351,11 +386,14 @@ DOCTEST_MSVC_SUPPRESS_WARNING(26812) // Prefer 'enum class' over 'enum'
#define DOCTEST_PLATFORM_LINUX
#endif // DOCTEST_PLATFORM
-#define DOCTEST_GLOBAL_NO_WARNINGS(var) \
+namespace doctest { namespace detail {
+ static DOCTEST_CONSTEXPR int consume(const int*, int) { return 0; }
+}}
+
+#define DOCTEST_GLOBAL_NO_WARNINGS(var, ...) \
DOCTEST_CLANG_SUPPRESS_WARNING_WITH_PUSH("-Wglobal-constructors") \
- DOCTEST_CLANG_SUPPRESS_WARNING("-Wunused-variable") \
- static const int var DOCTEST_UNUSED // NOLINT(fuchsia-statically-constructed-objects,cert-err58-cpp)
-#define DOCTEST_GLOBAL_NO_WARNINGS_END() DOCTEST_CLANG_SUPPRESS_WARNING_POP
+ static const int var = doctest::detail::consume(&var, __VA_ARGS__); \
+ DOCTEST_CLANG_SUPPRESS_WARNING_POP
#ifndef DOCTEST_BREAK_INTO_DEBUGGER
// should probably take a look at https://github.com/scottt/debugbreak
@@ -390,32 +428,31 @@ DOCTEST_GCC_SUPPRESS_WARNING_POP
#define DOCTEST_CONFIG_USE_STD_HEADERS
#endif // DOCTEST_CONFIG_USE_IOSFWD
+// for clang - always include ciso646 (which drags some std stuff) because
+// we want to check if we are using libc++ with the _LIBCPP_VERSION macro in
+// which case we don't want to forward declare stuff from std - for reference:
+// https://github.com/doctest/doctest/issues/126
+// https://github.com/doctest/doctest/issues/356
+#if DOCTEST_CLANG
+#include <ciso646>
+#ifdef _LIBCPP_VERSION
+#define DOCTEST_CONFIG_USE_STD_HEADERS
+#endif // _LIBCPP_VERSION
+#endif // clang
+
#ifdef DOCTEST_CONFIG_USE_STD_HEADERS
#ifndef DOCTEST_CONFIG_INCLUDE_TYPE_TRAITS
#define DOCTEST_CONFIG_INCLUDE_TYPE_TRAITS
#endif // DOCTEST_CONFIG_INCLUDE_TYPE_TRAITS
-#include <iosfwd>
#include <cstddef>
#include <ostream>
+#include <istream>
#else // DOCTEST_CONFIG_USE_STD_HEADERS
-#if DOCTEST_CLANG
-// to detect if libc++ is being used with clang (the _LIBCPP_VERSION identifier)
-#include <ciso646>
-#endif // clang
-
-#ifdef _LIBCPP_VERSION
-#define DOCTEST_STD_NAMESPACE_BEGIN _LIBCPP_BEGIN_NAMESPACE_STD
-#define DOCTEST_STD_NAMESPACE_END _LIBCPP_END_NAMESPACE_STD
-#else // _LIBCPP_VERSION
-#define DOCTEST_STD_NAMESPACE_BEGIN namespace std {
-#define DOCTEST_STD_NAMESPACE_END }
-#endif // _LIBCPP_VERSION
-
// Forward declaring 'X' in namespace std is not permitted by the C++ Standard.
DOCTEST_MSVC_SUPPRESS_WARNING_WITH_PUSH(4643)
-DOCTEST_STD_NAMESPACE_BEGIN // NOLINT (cert-dcl58-cpp)
+namespace std { // NOLINT (cert-dcl58-cpp)
typedef decltype(nullptr) nullptr_t;
template <class charT>
struct char_traits;
@@ -424,17 +461,20 @@ struct char_traits<char>;
template <class charT, class traits>
class basic_ostream;
typedef basic_ostream<char, char_traits<char>> ostream;
+template <class charT, class traits>
+class basic_istream;
+typedef basic_istream<char, char_traits<char>> istream;
template <class... Types>
class tuple;
#if DOCTEST_MSVC >= DOCTEST_COMPILER(19, 20, 0)
-// see this issue on why this is needed: https://github.com/onqtam/doctest/issues/183
-template <class _Ty>
+// see this issue on why this is needed: https://github.com/doctest/doctest/issues/183
+template <class Ty>
class allocator;
-template <class _Elem, class _Traits, class _Alloc>
+template <class Elem, class Traits, class Alloc>
class basic_string;
using string = basic_string<char, char_traits<char>, allocator<char>>;
#endif // VS 2019
-DOCTEST_STD_NAMESPACE_END
+} // namespace std
DOCTEST_MSVC_SUPPRESS_WARNING_POP
@@ -486,6 +526,8 @@ class DOCTEST_INTERFACE String
view data;
};
+ char* allocate(unsigned sz);
+
bool isOnStack() const { return (buf[last] & 128) == 0; }
void setOnHeap();
void setLast(unsigned in = last);
@@ -500,11 +542,12 @@ public:
String(const char* in);
String(const char* in, unsigned in_size);
+ String(std::istream& in, unsigned in_size);
+
String(const String& other);
String& operator=(const String& other);
String& operator+=(const String& other);
- String operator+(const String& other) const;
String(String&& other);
String& operator=(String&& other);
@@ -527,6 +570,8 @@ public:
int compare(const String& other, bool no_case = false) const;
};
+DOCTEST_INTERFACE String operator+(const String& lhs, const String& rhs);
+
DOCTEST_INTERFACE bool operator==(const String& lhs, const String& rhs);
DOCTEST_INTERFACE bool operator!=(const String& lhs, const String& rhs);
DOCTEST_INTERFACE bool operator<(const String& lhs, const String& rhs);
@@ -723,9 +768,8 @@ namespace detail {
struct ContextOptions //!OCLINT too many fields
{
- std::ostream* cout; // stdout stream - std::cout by default
- std::ostream* cerr; // stderr stream - std::cerr by default
- String binary_name; // the test binary name
+ std::ostream* cout = nullptr; // stdout stream
+ String binary_name; // the test binary name
const detail::TestCase* currentTest = nullptr;
@@ -744,9 +788,12 @@ struct ContextOptions //!OCLINT too many fields
bool case_sensitive; // if filtering should be case sensitive
bool exit; // if the program should be exited after the tests are ran/whatever
bool duration; // print the time duration of each test case
+ bool minimal; // minimal console output (only test failures)
+ bool quiet; // no console output
bool no_throw; // to skip exceptions-related assertion macros
bool no_exitcode; // if the framework should return 0 as the exitcode
bool no_run; // to not run the tests at all (can be done with an "*" exclude)
+ bool no_intro; // to not print the intro of the framework
bool no_version; // to not print the version of the framework
bool no_colors; // if output to the console should be colorized
bool force_colors; // forces the use of colors even when a tty cannot be detected
@@ -790,6 +837,9 @@ namespace detail {
template<class T> struct is_lvalue_reference { const static bool value=false; };
template<class T> struct is_lvalue_reference<T&> { const static bool value=true; };
+ template<class T> struct is_rvalue_reference { const static bool value=false; };
+ template<class T> struct is_rvalue_reference<T&&> { const static bool value=true; };
+
template <class T>
inline T&& forward(typename remove_reference<T>::type& t) DOCTEST_NOEXCEPT
{
@@ -811,7 +861,7 @@ namespace detail {
template<class T> struct underlying_type : public std::underlying_type<T> {};
#else
// Use compiler intrinsics
- template<class T> struct is_enum { constexpr static bool value = __is_enum(T); };
+ template<class T> struct is_enum { DOCTEST_CONSTEXPR static bool value = __is_enum(T); };
template<class T> struct underlying_type { typedef __underlying_type(T) type; };
#endif
// clang-format on
@@ -828,22 +878,21 @@ namespace detail {
template<class, class = void>
struct check {
- static constexpr bool value = false;
+ static DOCTEST_CONSTEXPR bool value = false;
};
template<class T>
struct check<T, decltype(os() << val<T>(), void())> {
- static constexpr bool value = true;
+ static DOCTEST_CONSTEXPR bool value = true;
};
} // namespace has_insertion_operator_impl
template<class T>
using has_insertion_operator = has_insertion_operator_impl::check<const T>;
- DOCTEST_INTERFACE void my_memcpy(void* dest, const void* src, unsigned num);
+ DOCTEST_INTERFACE std::ostream* tlssPush();
+ DOCTEST_INTERFACE String tlssPop();
- DOCTEST_INTERFACE std::ostream* getTlsOss(); // returns a thread-local ostringstream
- DOCTEST_INTERFACE String getTlsOssResult();
template <bool C>
struct StringMakerBase
@@ -854,13 +903,61 @@ namespace detail {
}
};
+ // Vector<int> and various type other than pointer or array.
+ template<typename T>
+ struct filldata
+ {
+ static void fill(std::ostream* stream, const T &in) {
+ *stream << in;
+ }
+ };
+
+ template<typename T,unsigned long N>
+ struct filldata<T[N]>
+ {
+ static void fill(std::ostream* stream, const T (&in)[N]) {
+ for (unsigned long i = 0; i < N; i++) {
+ *stream << in[i];
+ }
+ }
+ };
+
+ // Specialized since we don't want the terminating null byte!
+ template<unsigned long N>
+ struct filldata<const char[N]>
+ {
+ static void fill(std::ostream* stream, const char(&in)[N]) {
+ *stream << in;
+ }
+ };
+
+ template<typename T>
+ void filloss(std::ostream* stream, const T& in) {
+ filldata<T>::fill(stream, in);
+ }
+
+ template<typename T,unsigned long N>
+ void filloss(std::ostream* stream, const T (&in)[N]) {
+ // T[N], T(&)[N], T(&&)[N] have same behaviour.
+ // Hence remove reference.
+ filldata<typename remove_reference<decltype(in)>::type>::fill(stream, in);
+ }
+
template <>
struct StringMakerBase<true>
{
template <typename T>
static String convert(const DOCTEST_REF_WRAP(T) in) {
- *getTlsOss() << in;
- return getTlsOssResult();
+ /* When parameter "in" is a null terminated const char* it works.
+ * When parameter "in" is a T arr[N] without '\0' we can fill the
+ * stringstream with N objects (T=char).If in is char pointer *
+ * without '\0' , it would cause segfault
+ * stepping over unaccessible memory.
+ */
+
+ std::ostream* stream = tlssPush();
+ filloss(stream, in);
+ return tlssPop();
}
};
@@ -936,7 +1033,7 @@ String toString(const DOCTEST_REF_WRAP(T) value) {
}
#if DOCTEST_MSVC >= DOCTEST_COMPILER(19, 20, 0)
-// see this issue on why this is needed: https://github.com/onqtam/doctest/issues/183
+// see this issue on why this is needed: https://github.com/doctest/doctest/issues/183
DOCTEST_INTERFACE String toString(const std::string& in);
#endif // VS 2019
@@ -1079,12 +1176,21 @@ DOCTEST_CLANG_SUPPRESS_WARNING_WITH_PUSH("-Wunused-comparison")
// If not it doesn't find the operator or if the operator at global scope is defined after
// this template, the template won't be instantiated due to SFINAE. Once the template is not
// instantiated it can look for global operator using normal conversions.
-#define SFINAE_OP(ret,op) decltype(doctest::detail::declval<L>() op doctest::detail::declval<R>(),static_cast<ret>(0))
+#define SFINAE_OP(ret,op) decltype((void)(doctest::detail::declval<L>() op doctest::detail::declval<R>()),ret{})
#define DOCTEST_DO_BINARY_EXPRESSION_COMPARISON(op, op_str, op_macro) \
template <typename R> \
- DOCTEST_NOINLINE SFINAE_OP(Result,op) operator op(R&& rhs) { \
- bool res = op_macro(doctest::detail::forward<L>(lhs), doctest::detail::forward<R>(rhs)); \
+ DOCTEST_NOINLINE SFINAE_OP(Result,op) operator op(const R&& rhs) { \
+ bool res = op_macro(doctest::detail::forward<const L>(lhs), doctest::detail::forward<const R>(rhs)); \
+ if(m_at & assertType::is_false) \
+ res = !res; \
+ if(!res || doctest::getContextOptions()->success) \
+ return Result(res, stringifyBinaryExpr(lhs, op_str, rhs)); \
+ return Result(res); \
+ } \
+ template <typename R ,typename enable_if<!doctest::detail::is_rvalue_reference<R>::value, void >::type* = nullptr> \
+ DOCTEST_NOINLINE SFINAE_OP(Result,op) operator op(const R& rhs) { \
+ bool res = op_macro(doctest::detail::forward<const L>(lhs), rhs); \
if(m_at & assertType::is_false) \
res = !res; \
if(!res || doctest::getContextOptions()->success) \
@@ -1108,6 +1214,7 @@ DOCTEST_CLANG_SUPPRESS_WARNING_WITH_PUSH("-Wunused-comparison")
bool m_passed;
String m_decomp;
+ Result() = default;
Result(bool passed, const String& decomposition = String());
// forbidding some expressions based on this table: https://en.cppreference.com/w/cpp/language/operator_precedence
@@ -1217,8 +1324,7 @@ DOCTEST_CLANG_SUPPRESS_WARNING_WITH_PUSH("-Wunused-comparison")
, m_at(at) {}
DOCTEST_NOINLINE operator Result() {
-// this is needed only foc MSVC 2015:
-// https://ci.appveyor.com/project/onqtam/doctest/builds/38181202
+// this is needed only for MSVC 2015
DOCTEST_MSVC_SUPPRESS_WARNING_WITH_PUSH(4800) // 'int': forcing value to bool
bool res = static_cast<bool>(lhs);
DOCTEST_MSVC_SUPPRESS_WARNING_POP
@@ -1230,9 +1336,8 @@ DOCTEST_MSVC_SUPPRESS_WARNING_POP
return Result(res);
}
- /* This is required for user-defined conversions from Expression_lhs to L */
- //operator L() const { return lhs; }
- operator L() const { return lhs; }
+ /* This is required for user-defined conversions from Expression_lhs to L */
+ operator L() const { return lhs; }
// clang-format off
DOCTEST_DO_BINARY_EXPRESSION_COMPARISON(==, " == ", DOCTEST_CMP_EQ) //!OCLINT bitwise operator in conditional
@@ -1289,22 +1394,27 @@ DOCTEST_CLANG_SUPPRESS_WARNING_POP
// https://github.com/catchorg/Catch2/issues/870
// https://github.com/catchorg/Catch2/issues/565
template <typename L>
- Expression_lhs<L> operator<<(L &&operand) {
- return Expression_lhs<L>(doctest::detail::forward<L>(operand), m_at);
+ Expression_lhs<const L> operator<<(const L &&operand) {
+ return Expression_lhs<const L>(doctest::detail::forward<const L>(operand), m_at);
+ }
+
+ template <typename L,typename enable_if<!doctest::detail::is_rvalue_reference<L>::value,void >::type* = nullptr>
+ Expression_lhs<const L&> operator<<(const L &operand) {
+ return Expression_lhs<const L&>(operand, m_at);
}
};
struct DOCTEST_INTERFACE TestSuite
{
- const char* m_test_suite;
- const char* m_description;
- bool m_skip;
- bool m_no_breaks;
- bool m_no_output;
- bool m_may_fail;
- bool m_should_fail;
- int m_expected_failures;
- double m_timeout;
+ const char* m_test_suite = nullptr;
+ const char* m_description = nullptr;
+ bool m_skip = false;
+ bool m_no_breaks = false;
+ bool m_no_output = false;
+ bool m_may_fail = false;
+ bool m_should_fail = false;
+ int m_expected_failures = 0;
+ double m_timeout = 0;
TestSuite& operator*(const char* in);
@@ -1387,15 +1497,16 @@ DOCTEST_CLANG_SUPPRESS_WARNING_POP
void setResult(const Result& res);
template <int comparison, typename L, typename R>
- DOCTEST_NOINLINE void binary_assert(const DOCTEST_REF_WRAP(L) lhs,
+ DOCTEST_NOINLINE bool binary_assert(const DOCTEST_REF_WRAP(L) lhs,
const DOCTEST_REF_WRAP(R) rhs) {
m_failed = !RelationalComparator<comparison, L, R>()(lhs, rhs);
if(m_failed || getContextOptions()->success)
m_decomp = stringifyBinaryExpr(lhs, ", ", rhs);
+ return !m_failed;
}
template <typename L>
- DOCTEST_NOINLINE void unary_assert(const DOCTEST_REF_WRAP(L) val) {
+ DOCTEST_NOINLINE bool unary_assert(const DOCTEST_REF_WRAP(L) val) {
m_failed = !val;
if(m_at & assertType::is_false) //!OCLINT bitwise operator in conditional
@@ -1403,6 +1514,8 @@ DOCTEST_CLANG_SUPPRESS_WARNING_POP
if(m_failed || getContextOptions()->success)
m_decomp = toString(val);
+
+ return !m_failed;
}
void translateException();
@@ -1422,7 +1535,7 @@ DOCTEST_CLANG_SUPPRESS_WARNING_POP
DOCTEST_INTERFACE void failed_out_of_a_testing_context(const AssertData& ad);
- DOCTEST_INTERFACE void decomp_assert(assertType::Enum at, const char* file, int line,
+ DOCTEST_INTERFACE bool decomp_assert(assertType::Enum at, const char* file, int line,
const char* expr, Result result);
#define DOCTEST_ASSERT_OUT_OF_TESTS(decomp) \
@@ -1438,7 +1551,7 @@ DOCTEST_CLANG_SUPPRESS_WARNING_POP
if(checkIfShouldThrow(at)) \
throwException(); \
} \
- return; \
+ return !failed; \
} \
} while(false)
@@ -1453,7 +1566,7 @@ DOCTEST_CLANG_SUPPRESS_WARNING_POP
throwException()
template <int comparison, typename L, typename R>
- DOCTEST_NOINLINE void binary_assert(assertType::Enum at, const char* file, int line,
+ DOCTEST_NOINLINE bool binary_assert(assertType::Enum at, const char* file, int line,
const char* expr, const DOCTEST_REF_WRAP(L) lhs,
const DOCTEST_REF_WRAP(R) rhs) {
bool failed = !RelationalComparator<comparison, L, R>()(lhs, rhs);
@@ -1464,10 +1577,11 @@ DOCTEST_CLANG_SUPPRESS_WARNING_POP
// ###################################################################################
DOCTEST_ASSERT_OUT_OF_TESTS(stringifyBinaryExpr(lhs, ", ", rhs));
DOCTEST_ASSERT_IN_TESTS(stringifyBinaryExpr(lhs, ", ", rhs));
+ return !failed;
}
template <typename L>
- DOCTEST_NOINLINE void unary_assert(assertType::Enum at, const char* file, int line,
+ DOCTEST_NOINLINE bool unary_assert(assertType::Enum at, const char* file, int line,
const char* expr, const DOCTEST_REF_WRAP(L) val) {
bool failed = !val;
@@ -1480,6 +1594,7 @@ DOCTEST_CLANG_SUPPRESS_WARNING_POP
// ###################################################################################
DOCTEST_ASSERT_OUT_OF_TESTS(toString(val));
DOCTEST_ASSERT_IN_TESTS(toString(val));
+ return !failed;
}
struct DOCTEST_INTERFACE IExceptionTranslator
@@ -1573,8 +1688,10 @@ DOCTEST_CLANG_SUPPRESS_WARNING_POP
class DOCTEST_INTERFACE ContextScopeBase : public IContextScope {
protected:
ContextScopeBase();
+ ContextScopeBase(ContextScopeBase&& other);
void destroy();
+ bool need_to_destroy{true};
};
template <typename L> class ContextScope : public ContextScopeBase
@@ -1584,16 +1701,21 @@ DOCTEST_CLANG_SUPPRESS_WARNING_POP
public:
explicit ContextScope(const L &lambda) : lambda_(lambda) {}
- ContextScope(ContextScope &&other) : lambda_(other.lambda_) {}
+ ContextScope(ContextScope &&other) : ContextScopeBase(static_cast<ContextScopeBase&&>(other)), lambda_(other.lambda_) {}
void stringify(std::ostream* s) const override { lambda_(s); }
- ~ContextScope() override { destroy(); }
+ ~ContextScope() override {
+ if (need_to_destroy) {
+ destroy();
+ }
+ }
};
struct DOCTEST_INTERFACE MessageBuilder : public MessageData
{
std::ostream* m_stream;
+ bool logged = false;
MessageBuilder(const char* file, int line, assertType::Enum severity);
MessageBuilder() = delete;
@@ -1692,6 +1814,7 @@ public:
void addFilter(const char* filter, const char* value);
void clearFilters();
+ void setOption(const char* option, bool value);
void setOption(const char* option, int value);
void setOption(const char* option, const char* value);
@@ -1701,6 +1824,8 @@ public:
void setAssertHandler(detail::assert_handler ah);
+ void setCout(std::ostream* out);
+
int run();
};
@@ -1727,6 +1852,7 @@ struct DOCTEST_INTERFACE CurrentTestCaseStats
int numAssertsFailedCurrentTest;
double seconds;
int failure_flags; // use TestCaseFailureReason::Enum
+ bool testCaseSuccess;
};
struct DOCTEST_INTERFACE TestCaseException
@@ -1824,10 +1950,11 @@ int registerReporter(const char* name, int priority, bool isReporter) {
#if !defined(DOCTEST_CONFIG_DISABLE)
// common code in asserts - for convenience
-#define DOCTEST_ASSERT_LOG_AND_REACT(b) \
+#define DOCTEST_ASSERT_LOG_REACT_RETURN(b) \
if(b.log()) \
DOCTEST_BREAK_INTO_DEBUGGER(); \
- b.react()
+ b.react(); \
+ return !b.m_failed
#ifdef DOCTEST_CONFIG_NO_TRY_CATCH_IN_ASSERTS
#define DOCTEST_WRAP_IN_TRY(x) x;
@@ -1835,7 +1962,7 @@ int registerReporter(const char* name, int priority, bool isReporter) {
#define DOCTEST_WRAP_IN_TRY(x) \
try { \
x; \
- } catch(...) { _DOCTEST_RB.translateException(); }
+ } catch(...) { DOCTEST_RB.translateException(); }
#endif // DOCTEST_CONFIG_NO_TRY_CATCH_IN_ASSERTS
#ifdef DOCTEST_CONFIG_VOID_CAST_EXPRESSIONS
@@ -1849,13 +1976,12 @@ int registerReporter(const char* name, int priority, bool isReporter) {
// registers the test by initializing a dummy var with a function
#define DOCTEST_REGISTER_FUNCTION(global_prefix, f, decorators) \
- global_prefix DOCTEST_GLOBAL_NO_WARNINGS(DOCTEST_ANONYMOUS(_DOCTEST_ANON_VAR_)) = \
+ global_prefix DOCTEST_GLOBAL_NO_WARNINGS(DOCTEST_ANONYMOUS(DOCTEST_ANON_VAR_), \
doctest::detail::regTest( \
doctest::detail::TestCase( \
f, __FILE__, __LINE__, \
doctest_detail_test_suite_ns::getCurrentTestSuite()) * \
- decorators); \
- DOCTEST_GLOBAL_NO_WARNINGS_END()
+ decorators))
#define DOCTEST_IMPLEMENT_FIXTURE(der, base, func, decorators) \
namespace { \
@@ -1878,18 +2004,18 @@ int registerReporter(const char* name, int priority, bool isReporter) {
#define DOCTEST_CREATE_AND_REGISTER_FUNCTION_IN_CLASS(f, proxy, decorators) \
static doctest::detail::funcType proxy() { return f; } \
- DOCTEST_REGISTER_FUNCTION(inline const, proxy(), decorators) \
+ DOCTEST_REGISTER_FUNCTION(inline, proxy(), decorators) \
static void f()
// for registering tests
#define DOCTEST_TEST_CASE(decorators) \
- DOCTEST_CREATE_AND_REGISTER_FUNCTION(DOCTEST_ANONYMOUS(_DOCTEST_ANON_FUNC_), decorators)
+ DOCTEST_CREATE_AND_REGISTER_FUNCTION(DOCTEST_ANONYMOUS(DOCTEST_ANON_FUNC_), decorators)
// for registering tests in classes - requires C++17 for inline variables!
#if __cplusplus >= 201703L || (DOCTEST_MSVC >= DOCTEST_COMPILER(19, 12, 0) && _MSVC_LANG >= 201703L)
#define DOCTEST_TEST_CASE_CLASS(decorators) \
- DOCTEST_CREATE_AND_REGISTER_FUNCTION_IN_CLASS(DOCTEST_ANONYMOUS(_DOCTEST_ANON_FUNC_), \
- DOCTEST_ANONYMOUS(_DOCTEST_ANON_PROXY_), \
+ DOCTEST_CREATE_AND_REGISTER_FUNCTION_IN_CLASS(DOCTEST_ANONYMOUS(DOCTEST_ANON_FUNC_), \
+ DOCTEST_ANONYMOUS(DOCTEST_ANON_PROXY_), \
decorators)
#else // DOCTEST_TEST_CASE_CLASS
#define DOCTEST_TEST_CASE_CLASS(...) \
@@ -1898,8 +2024,8 @@ int registerReporter(const char* name, int priority, bool isReporter) {
// for registering tests with a fixture
#define DOCTEST_TEST_CASE_FIXTURE(c, decorators) \
- DOCTEST_IMPLEMENT_FIXTURE(DOCTEST_ANONYMOUS(_DOCTEST_ANON_CLASS_), c, \
- DOCTEST_ANONYMOUS(_DOCTEST_ANON_FUNC_), decorators)
+ DOCTEST_IMPLEMENT_FIXTURE(DOCTEST_ANONYMOUS(DOCTEST_ANON_CLASS_), c, \
+ DOCTEST_ANONYMOUS(DOCTEST_ANON_FUNC_), decorators)
// for converting types to strings without the <typeinfo> header and demangling
#define DOCTEST_TYPE_TO_STRING_IMPL(...) \
@@ -1912,7 +2038,7 @@ int registerReporter(const char* name, int priority, bool isReporter) {
DOCTEST_TYPE_TO_STRING_IMPL(__VA_ARGS__) \
} \
} \
- typedef int DOCTEST_ANONYMOUS(_DOCTEST_ANON_FOR_SEMICOLON_)
+ static_assert(true, "")
#define DOCTEST_TEST_CASE_TEMPLATE_DEFINE_IMPL(dec, T, iter, func) \
template <typename T> \
@@ -1943,20 +2069,20 @@ int registerReporter(const char* name, int priority, bool isReporter) {
#define DOCTEST_TEST_CASE_TEMPLATE_DEFINE(dec, T, id) \
DOCTEST_TEST_CASE_TEMPLATE_DEFINE_IMPL(dec, T, DOCTEST_CAT(id, ITERATOR), \
- DOCTEST_ANONYMOUS(_DOCTEST_ANON_TMP_))
+ DOCTEST_ANONYMOUS(DOCTEST_ANON_TMP_))
#define DOCTEST_TEST_CASE_TEMPLATE_INSTANTIATE_IMPL(id, anon, ...) \
- DOCTEST_GLOBAL_NO_WARNINGS(DOCTEST_CAT(anon, DUMMY)) = \
- doctest::detail::instantiationHelper(DOCTEST_CAT(id, ITERATOR)<__VA_ARGS__>(__FILE__, __LINE__, 0));\
- DOCTEST_GLOBAL_NO_WARNINGS_END()
+ DOCTEST_GLOBAL_NO_WARNINGS(DOCTEST_CAT(anon, DUMMY), \
+ doctest::detail::instantiationHelper( \
+ DOCTEST_CAT(id, ITERATOR)<__VA_ARGS__>(__FILE__, __LINE__, 0)))
#define DOCTEST_TEST_CASE_TEMPLATE_INVOKE(id, ...) \
- DOCTEST_TEST_CASE_TEMPLATE_INSTANTIATE_IMPL(id, DOCTEST_ANONYMOUS(_DOCTEST_ANON_TMP_), std::tuple<__VA_ARGS__>) \
- typedef int DOCTEST_ANONYMOUS(_DOCTEST_ANON_FOR_SEMICOLON_)
+ DOCTEST_TEST_CASE_TEMPLATE_INSTANTIATE_IMPL(id, DOCTEST_ANONYMOUS(DOCTEST_ANON_TMP_), std::tuple<__VA_ARGS__>) \
+ static_assert(true, "")
#define DOCTEST_TEST_CASE_TEMPLATE_APPLY(id, ...) \
- DOCTEST_TEST_CASE_TEMPLATE_INSTANTIATE_IMPL(id, DOCTEST_ANONYMOUS(_DOCTEST_ANON_TMP_), __VA_ARGS__) \
- typedef int DOCTEST_ANONYMOUS(_DOCTEST_ANON_FOR_SEMICOLON_)
+ DOCTEST_TEST_CASE_TEMPLATE_INSTANTIATE_IMPL(id, DOCTEST_ANONYMOUS(DOCTEST_ANON_TMP_), __VA_ARGS__) \
+ static_assert(true, "")
#define DOCTEST_TEST_CASE_TEMPLATE_IMPL(dec, T, anon, ...) \
DOCTEST_TEST_CASE_TEMPLATE_DEFINE_IMPL(dec, T, DOCTEST_CAT(anon, ITERATOR), anon); \
@@ -1965,11 +2091,11 @@ int registerReporter(const char* name, int priority, bool isReporter) {
static void anon()
#define DOCTEST_TEST_CASE_TEMPLATE(dec, T, ...) \
- DOCTEST_TEST_CASE_TEMPLATE_IMPL(dec, T, DOCTEST_ANONYMOUS(_DOCTEST_ANON_TMP_), __VA_ARGS__)
+ DOCTEST_TEST_CASE_TEMPLATE_IMPL(dec, T, DOCTEST_ANONYMOUS(DOCTEST_ANON_TMP_), __VA_ARGS__)
// for subcases
#define DOCTEST_SUBCASE(name) \
- if(const doctest::detail::Subcase & DOCTEST_ANONYMOUS(_DOCTEST_ANON_SUBCASE_) DOCTEST_UNUSED = \
+ if(const doctest::detail::Subcase & DOCTEST_ANONYMOUS(DOCTEST_ANON_SUBCASE_) DOCTEST_UNUSED = \
doctest::detail::Subcase(name, __FILE__, __LINE__))
// for grouping tests in test suites by using code blocks
@@ -1995,53 +2121,53 @@ int registerReporter(const char* name, int priority, bool isReporter) {
namespace ns_name
#define DOCTEST_TEST_SUITE(decorators) \
- DOCTEST_TEST_SUITE_IMPL(decorators, DOCTEST_ANONYMOUS(_DOCTEST_ANON_SUITE_))
+ DOCTEST_TEST_SUITE_IMPL(decorators, DOCTEST_ANONYMOUS(DOCTEST_ANON_SUITE_))
// for starting a testsuite block
#define DOCTEST_TEST_SUITE_BEGIN(decorators) \
- DOCTEST_GLOBAL_NO_WARNINGS(DOCTEST_ANONYMOUS(_DOCTEST_ANON_VAR_)) = \
- doctest::detail::setTestSuite(doctest::detail::TestSuite() * decorators); \
- DOCTEST_GLOBAL_NO_WARNINGS_END() \
- typedef int DOCTEST_ANONYMOUS(_DOCTEST_ANON_FOR_SEMICOLON_)
+ DOCTEST_GLOBAL_NO_WARNINGS(DOCTEST_ANONYMOUS(DOCTEST_ANON_VAR_), \
+ doctest::detail::setTestSuite(doctest::detail::TestSuite() * decorators)) \
+ static_assert(true, "")
// for ending a testsuite block
#define DOCTEST_TEST_SUITE_END \
- DOCTEST_GLOBAL_NO_WARNINGS(DOCTEST_ANONYMOUS(_DOCTEST_ANON_VAR_)) = \
- doctest::detail::setTestSuite(doctest::detail::TestSuite() * ""); \
- DOCTEST_GLOBAL_NO_WARNINGS_END() \
- typedef int DOCTEST_ANONYMOUS(_DOCTEST_ANON_FOR_SEMICOLON_)
+ DOCTEST_GLOBAL_NO_WARNINGS(DOCTEST_ANONYMOUS(DOCTEST_ANON_VAR_), \
+ doctest::detail::setTestSuite(doctest::detail::TestSuite() * "")) \
+ typedef int DOCTEST_ANONYMOUS(DOCTEST_ANON_FOR_SEMICOLON_)
// for registering exception translators
#define DOCTEST_REGISTER_EXCEPTION_TRANSLATOR_IMPL(translatorName, signature) \
inline doctest::String translatorName(signature); \
- DOCTEST_GLOBAL_NO_WARNINGS(DOCTEST_ANONYMOUS(_DOCTEST_ANON_TRANSLATOR_)) = \
- doctest::registerExceptionTranslator(translatorName); \
- DOCTEST_GLOBAL_NO_WARNINGS_END() \
+ DOCTEST_GLOBAL_NO_WARNINGS(DOCTEST_ANONYMOUS(DOCTEST_ANON_TRANSLATOR_), \
+ doctest::registerExceptionTranslator(translatorName)) \
doctest::String translatorName(signature)
#define DOCTEST_REGISTER_EXCEPTION_TRANSLATOR(signature) \
- DOCTEST_REGISTER_EXCEPTION_TRANSLATOR_IMPL(DOCTEST_ANONYMOUS(_DOCTEST_ANON_TRANSLATOR_), \
+ DOCTEST_REGISTER_EXCEPTION_TRANSLATOR_IMPL(DOCTEST_ANONYMOUS(DOCTEST_ANON_TRANSLATOR_), \
signature)
// for registering reporters
#define DOCTEST_REGISTER_REPORTER(name, priority, reporter) \
- DOCTEST_GLOBAL_NO_WARNINGS(DOCTEST_ANONYMOUS(_DOCTEST_ANON_REPORTER_)) = \
- doctest::registerReporter<reporter>(name, priority, true); \
- DOCTEST_GLOBAL_NO_WARNINGS_END() typedef int DOCTEST_ANONYMOUS(_DOCTEST_ANON_FOR_SEMICOLON_)
+ DOCTEST_GLOBAL_NO_WARNINGS(DOCTEST_ANONYMOUS(DOCTEST_ANON_REPORTER_), \
+ doctest::registerReporter<reporter>(name, priority, true)) \
+ static_assert(true, "")
// for registering listeners
#define DOCTEST_REGISTER_LISTENER(name, priority, reporter) \
- DOCTEST_GLOBAL_NO_WARNINGS(DOCTEST_ANONYMOUS(_DOCTEST_ANON_REPORTER_)) = \
- doctest::registerReporter<reporter>(name, priority, false); \
- DOCTEST_GLOBAL_NO_WARNINGS_END() typedef int DOCTEST_ANONYMOUS(_DOCTEST_ANON_FOR_SEMICOLON_)
+ DOCTEST_GLOBAL_NO_WARNINGS(DOCTEST_ANONYMOUS(DOCTEST_ANON_REPORTER_), \
+ doctest::registerReporter<reporter>(name, priority, false)) \
+ static_assert(true, "")
-// for logging
+// clang-format off
+// for logging - disabling formatting because it's important to have these on 2 separate lines - see PR #557
#define DOCTEST_INFO(...) \
- DOCTEST_INFO_IMPL(DOCTEST_ANONYMOUS(_DOCTEST_CAPTURE_), DOCTEST_ANONYMOUS(_DOCTEST_CAPTURE_), \
+ DOCTEST_INFO_IMPL(DOCTEST_ANONYMOUS(DOCTEST_CAPTURE_), \
+ DOCTEST_ANONYMOUS(DOCTEST_CAPTURE_OTHER_), \
__VA_ARGS__)
+// clang-format on
#define DOCTEST_INFO_IMPL(mb_name, s_name, ...) \
- auto DOCTEST_ANONYMOUS(_DOCTEST_CAPTURE_) = doctest::detail::MakeContextScope( \
+ auto DOCTEST_ANONYMOUS(DOCTEST_CAPTURE_) = doctest::detail::MakeContextScope( \
[&](std::ostream* s_name) { \
doctest::detail::MessageBuilder mb_name(__FILE__, __LINE__, doctest::assertType::is_warn); \
mb_name.m_stream = s_name; \
@@ -2051,16 +2177,18 @@ int registerReporter(const char* name, int priority, bool isReporter) {
#define DOCTEST_CAPTURE(x) DOCTEST_INFO(#x " := ", x)
#define DOCTEST_ADD_AT_IMPL(type, file, line, mb, ...) \
- do { \
+ [&] { \
doctest::detail::MessageBuilder mb(file, line, doctest::assertType::type); \
mb * __VA_ARGS__; \
- DOCTEST_ASSERT_LOG_AND_REACT(mb); \
- } while(false)
+ if(mb.log()) \
+ DOCTEST_BREAK_INTO_DEBUGGER(); \
+ mb.react(); \
+ }()
// clang-format off
-#define DOCTEST_ADD_MESSAGE_AT(file, line, ...) DOCTEST_ADD_AT_IMPL(is_warn, file, line, DOCTEST_ANONYMOUS(_DOCTEST_MESSAGE_), __VA_ARGS__)
-#define DOCTEST_ADD_FAIL_CHECK_AT(file, line, ...) DOCTEST_ADD_AT_IMPL(is_check, file, line, DOCTEST_ANONYMOUS(_DOCTEST_MESSAGE_), __VA_ARGS__)
-#define DOCTEST_ADD_FAIL_AT(file, line, ...) DOCTEST_ADD_AT_IMPL(is_require, file, line, DOCTEST_ANONYMOUS(_DOCTEST_MESSAGE_), __VA_ARGS__)
+#define DOCTEST_ADD_MESSAGE_AT(file, line, ...) DOCTEST_ADD_AT_IMPL(is_warn, file, line, DOCTEST_ANONYMOUS(DOCTEST_MESSAGE_), __VA_ARGS__)
+#define DOCTEST_ADD_FAIL_CHECK_AT(file, line, ...) DOCTEST_ADD_AT_IMPL(is_check, file, line, DOCTEST_ANONYMOUS(DOCTEST_MESSAGE_), __VA_ARGS__)
+#define DOCTEST_ADD_FAIL_AT(file, line, ...) DOCTEST_ADD_AT_IMPL(is_require, file, line, DOCTEST_ANONYMOUS(DOCTEST_MESSAGE_), __VA_ARGS__)
// clang-format on
#define DOCTEST_MESSAGE(...) DOCTEST_ADD_MESSAGE_AT(__FILE__, __LINE__, __VA_ARGS__)
@@ -2073,18 +2201,18 @@ int registerReporter(const char* name, int priority, bool isReporter) {
#define DOCTEST_ASSERT_IMPLEMENT_2(assert_type, ...) \
DOCTEST_CLANG_SUPPRESS_WARNING_WITH_PUSH("-Woverloaded-shift-op-parentheses") \
- doctest::detail::ResultBuilder _DOCTEST_RB(doctest::assertType::assert_type, __FILE__, \
+ doctest::detail::ResultBuilder DOCTEST_RB(doctest::assertType::assert_type, __FILE__, \
__LINE__, #__VA_ARGS__); \
- DOCTEST_WRAP_IN_TRY(_DOCTEST_RB.setResult( \
+ DOCTEST_WRAP_IN_TRY(DOCTEST_RB.setResult( \
doctest::detail::ExpressionDecomposer(doctest::assertType::assert_type) \
<< __VA_ARGS__)) \
- DOCTEST_ASSERT_LOG_AND_REACT(_DOCTEST_RB) \
+ DOCTEST_ASSERT_LOG_REACT_RETURN(DOCTEST_RB) \
DOCTEST_CLANG_SUPPRESS_WARNING_POP
#define DOCTEST_ASSERT_IMPLEMENT_1(assert_type, ...) \
- do { \
+ [&] { \
DOCTEST_ASSERT_IMPLEMENT_2(assert_type, __VA_ARGS__); \
- } while(false)
+ }()
#else // DOCTEST_CONFIG_SUPER_FAST_ASSERTS
@@ -2108,51 +2236,55 @@ int registerReporter(const char* name, int priority, bool isReporter) {
#define DOCTEST_REQUIRE_FALSE(...) DOCTEST_ASSERT_IMPLEMENT_1(DT_REQUIRE_FALSE, __VA_ARGS__)
// clang-format off
-#define DOCTEST_WARN_MESSAGE(cond, ...) do { DOCTEST_INFO(__VA_ARGS__); DOCTEST_ASSERT_IMPLEMENT_2(DT_WARN, cond); } while(false)
-#define DOCTEST_CHECK_MESSAGE(cond, ...) do { DOCTEST_INFO(__VA_ARGS__); DOCTEST_ASSERT_IMPLEMENT_2(DT_CHECK, cond); } while(false)
-#define DOCTEST_REQUIRE_MESSAGE(cond, ...) do { DOCTEST_INFO(__VA_ARGS__); DOCTEST_ASSERT_IMPLEMENT_2(DT_REQUIRE, cond); } while(false)
-#define DOCTEST_WARN_FALSE_MESSAGE(cond, ...) do { DOCTEST_INFO(__VA_ARGS__); DOCTEST_ASSERT_IMPLEMENT_2(DT_WARN_FALSE, cond); } while(false)
-#define DOCTEST_CHECK_FALSE_MESSAGE(cond, ...) do { DOCTEST_INFO(__VA_ARGS__); DOCTEST_ASSERT_IMPLEMENT_2(DT_CHECK_FALSE, cond); } while(false)
-#define DOCTEST_REQUIRE_FALSE_MESSAGE(cond, ...) do { DOCTEST_INFO(__VA_ARGS__); DOCTEST_ASSERT_IMPLEMENT_2(DT_REQUIRE_FALSE, cond); } while(false)
+#define DOCTEST_WARN_MESSAGE(cond, ...) [&] {DOCTEST_INFO(__VA_ARGS__); DOCTEST_ASSERT_IMPLEMENT_2(DT_WARN, cond); }()
+#define DOCTEST_CHECK_MESSAGE(cond, ...) [&] {DOCTEST_INFO(__VA_ARGS__); DOCTEST_ASSERT_IMPLEMENT_2(DT_CHECK, cond); }()
+#define DOCTEST_REQUIRE_MESSAGE(cond, ...) [&] {DOCTEST_INFO(__VA_ARGS__); DOCTEST_ASSERT_IMPLEMENT_2(DT_REQUIRE, cond); }()
+#define DOCTEST_WARN_FALSE_MESSAGE(cond, ...) [&] {DOCTEST_INFO(__VA_ARGS__); DOCTEST_ASSERT_IMPLEMENT_2(DT_WARN_FALSE, cond); }()
+#define DOCTEST_CHECK_FALSE_MESSAGE(cond, ...) [&] {DOCTEST_INFO(__VA_ARGS__); DOCTEST_ASSERT_IMPLEMENT_2(DT_CHECK_FALSE, cond); }()
+#define DOCTEST_REQUIRE_FALSE_MESSAGE(cond, ...) [&] {DOCTEST_INFO(__VA_ARGS__); DOCTEST_ASSERT_IMPLEMENT_2(DT_REQUIRE_FALSE, cond); }()
// clang-format on
#define DOCTEST_ASSERT_THROWS_AS(expr, assert_type, message, ...) \
- do { \
+ [&] { \
if(!doctest::getContextOptions()->no_throw) { \
- doctest::detail::ResultBuilder _DOCTEST_RB(doctest::assertType::assert_type, __FILE__, \
+ doctest::detail::ResultBuilder DOCTEST_RB(doctest::assertType::assert_type, __FILE__, \
__LINE__, #expr, #__VA_ARGS__, message); \
try { \
DOCTEST_CAST_TO_VOID(expr) \
} catch(const typename doctest::detail::remove_const< \
typename doctest::detail::remove_reference<__VA_ARGS__>::type>::type&) { \
- _DOCTEST_RB.translateException(); \
- _DOCTEST_RB.m_threw_as = true; \
- } catch(...) { _DOCTEST_RB.translateException(); } \
- DOCTEST_ASSERT_LOG_AND_REACT(_DOCTEST_RB); \
+ DOCTEST_RB.translateException(); \
+ DOCTEST_RB.m_threw_as = true; \
+ } catch(...) { DOCTEST_RB.translateException(); } \
+ DOCTEST_ASSERT_LOG_REACT_RETURN(DOCTEST_RB); \
+ } else { \
+ return false; \
} \
- } while(false)
+ }()
#define DOCTEST_ASSERT_THROWS_WITH(expr, expr_str, assert_type, ...) \
- do { \
+ [&] { \
if(!doctest::getContextOptions()->no_throw) { \
- doctest::detail::ResultBuilder _DOCTEST_RB(doctest::assertType::assert_type, __FILE__, \
+ doctest::detail::ResultBuilder DOCTEST_RB(doctest::assertType::assert_type, __FILE__, \
__LINE__, expr_str, "", __VA_ARGS__); \
try { \
DOCTEST_CAST_TO_VOID(expr) \
- } catch(...) { _DOCTEST_RB.translateException(); } \
- DOCTEST_ASSERT_LOG_AND_REACT(_DOCTEST_RB); \
+ } catch(...) { DOCTEST_RB.translateException(); } \
+ DOCTEST_ASSERT_LOG_REACT_RETURN(DOCTEST_RB); \
+ } else { \
+ return false; \
} \
- } while(false)
+ }()
#define DOCTEST_ASSERT_NOTHROW(assert_type, ...) \
- do { \
- doctest::detail::ResultBuilder _DOCTEST_RB(doctest::assertType::assert_type, __FILE__, \
+ [&] { \
+ doctest::detail::ResultBuilder DOCTEST_RB(doctest::assertType::assert_type, __FILE__, \
__LINE__, #__VA_ARGS__); \
try { \
DOCTEST_CAST_TO_VOID(__VA_ARGS__) \
- } catch(...) { _DOCTEST_RB.translateException(); } \
- DOCTEST_ASSERT_LOG_AND_REACT(_DOCTEST_RB); \
- } while(false)
+ } catch(...) { DOCTEST_RB.translateException(); } \
+ DOCTEST_ASSERT_LOG_REACT_RETURN(DOCTEST_RB); \
+ }()
// clang-format off
#define DOCTEST_WARN_THROWS(...) DOCTEST_ASSERT_THROWS_WITH((__VA_ARGS__), #__VA_ARGS__, DT_WARN_THROWS, "")
@@ -2175,42 +2307,42 @@ int registerReporter(const char* name, int priority, bool isReporter) {
#define DOCTEST_CHECK_NOTHROW(...) DOCTEST_ASSERT_NOTHROW(DT_CHECK_NOTHROW, __VA_ARGS__)
#define DOCTEST_REQUIRE_NOTHROW(...) DOCTEST_ASSERT_NOTHROW(DT_REQUIRE_NOTHROW, __VA_ARGS__)
-#define DOCTEST_WARN_THROWS_MESSAGE(expr, ...) do { DOCTEST_INFO(__VA_ARGS__); DOCTEST_WARN_THROWS(expr); } while(false)
-#define DOCTEST_CHECK_THROWS_MESSAGE(expr, ...) do { DOCTEST_INFO(__VA_ARGS__); DOCTEST_CHECK_THROWS(expr); } while(false)
-#define DOCTEST_REQUIRE_THROWS_MESSAGE(expr, ...) do { DOCTEST_INFO(__VA_ARGS__); DOCTEST_REQUIRE_THROWS(expr); } while(false)
-#define DOCTEST_WARN_THROWS_AS_MESSAGE(expr, ex, ...) do { DOCTEST_INFO(__VA_ARGS__); DOCTEST_WARN_THROWS_AS(expr, ex); } while(false)
-#define DOCTEST_CHECK_THROWS_AS_MESSAGE(expr, ex, ...) do { DOCTEST_INFO(__VA_ARGS__); DOCTEST_CHECK_THROWS_AS(expr, ex); } while(false)
-#define DOCTEST_REQUIRE_THROWS_AS_MESSAGE(expr, ex, ...) do { DOCTEST_INFO(__VA_ARGS__); DOCTEST_REQUIRE_THROWS_AS(expr, ex); } while(false)
-#define DOCTEST_WARN_THROWS_WITH_MESSAGE(expr, with, ...) do { DOCTEST_INFO(__VA_ARGS__); DOCTEST_WARN_THROWS_WITH(expr, with); } while(false)
-#define DOCTEST_CHECK_THROWS_WITH_MESSAGE(expr, with, ...) do { DOCTEST_INFO(__VA_ARGS__); DOCTEST_CHECK_THROWS_WITH(expr, with); } while(false)
-#define DOCTEST_REQUIRE_THROWS_WITH_MESSAGE(expr, with, ...) do { DOCTEST_INFO(__VA_ARGS__); DOCTEST_REQUIRE_THROWS_WITH(expr, with); } while(false)
-#define DOCTEST_WARN_THROWS_WITH_AS_MESSAGE(expr, with, ex, ...) do { DOCTEST_INFO(__VA_ARGS__); DOCTEST_WARN_THROWS_WITH_AS(expr, with, ex); } while(false)
-#define DOCTEST_CHECK_THROWS_WITH_AS_MESSAGE(expr, with, ex, ...) do { DOCTEST_INFO(__VA_ARGS__); DOCTEST_CHECK_THROWS_WITH_AS(expr, with, ex); } while(false)
-#define DOCTEST_REQUIRE_THROWS_WITH_AS_MESSAGE(expr, with, ex, ...) do { DOCTEST_INFO(__VA_ARGS__); DOCTEST_REQUIRE_THROWS_WITH_AS(expr, with, ex); } while(false)
-#define DOCTEST_WARN_NOTHROW_MESSAGE(expr, ...) do { DOCTEST_INFO(__VA_ARGS__); DOCTEST_WARN_NOTHROW(expr); } while(false)
-#define DOCTEST_CHECK_NOTHROW_MESSAGE(expr, ...) do { DOCTEST_INFO(__VA_ARGS__); DOCTEST_CHECK_NOTHROW(expr); } while(false)
-#define DOCTEST_REQUIRE_NOTHROW_MESSAGE(expr, ...) do { DOCTEST_INFO(__VA_ARGS__); DOCTEST_REQUIRE_NOTHROW(expr); } while(false)
+#define DOCTEST_WARN_THROWS_MESSAGE(expr, ...) [&] {DOCTEST_INFO(__VA_ARGS__); DOCTEST_WARN_THROWS(expr); }()
+#define DOCTEST_CHECK_THROWS_MESSAGE(expr, ...) [&] {DOCTEST_INFO(__VA_ARGS__); DOCTEST_CHECK_THROWS(expr); }()
+#define DOCTEST_REQUIRE_THROWS_MESSAGE(expr, ...) [&] {DOCTEST_INFO(__VA_ARGS__); DOCTEST_REQUIRE_THROWS(expr); }()
+#define DOCTEST_WARN_THROWS_AS_MESSAGE(expr, ex, ...) [&] {DOCTEST_INFO(__VA_ARGS__); DOCTEST_WARN_THROWS_AS(expr, ex); }()
+#define DOCTEST_CHECK_THROWS_AS_MESSAGE(expr, ex, ...) [&] {DOCTEST_INFO(__VA_ARGS__); DOCTEST_CHECK_THROWS_AS(expr, ex); }()
+#define DOCTEST_REQUIRE_THROWS_AS_MESSAGE(expr, ex, ...) [&] {DOCTEST_INFO(__VA_ARGS__); DOCTEST_REQUIRE_THROWS_AS(expr, ex); }()
+#define DOCTEST_WARN_THROWS_WITH_MESSAGE(expr, with, ...) [&] {DOCTEST_INFO(__VA_ARGS__); DOCTEST_WARN_THROWS_WITH(expr, with); }()
+#define DOCTEST_CHECK_THROWS_WITH_MESSAGE(expr, with, ...) [&] {DOCTEST_INFO(__VA_ARGS__); DOCTEST_CHECK_THROWS_WITH(expr, with); }()
+#define DOCTEST_REQUIRE_THROWS_WITH_MESSAGE(expr, with, ...) [&] {DOCTEST_INFO(__VA_ARGS__); DOCTEST_REQUIRE_THROWS_WITH(expr, with); }()
+#define DOCTEST_WARN_THROWS_WITH_AS_MESSAGE(expr, with, ex, ...) [&] {DOCTEST_INFO(__VA_ARGS__); DOCTEST_WARN_THROWS_WITH_AS(expr, with, ex); }()
+#define DOCTEST_CHECK_THROWS_WITH_AS_MESSAGE(expr, with, ex, ...) [&] {DOCTEST_INFO(__VA_ARGS__); DOCTEST_CHECK_THROWS_WITH_AS(expr, with, ex); }()
+#define DOCTEST_REQUIRE_THROWS_WITH_AS_MESSAGE(expr, with, ex, ...) [&] {DOCTEST_INFO(__VA_ARGS__); DOCTEST_REQUIRE_THROWS_WITH_AS(expr, with, ex); }()
+#define DOCTEST_WARN_NOTHROW_MESSAGE(expr, ...) [&] {DOCTEST_INFO(__VA_ARGS__); DOCTEST_WARN_NOTHROW(expr); }()
+#define DOCTEST_CHECK_NOTHROW_MESSAGE(expr, ...) [&] {DOCTEST_INFO(__VA_ARGS__); DOCTEST_CHECK_NOTHROW(expr); }()
+#define DOCTEST_REQUIRE_NOTHROW_MESSAGE(expr, ...) [&] {DOCTEST_INFO(__VA_ARGS__); DOCTEST_REQUIRE_NOTHROW(expr); }()
// clang-format on
#ifndef DOCTEST_CONFIG_SUPER_FAST_ASSERTS
#define DOCTEST_BINARY_ASSERT(assert_type, comp, ...) \
- do { \
- doctest::detail::ResultBuilder _DOCTEST_RB(doctest::assertType::assert_type, __FILE__, \
+ [&] { \
+ doctest::detail::ResultBuilder DOCTEST_RB(doctest::assertType::assert_type, __FILE__, \
__LINE__, #__VA_ARGS__); \
DOCTEST_WRAP_IN_TRY( \
- _DOCTEST_RB.binary_assert<doctest::detail::binaryAssertComparison::comp>( \
+ DOCTEST_RB.binary_assert<doctest::detail::binaryAssertComparison::comp>( \
__VA_ARGS__)) \
- DOCTEST_ASSERT_LOG_AND_REACT(_DOCTEST_RB); \
- } while(false)
+ DOCTEST_ASSERT_LOG_REACT_RETURN(DOCTEST_RB); \
+ }()
#define DOCTEST_UNARY_ASSERT(assert_type, ...) \
- do { \
- doctest::detail::ResultBuilder _DOCTEST_RB(doctest::assertType::assert_type, __FILE__, \
+ [&] { \
+ doctest::detail::ResultBuilder DOCTEST_RB(doctest::assertType::assert_type, __FILE__, \
__LINE__, #__VA_ARGS__); \
- DOCTEST_WRAP_IN_TRY(_DOCTEST_RB.unary_assert(__VA_ARGS__)) \
- DOCTEST_ASSERT_LOG_AND_REACT(_DOCTEST_RB); \
- } while(false)
+ DOCTEST_WRAP_IN_TRY(DOCTEST_RB.unary_assert(__VA_ARGS__)) \
+ DOCTEST_ASSERT_LOG_REACT_RETURN(DOCTEST_RB); \
+ }()
#else // DOCTEST_CONFIG_SUPER_FAST_ASSERTS
@@ -2286,37 +2418,37 @@ int registerReporter(const char* name, int priority, bool isReporter) {
#ifdef DOCTEST_CONFIG_NO_EXCEPTIONS_BUT_WITH_ALL_ASSERTS
-#define DOCTEST_WARN_THROWS(...) (static_cast<void>(0))
-#define DOCTEST_CHECK_THROWS(...) (static_cast<void>(0))
-#define DOCTEST_REQUIRE_THROWS(...) (static_cast<void>(0))
-#define DOCTEST_WARN_THROWS_AS(expr, ...) (static_cast<void>(0))
-#define DOCTEST_CHECK_THROWS_AS(expr, ...) (static_cast<void>(0))
-#define DOCTEST_REQUIRE_THROWS_AS(expr, ...) (static_cast<void>(0))
-#define DOCTEST_WARN_THROWS_WITH(expr, ...) (static_cast<void>(0))
-#define DOCTEST_CHECK_THROWS_WITH(expr, ...) (static_cast<void>(0))
-#define DOCTEST_REQUIRE_THROWS_WITH(expr, ...) (static_cast<void>(0))
-#define DOCTEST_WARN_THROWS_WITH_AS(expr, with, ...) (static_cast<void>(0))
-#define DOCTEST_CHECK_THROWS_WITH_AS(expr, with, ...) (static_cast<void>(0))
-#define DOCTEST_REQUIRE_THROWS_WITH_AS(expr, with, ...) (static_cast<void>(0))
-#define DOCTEST_WARN_NOTHROW(...) (static_cast<void>(0))
-#define DOCTEST_CHECK_NOTHROW(...) (static_cast<void>(0))
-#define DOCTEST_REQUIRE_NOTHROW(...) (static_cast<void>(0))
-
-#define DOCTEST_WARN_THROWS_MESSAGE(expr, ...) (static_cast<void>(0))
-#define DOCTEST_CHECK_THROWS_MESSAGE(expr, ...) (static_cast<void>(0))
-#define DOCTEST_REQUIRE_THROWS_MESSAGE(expr, ...) (static_cast<void>(0))
-#define DOCTEST_WARN_THROWS_AS_MESSAGE(expr, ex, ...) (static_cast<void>(0))
-#define DOCTEST_CHECK_THROWS_AS_MESSAGE(expr, ex, ...) (static_cast<void>(0))
-#define DOCTEST_REQUIRE_THROWS_AS_MESSAGE(expr, ex, ...) (static_cast<void>(0))
-#define DOCTEST_WARN_THROWS_WITH_MESSAGE(expr, with, ...) (static_cast<void>(0))
-#define DOCTEST_CHECK_THROWS_WITH_MESSAGE(expr, with, ...) (static_cast<void>(0))
-#define DOCTEST_REQUIRE_THROWS_WITH_MESSAGE(expr, with, ...) (static_cast<void>(0))
-#define DOCTEST_WARN_THROWS_WITH_AS_MESSAGE(expr, with, ex, ...) (static_cast<void>(0))
-#define DOCTEST_CHECK_THROWS_WITH_AS_MESSAGE(expr, with, ex, ...) (static_cast<void>(0))
-#define DOCTEST_REQUIRE_THROWS_WITH_AS_MESSAGE(expr, with, ex, ...) (static_cast<void>(0))
-#define DOCTEST_WARN_NOTHROW_MESSAGE(expr, ...) (static_cast<void>(0))
-#define DOCTEST_CHECK_NOTHROW_MESSAGE(expr, ...) (static_cast<void>(0))
-#define DOCTEST_REQUIRE_NOTHROW_MESSAGE(expr, ...) (static_cast<void>(0))
+#define DOCTEST_WARN_THROWS(...) ([] { return false; })
+#define DOCTEST_CHECK_THROWS(...) ([] { return false; })
+#define DOCTEST_REQUIRE_THROWS(...) ([] { return false; })
+#define DOCTEST_WARN_THROWS_AS(expr, ...) ([] { return false; })
+#define DOCTEST_CHECK_THROWS_AS(expr, ...) ([] { return false; })
+#define DOCTEST_REQUIRE_THROWS_AS(expr, ...) ([] { return false; })
+#define DOCTEST_WARN_THROWS_WITH(expr, ...) ([] { return false; })
+#define DOCTEST_CHECK_THROWS_WITH(expr, ...) ([] { return false; })
+#define DOCTEST_REQUIRE_THROWS_WITH(expr, ...) ([] { return false; })
+#define DOCTEST_WARN_THROWS_WITH_AS(expr, with, ...) ([] { return false; })
+#define DOCTEST_CHECK_THROWS_WITH_AS(expr, with, ...) ([] { return false; })
+#define DOCTEST_REQUIRE_THROWS_WITH_AS(expr, with, ...) ([] { return false; })
+#define DOCTEST_WARN_NOTHROW(...) ([] { return false; })
+#define DOCTEST_CHECK_NOTHROW(...) ([] { return false; })
+#define DOCTEST_REQUIRE_NOTHROW(...) ([] { return false; })
+
+#define DOCTEST_WARN_THROWS_MESSAGE(expr, ...) ([] { return false; })
+#define DOCTEST_CHECK_THROWS_MESSAGE(expr, ...) ([] { return false; })
+#define DOCTEST_REQUIRE_THROWS_MESSAGE(expr, ...) ([] { return false; })
+#define DOCTEST_WARN_THROWS_AS_MESSAGE(expr, ex, ...) ([] { return false; })
+#define DOCTEST_CHECK_THROWS_AS_MESSAGE(expr, ex, ...) ([] { return false; })
+#define DOCTEST_REQUIRE_THROWS_AS_MESSAGE(expr, ex, ...) ([] { return false; })
+#define DOCTEST_WARN_THROWS_WITH_MESSAGE(expr, with, ...) ([] { return false; })
+#define DOCTEST_CHECK_THROWS_WITH_MESSAGE(expr, with, ...) ([] { return false; })
+#define DOCTEST_REQUIRE_THROWS_WITH_MESSAGE(expr, with, ...) ([] { return false; })
+#define DOCTEST_WARN_THROWS_WITH_AS_MESSAGE(expr, with, ex, ...) ([] { return false; })
+#define DOCTEST_CHECK_THROWS_WITH_AS_MESSAGE(expr, with, ex, ...) ([] { return false; })
+#define DOCTEST_REQUIRE_THROWS_WITH_AS_MESSAGE(expr, with, ex, ...) ([] { return false; })
+#define DOCTEST_WARN_NOTHROW_MESSAGE(expr, ...) ([] { return false; })
+#define DOCTEST_CHECK_NOTHROW_MESSAGE(expr, ...) ([] { return false; })
+#define DOCTEST_REQUIRE_NOTHROW_MESSAGE(expr, ...) ([] { return false; })
#else // DOCTEST_CONFIG_NO_EXCEPTIONS_BUT_WITH_ALL_ASSERTS
@@ -2358,35 +2490,32 @@ int registerReporter(const char* name, int priority, bool isReporter) {
// for registering tests
#define DOCTEST_TEST_CASE(name) \
- DOCTEST_CREATE_AND_REGISTER_FUNCTION(DOCTEST_ANONYMOUS(_DOCTEST_ANON_FUNC_), name)
+ DOCTEST_CREATE_AND_REGISTER_FUNCTION(DOCTEST_ANONYMOUS(DOCTEST_ANON_FUNC_), name)
// for registering tests in classes
#define DOCTEST_TEST_CASE_CLASS(name) \
- DOCTEST_CREATE_AND_REGISTER_FUNCTION(DOCTEST_ANONYMOUS(_DOCTEST_ANON_FUNC_), name)
+ DOCTEST_CREATE_AND_REGISTER_FUNCTION(DOCTEST_ANONYMOUS(DOCTEST_ANON_FUNC_), name)
// for registering tests with a fixture
#define DOCTEST_TEST_CASE_FIXTURE(x, name) \
- DOCTEST_IMPLEMENT_FIXTURE(DOCTEST_ANONYMOUS(_DOCTEST_ANON_CLASS_), x, \
- DOCTEST_ANONYMOUS(_DOCTEST_ANON_FUNC_), name)
+ DOCTEST_IMPLEMENT_FIXTURE(DOCTEST_ANONYMOUS(DOCTEST_ANON_CLASS_), x, \
+ DOCTEST_ANONYMOUS(DOCTEST_ANON_FUNC_), name)
// for converting types to strings without the <typeinfo> header and demangling
-#define DOCTEST_TYPE_TO_STRING(...) typedef int DOCTEST_ANONYMOUS(_DOCTEST_ANON_FOR_SEMICOLON_)
+#define DOCTEST_TYPE_TO_STRING(...) static_assert(true, "")
#define DOCTEST_TYPE_TO_STRING_IMPL(...)
// for typed tests
#define DOCTEST_TEST_CASE_TEMPLATE(name, type, ...) \
template <typename type> \
- inline void DOCTEST_ANONYMOUS(_DOCTEST_ANON_TMP_)()
+ inline void DOCTEST_ANONYMOUS(DOCTEST_ANON_TMP_)()
#define DOCTEST_TEST_CASE_TEMPLATE_DEFINE(name, type, id) \
template <typename type> \
- inline void DOCTEST_ANONYMOUS(_DOCTEST_ANON_TMP_)()
+ inline void DOCTEST_ANONYMOUS(DOCTEST_ANON_TMP_)()
-#define DOCTEST_TEST_CASE_TEMPLATE_INVOKE(id, ...) \
- typedef int DOCTEST_ANONYMOUS(_DOCTEST_ANON_FOR_SEMICOLON_)
-
-#define DOCTEST_TEST_CASE_TEMPLATE_APPLY(id, ...) \
- typedef int DOCTEST_ANONYMOUS(_DOCTEST_ANON_FOR_SEMICOLON_)
+#define DOCTEST_TEST_CASE_TEMPLATE_INVOKE(id, ...) static_assert(true, "")
+#define DOCTEST_TEST_CASE_TEMPLATE_APPLY(id, ...) static_assert(true, "")
// for subcases
#define DOCTEST_SUBCASE(name)
@@ -2395,14 +2524,14 @@ int registerReporter(const char* name, int priority, bool isReporter) {
#define DOCTEST_TEST_SUITE(name) namespace
// for starting a testsuite block
-#define DOCTEST_TEST_SUITE_BEGIN(name) typedef int DOCTEST_ANONYMOUS(_DOCTEST_ANON_FOR_SEMICOLON_)
+#define DOCTEST_TEST_SUITE_BEGIN(name) static_assert(true, "")
// for ending a testsuite block
-#define DOCTEST_TEST_SUITE_END typedef int DOCTEST_ANONYMOUS(_DOCTEST_ANON_FOR_SEMICOLON_)
+#define DOCTEST_TEST_SUITE_END typedef int DOCTEST_ANONYMOUS(DOCTEST_ANON_FOR_SEMICOLON_)
#define DOCTEST_REGISTER_EXCEPTION_TRANSLATOR(signature) \
template <typename DOCTEST_UNUSED_TEMPLATE_TYPE> \
- static inline doctest::String DOCTEST_ANONYMOUS(_DOCTEST_ANON_TRANSLATOR_)(signature)
+ static inline doctest::String DOCTEST_ANONYMOUS(DOCTEST_ANON_TRANSLATOR_)(signature)
#define DOCTEST_REGISTER_REPORTER(name, priority, reporter)
#define DOCTEST_REGISTER_LISTENER(name, priority, reporter)
@@ -2416,77 +2545,138 @@ int registerReporter(const char* name, int priority, bool isReporter) {
#define DOCTEST_FAIL_CHECK(...) (static_cast<void>(0))
#define DOCTEST_FAIL(...) (static_cast<void>(0))
-#define DOCTEST_WARN(...) (static_cast<void>(0))
-#define DOCTEST_CHECK(...) (static_cast<void>(0))
-#define DOCTEST_REQUIRE(...) (static_cast<void>(0))
-#define DOCTEST_WARN_FALSE(...) (static_cast<void>(0))
-#define DOCTEST_CHECK_FALSE(...) (static_cast<void>(0))
-#define DOCTEST_REQUIRE_FALSE(...) (static_cast<void>(0))
-
-#define DOCTEST_WARN_MESSAGE(cond, ...) (static_cast<void>(0))
-#define DOCTEST_CHECK_MESSAGE(cond, ...) (static_cast<void>(0))
-#define DOCTEST_REQUIRE_MESSAGE(cond, ...) (static_cast<void>(0))
-#define DOCTEST_WARN_FALSE_MESSAGE(cond, ...) (static_cast<void>(0))
-#define DOCTEST_CHECK_FALSE_MESSAGE(cond, ...) (static_cast<void>(0))
-#define DOCTEST_REQUIRE_FALSE_MESSAGE(cond, ...) (static_cast<void>(0))
-
-#define DOCTEST_WARN_THROWS(...) (static_cast<void>(0))
-#define DOCTEST_CHECK_THROWS(...) (static_cast<void>(0))
-#define DOCTEST_REQUIRE_THROWS(...) (static_cast<void>(0))
-#define DOCTEST_WARN_THROWS_AS(expr, ...) (static_cast<void>(0))
-#define DOCTEST_CHECK_THROWS_AS(expr, ...) (static_cast<void>(0))
-#define DOCTEST_REQUIRE_THROWS_AS(expr, ...) (static_cast<void>(0))
-#define DOCTEST_WARN_THROWS_WITH(expr, ...) (static_cast<void>(0))
-#define DOCTEST_CHECK_THROWS_WITH(expr, ...) (static_cast<void>(0))
-#define DOCTEST_REQUIRE_THROWS_WITH(expr, ...) (static_cast<void>(0))
-#define DOCTEST_WARN_THROWS_WITH_AS(expr, with, ...) (static_cast<void>(0))
-#define DOCTEST_CHECK_THROWS_WITH_AS(expr, with, ...) (static_cast<void>(0))
-#define DOCTEST_REQUIRE_THROWS_WITH_AS(expr, with, ...) (static_cast<void>(0))
-#define DOCTEST_WARN_NOTHROW(...) (static_cast<void>(0))
-#define DOCTEST_CHECK_NOTHROW(...) (static_cast<void>(0))
-#define DOCTEST_REQUIRE_NOTHROW(...) (static_cast<void>(0))
-
-#define DOCTEST_WARN_THROWS_MESSAGE(expr, ...) (static_cast<void>(0))
-#define DOCTEST_CHECK_THROWS_MESSAGE(expr, ...) (static_cast<void>(0))
-#define DOCTEST_REQUIRE_THROWS_MESSAGE(expr, ...) (static_cast<void>(0))
-#define DOCTEST_WARN_THROWS_AS_MESSAGE(expr, ex, ...) (static_cast<void>(0))
-#define DOCTEST_CHECK_THROWS_AS_MESSAGE(expr, ex, ...) (static_cast<void>(0))
-#define DOCTEST_REQUIRE_THROWS_AS_MESSAGE(expr, ex, ...) (static_cast<void>(0))
-#define DOCTEST_WARN_THROWS_WITH_MESSAGE(expr, with, ...) (static_cast<void>(0))
-#define DOCTEST_CHECK_THROWS_WITH_MESSAGE(expr, with, ...) (static_cast<void>(0))
-#define DOCTEST_REQUIRE_THROWS_WITH_MESSAGE(expr, with, ...) (static_cast<void>(0))
-#define DOCTEST_WARN_THROWS_WITH_AS_MESSAGE(expr, with, ex, ...) (static_cast<void>(0))
-#define DOCTEST_CHECK_THROWS_WITH_AS_MESSAGE(expr, with, ex, ...) (static_cast<void>(0))
-#define DOCTEST_REQUIRE_THROWS_WITH_AS_MESSAGE(expr, with, ex, ...) (static_cast<void>(0))
-#define DOCTEST_WARN_NOTHROW_MESSAGE(expr, ...) (static_cast<void>(0))
-#define DOCTEST_CHECK_NOTHROW_MESSAGE(expr, ...) (static_cast<void>(0))
-#define DOCTEST_REQUIRE_NOTHROW_MESSAGE(expr, ...) (static_cast<void>(0))
-
-#define DOCTEST_WARN_EQ(...) (static_cast<void>(0))
-#define DOCTEST_CHECK_EQ(...) (static_cast<void>(0))
-#define DOCTEST_REQUIRE_EQ(...) (static_cast<void>(0))
-#define DOCTEST_WARN_NE(...) (static_cast<void>(0))
-#define DOCTEST_CHECK_NE(...) (static_cast<void>(0))
-#define DOCTEST_REQUIRE_NE(...) (static_cast<void>(0))
-#define DOCTEST_WARN_GT(...) (static_cast<void>(0))
-#define DOCTEST_CHECK_GT(...) (static_cast<void>(0))
-#define DOCTEST_REQUIRE_GT(...) (static_cast<void>(0))
-#define DOCTEST_WARN_LT(...) (static_cast<void>(0))
-#define DOCTEST_CHECK_LT(...) (static_cast<void>(0))
-#define DOCTEST_REQUIRE_LT(...) (static_cast<void>(0))
-#define DOCTEST_WARN_GE(...) (static_cast<void>(0))
-#define DOCTEST_CHECK_GE(...) (static_cast<void>(0))
-#define DOCTEST_REQUIRE_GE(...) (static_cast<void>(0))
-#define DOCTEST_WARN_LE(...) (static_cast<void>(0))
-#define DOCTEST_CHECK_LE(...) (static_cast<void>(0))
-#define DOCTEST_REQUIRE_LE(...) (static_cast<void>(0))
-
-#define DOCTEST_WARN_UNARY(...) (static_cast<void>(0))
-#define DOCTEST_CHECK_UNARY(...) (static_cast<void>(0))
-#define DOCTEST_REQUIRE_UNARY(...) (static_cast<void>(0))
-#define DOCTEST_WARN_UNARY_FALSE(...) (static_cast<void>(0))
-#define DOCTEST_CHECK_UNARY_FALSE(...) (static_cast<void>(0))
-#define DOCTEST_REQUIRE_UNARY_FALSE(...) (static_cast<void>(0))
+#ifdef DOCTEST_CONFIG_EVALUATE_ASSERTS_EVEN_WHEN_DISABLED
+
+#define DOCTEST_WARN(...) [&] { return __VA_ARGS__; }()
+#define DOCTEST_CHECK(...) [&] { return __VA_ARGS__; }()
+#define DOCTEST_REQUIRE(...) [&] { return __VA_ARGS__; }()
+#define DOCTEST_WARN_FALSE(...) [&] { return !(__VA_ARGS__); }()
+#define DOCTEST_CHECK_FALSE(...) [&] { return !(__VA_ARGS__); }()
+#define DOCTEST_REQUIRE_FALSE(...) [&] { return !(__VA_ARGS__); }()
+
+#define DOCTEST_WARN_MESSAGE(cond, ...) [&] { return cond; }()
+#define DOCTEST_CHECK_MESSAGE(cond, ...) [&] { return cond; }()
+#define DOCTEST_REQUIRE_MESSAGE(cond, ...) [&] { return cond; }()
+#define DOCTEST_WARN_FALSE_MESSAGE(cond, ...) [&] { return !(cond); }()
+#define DOCTEST_CHECK_FALSE_MESSAGE(cond, ...) [&] { return !(cond); }()
+#define DOCTEST_REQUIRE_FALSE_MESSAGE(cond, ...) [&] { return !(cond); }()
+
+namespace doctest {
+namespace detail {
+#define DOCTEST_RELATIONAL_OP(name, op) \
+ template <typename L, typename R> \
+ bool name(const DOCTEST_REF_WRAP(L) lhs, const DOCTEST_REF_WRAP(R) rhs) { return lhs op rhs; }
+
+ DOCTEST_RELATIONAL_OP(eq, ==)
+ DOCTEST_RELATIONAL_OP(ne, !=)
+ DOCTEST_RELATIONAL_OP(lt, <)
+ DOCTEST_RELATIONAL_OP(gt, >)
+ DOCTEST_RELATIONAL_OP(le, <=)
+ DOCTEST_RELATIONAL_OP(ge, >=)
+} // namespace detail
+} // namespace doctest
+
+#define DOCTEST_WARN_EQ(...) [&] { return doctest::detail::eq(__VA_ARGS__); }()
+#define DOCTEST_CHECK_EQ(...) [&] { return doctest::detail::eq(__VA_ARGS__); }()
+#define DOCTEST_REQUIRE_EQ(...) [&] { return doctest::detail::eq(__VA_ARGS__); }()
+#define DOCTEST_WARN_NE(...) [&] { return doctest::detail::ne(__VA_ARGS__); }()
+#define DOCTEST_CHECK_NE(...) [&] { return doctest::detail::ne(__VA_ARGS__); }()
+#define DOCTEST_REQUIRE_NE(...) [&] { return doctest::detail::ne(__VA_ARGS__); }()
+#define DOCTEST_WARN_LT(...) [&] { return doctest::detail::lt(__VA_ARGS__); }()
+#define DOCTEST_CHECK_LT(...) [&] { return doctest::detail::lt(__VA_ARGS__); }()
+#define DOCTEST_REQUIRE_LT(...) [&] { return doctest::detail::lt(__VA_ARGS__); }()
+#define DOCTEST_WARN_GT(...) [&] { return doctest::detail::gt(__VA_ARGS__); }()
+#define DOCTEST_CHECK_GT(...) [&] { return doctest::detail::gt(__VA_ARGS__); }()
+#define DOCTEST_REQUIRE_GT(...) [&] { return doctest::detail::gt(__VA_ARGS__); }()
+#define DOCTEST_WARN_LE(...) [&] { return doctest::detail::le(__VA_ARGS__); }()
+#define DOCTEST_CHECK_LE(...) [&] { return doctest::detail::le(__VA_ARGS__); }()
+#define DOCTEST_REQUIRE_LE(...) [&] { return doctest::detail::le(__VA_ARGS__); }()
+#define DOCTEST_WARN_GE(...) [&] { return doctest::detail::ge(__VA_ARGS__); }()
+#define DOCTEST_CHECK_GE(...) [&] { return doctest::detail::ge(__VA_ARGS__); }()
+#define DOCTEST_REQUIRE_GE(...) [&] { return doctest::detail::ge(__VA_ARGS__); }()
+#define DOCTEST_WARN_UNARY(...) [&] { return __VA_ARGS__; }()
+#define DOCTEST_CHECK_UNARY(...) [&] { return __VA_ARGS__; }()
+#define DOCTEST_REQUIRE_UNARY(...) [&] { return __VA_ARGS__; }()
+#define DOCTEST_WARN_UNARY_FALSE(...) [&] { return !(__VA_ARGS__); }()
+#define DOCTEST_CHECK_UNARY_FALSE(...) [&] { return !(__VA_ARGS__); }()
+#define DOCTEST_REQUIRE_UNARY_FALSE(...) [&] { return !(__VA_ARGS__); }()
+
+#else // DOCTEST_CONFIG_EVALUATE_ASSERTS_EVEN_WHEN_DISABLED
+
+#define DOCTEST_WARN(...) ([] { return false; })
+#define DOCTEST_CHECK(...) ([] { return false; })
+#define DOCTEST_REQUIRE(...) ([] { return false; })
+#define DOCTEST_WARN_FALSE(...) ([] { return false; })
+#define DOCTEST_CHECK_FALSE(...) ([] { return false; })
+#define DOCTEST_REQUIRE_FALSE(...) ([] { return false; })
+
+#define DOCTEST_WARN_MESSAGE(cond, ...) ([] { return false; })
+#define DOCTEST_CHECK_MESSAGE(cond, ...) ([] { return false; })
+#define DOCTEST_REQUIRE_MESSAGE(cond, ...) ([] { return false; })
+#define DOCTEST_WARN_FALSE_MESSAGE(cond, ...) ([] { return false; })
+#define DOCTEST_CHECK_FALSE_MESSAGE(cond, ...) ([] { return false; })
+#define DOCTEST_REQUIRE_FALSE_MESSAGE(cond, ...) ([] { return false; })
+
+#define DOCTEST_WARN_EQ(...) ([] { return false; })
+#define DOCTEST_CHECK_EQ(...) ([] { return false; })
+#define DOCTEST_REQUIRE_EQ(...) ([] { return false; })
+#define DOCTEST_WARN_NE(...) ([] { return false; })
+#define DOCTEST_CHECK_NE(...) ([] { return false; })
+#define DOCTEST_REQUIRE_NE(...) ([] { return false; })
+#define DOCTEST_WARN_GT(...) ([] { return false; })
+#define DOCTEST_CHECK_GT(...) ([] { return false; })
+#define DOCTEST_REQUIRE_GT(...) ([] { return false; })
+#define DOCTEST_WARN_LT(...) ([] { return false; })
+#define DOCTEST_CHECK_LT(...) ([] { return false; })
+#define DOCTEST_REQUIRE_LT(...) ([] { return false; })
+#define DOCTEST_WARN_GE(...) ([] { return false; })
+#define DOCTEST_CHECK_GE(...) ([] { return false; })
+#define DOCTEST_REQUIRE_GE(...) ([] { return false; })
+#define DOCTEST_WARN_LE(...) ([] { return false; })
+#define DOCTEST_CHECK_LE(...) ([] { return false; })
+#define DOCTEST_REQUIRE_LE(...) ([] { return false; })
+
+#define DOCTEST_WARN_UNARY(...) ([] { return false; })
+#define DOCTEST_CHECK_UNARY(...) ([] { return false; })
+#define DOCTEST_REQUIRE_UNARY(...) ([] { return false; })
+#define DOCTEST_WARN_UNARY_FALSE(...) ([] { return false; })
+#define DOCTEST_CHECK_UNARY_FALSE(...) ([] { return false; })
+#define DOCTEST_REQUIRE_UNARY_FALSE(...) ([] { return false; })
+
+#endif // DOCTEST_CONFIG_EVALUATE_ASSERTS_EVEN_WHEN_DISABLED
+
+// TODO: think about if these also need to work properly even when doctest is disabled
+#define DOCTEST_WARN_THROWS(...) ([] { return false; })
+#define DOCTEST_CHECK_THROWS(...) ([] { return false; })
+#define DOCTEST_REQUIRE_THROWS(...) ([] { return false; })
+#define DOCTEST_WARN_THROWS_AS(expr, ...) ([] { return false; })
+#define DOCTEST_CHECK_THROWS_AS(expr, ...) ([] { return false; })
+#define DOCTEST_REQUIRE_THROWS_AS(expr, ...) ([] { return false; })
+#define DOCTEST_WARN_THROWS_WITH(expr, ...) ([] { return false; })
+#define DOCTEST_CHECK_THROWS_WITH(expr, ...) ([] { return false; })
+#define DOCTEST_REQUIRE_THROWS_WITH(expr, ...) ([] { return false; })
+#define DOCTEST_WARN_THROWS_WITH_AS(expr, with, ...) ([] { return false; })
+#define DOCTEST_CHECK_THROWS_WITH_AS(expr, with, ...) ([] { return false; })
+#define DOCTEST_REQUIRE_THROWS_WITH_AS(expr, with, ...) ([] { return false; })
+#define DOCTEST_WARN_NOTHROW(...) ([] { return false; })
+#define DOCTEST_CHECK_NOTHROW(...) ([] { return false; })
+#define DOCTEST_REQUIRE_NOTHROW(...) ([] { return false; })
+
+#define DOCTEST_WARN_THROWS_MESSAGE(expr, ...) ([] { return false; })
+#define DOCTEST_CHECK_THROWS_MESSAGE(expr, ...) ([] { return false; })
+#define DOCTEST_REQUIRE_THROWS_MESSAGE(expr, ...) ([] { return false; })
+#define DOCTEST_WARN_THROWS_AS_MESSAGE(expr, ex, ...) ([] { return false; })
+#define DOCTEST_CHECK_THROWS_AS_MESSAGE(expr, ex, ...) ([] { return false; })
+#define DOCTEST_REQUIRE_THROWS_AS_MESSAGE(expr, ex, ...) ([] { return false; })
+#define DOCTEST_WARN_THROWS_WITH_MESSAGE(expr, with, ...) ([] { return false; })
+#define DOCTEST_CHECK_THROWS_WITH_MESSAGE(expr, with, ...) ([] { return false; })
+#define DOCTEST_REQUIRE_THROWS_WITH_MESSAGE(expr, with, ...) ([] { return false; })
+#define DOCTEST_WARN_THROWS_WITH_AS_MESSAGE(expr, with, ex, ...) ([] { return false; })
+#define DOCTEST_CHECK_THROWS_WITH_AS_MESSAGE(expr, with, ex, ...) ([] { return false; })
+#define DOCTEST_REQUIRE_THROWS_WITH_AS_MESSAGE(expr, with, ex, ...) ([] { return false; })
+#define DOCTEST_WARN_NOTHROW_MESSAGE(expr, ...) ([] { return false; })
+#define DOCTEST_CHECK_NOTHROW_MESSAGE(expr, ...) ([] { return false; })
+#define DOCTEST_REQUIRE_NOTHROW_MESSAGE(expr, ...) ([] { return false; })
#endif // DOCTEST_CONFIG_DISABLE
@@ -2706,6 +2896,8 @@ DOCTEST_CLANG_SUPPRESS_WARNING_POP
DOCTEST_MSVC_SUPPRESS_WARNING_POP
DOCTEST_GCC_SUPPRESS_WARNING_POP
+DOCTEST_SUPPRESS_COMMON_WARNINGS_POP
+
#endif // DOCTEST_LIBRARY_INCLUDED
#ifndef DOCTEST_SINGLE_HEADER
@@ -2725,13 +2917,11 @@ DOCTEST_CLANG_SUPPRESS_WARNING_WITH_PUSH("-Wunused-macros")
DOCTEST_CLANG_SUPPRESS_WARNING_POP
+DOCTEST_SUPPRESS_COMMON_WARNINGS_PUSH
+
DOCTEST_CLANG_SUPPRESS_WARNING_PUSH
-DOCTEST_CLANG_SUPPRESS_WARNING("-Wunknown-pragmas")
-DOCTEST_CLANG_SUPPRESS_WARNING("-Wpadded")
-DOCTEST_CLANG_SUPPRESS_WARNING("-Wweak-vtables")
DOCTEST_CLANG_SUPPRESS_WARNING("-Wglobal-constructors")
DOCTEST_CLANG_SUPPRESS_WARNING("-Wexit-time-destructors")
-DOCTEST_CLANG_SUPPRESS_WARNING("-Wmissing-prototypes")
DOCTEST_CLANG_SUPPRESS_WARNING("-Wsign-conversion")
DOCTEST_CLANG_SUPPRESS_WARNING("-Wshorten-64-to-32")
DOCTEST_CLANG_SUPPRESS_WARNING("-Wmissing-variable-declarations")
@@ -2739,65 +2929,35 @@ DOCTEST_CLANG_SUPPRESS_WARNING("-Wswitch")
DOCTEST_CLANG_SUPPRESS_WARNING("-Wswitch-enum")
DOCTEST_CLANG_SUPPRESS_WARNING("-Wcovered-switch-default")
DOCTEST_CLANG_SUPPRESS_WARNING("-Wmissing-noreturn")
-DOCTEST_CLANG_SUPPRESS_WARNING("-Wunused-local-typedef")
DOCTEST_CLANG_SUPPRESS_WARNING("-Wdisabled-macro-expansion")
DOCTEST_CLANG_SUPPRESS_WARNING("-Wmissing-braces")
DOCTEST_CLANG_SUPPRESS_WARNING("-Wmissing-field-initializers")
-DOCTEST_CLANG_SUPPRESS_WARNING("-Wc++98-compat")
-DOCTEST_CLANG_SUPPRESS_WARNING("-Wc++98-compat-pedantic")
DOCTEST_CLANG_SUPPRESS_WARNING("-Wunused-member-function")
DOCTEST_CLANG_SUPPRESS_WARNING("-Wnonportable-system-include-path")
DOCTEST_GCC_SUPPRESS_WARNING_PUSH
-DOCTEST_GCC_SUPPRESS_WARNING("-Wunknown-pragmas")
-DOCTEST_GCC_SUPPRESS_WARNING("-Wpragmas")
DOCTEST_GCC_SUPPRESS_WARNING("-Wconversion")
-DOCTEST_GCC_SUPPRESS_WARNING("-Weffc++")
DOCTEST_GCC_SUPPRESS_WARNING("-Wsign-conversion")
-DOCTEST_GCC_SUPPRESS_WARNING("-Wstrict-overflow")
-DOCTEST_GCC_SUPPRESS_WARNING("-Wstrict-aliasing")
DOCTEST_GCC_SUPPRESS_WARNING("-Wmissing-field-initializers")
DOCTEST_GCC_SUPPRESS_WARNING("-Wmissing-braces")
-DOCTEST_GCC_SUPPRESS_WARNING("-Wmissing-declarations")
DOCTEST_GCC_SUPPRESS_WARNING("-Wswitch")
DOCTEST_GCC_SUPPRESS_WARNING("-Wswitch-enum")
DOCTEST_GCC_SUPPRESS_WARNING("-Wswitch-default")
DOCTEST_GCC_SUPPRESS_WARNING("-Wunsafe-loop-optimizations")
DOCTEST_GCC_SUPPRESS_WARNING("-Wold-style-cast")
-DOCTEST_GCC_SUPPRESS_WARNING("-Wunused-local-typedefs")
-DOCTEST_GCC_SUPPRESS_WARNING("-Wuseless-cast")
DOCTEST_GCC_SUPPRESS_WARNING("-Wunused-function")
DOCTEST_GCC_SUPPRESS_WARNING("-Wmultiple-inheritance")
-DOCTEST_GCC_SUPPRESS_WARNING("-Wnoexcept")
DOCTEST_GCC_SUPPRESS_WARNING("-Wsuggest-attribute")
DOCTEST_MSVC_SUPPRESS_WARNING_PUSH
-DOCTEST_MSVC_SUPPRESS_WARNING(4616) // invalid compiler warning
-DOCTEST_MSVC_SUPPRESS_WARNING(4619) // invalid compiler warning
-DOCTEST_MSVC_SUPPRESS_WARNING(4996) // The compiler encountered a deprecated declaration
DOCTEST_MSVC_SUPPRESS_WARNING(4267) // 'var' : conversion from 'x' to 'y', possible loss of data
-DOCTEST_MSVC_SUPPRESS_WARNING(4706) // assignment within conditional expression
-DOCTEST_MSVC_SUPPRESS_WARNING(4512) // 'class' : assignment operator could not be generated
-DOCTEST_MSVC_SUPPRESS_WARNING(4127) // conditional expression is constant
DOCTEST_MSVC_SUPPRESS_WARNING(4530) // C++ exception handler used, but unwind semantics not enabled
DOCTEST_MSVC_SUPPRESS_WARNING(4577) // 'noexcept' used with no exception handling mode specified
DOCTEST_MSVC_SUPPRESS_WARNING(4774) // format string expected in argument is not a string literal
DOCTEST_MSVC_SUPPRESS_WARNING(4365) // conversion from 'int' to 'unsigned', signed/unsigned mismatch
-DOCTEST_MSVC_SUPPRESS_WARNING(4820) // padding in structs
-DOCTEST_MSVC_SUPPRESS_WARNING(4640) // construction of local static object is not thread-safe
DOCTEST_MSVC_SUPPRESS_WARNING(5039) // pointer to potentially throwing function passed to extern C
-DOCTEST_MSVC_SUPPRESS_WARNING(5045) // Spectre mitigation stuff
-DOCTEST_MSVC_SUPPRESS_WARNING(4626) // assignment operator was implicitly defined as deleted
-DOCTEST_MSVC_SUPPRESS_WARNING(5027) // move assignment operator was implicitly defined as deleted
-DOCTEST_MSVC_SUPPRESS_WARNING(5026) // move constructor was implicitly defined as deleted
-DOCTEST_MSVC_SUPPRESS_WARNING(4625) // copy constructor was implicitly defined as deleted
DOCTEST_MSVC_SUPPRESS_WARNING(4800) // forcing value to bool 'true' or 'false' (performance warning)
-// static analysis
-DOCTEST_MSVC_SUPPRESS_WARNING(26439) // This kind of function may not throw. Declare it 'noexcept'
-DOCTEST_MSVC_SUPPRESS_WARNING(26495) // Always initialize a member variable
-DOCTEST_MSVC_SUPPRESS_WARNING(26451) // Arithmetic overflow ...
-DOCTEST_MSVC_SUPPRESS_WARNING(26444) // Avoid unnamed objects with custom construction and dtor...
-DOCTEST_MSVC_SUPPRESS_WARNING(26812) // Prefer 'enum class' over 'enum'
+DOCTEST_MSVC_SUPPRESS_WARNING(5245) // unreferenced function with internal linkage has been removed
DOCTEST_MAKE_STD_HEADERS_CLEAN_FROM_WARNINGS_ON_WALL_BEGIN
@@ -2805,7 +2965,7 @@ DOCTEST_MAKE_STD_HEADERS_CLEAN_FROM_WARNINGS_ON_WALL_BEGIN
#include <ctime>
#include <cmath>
#include <climits>
-// borland (Embarcadero) compiler requires math.h and not cmath - https://github.com/onqtam/doctest/pull/37
+// borland (Embarcadero) compiler requires math.h and not cmath - https://github.com/doctest/doctest/pull/37
#ifdef __BORLANDC__
#include <math.h>
#endif // __BORLANDC__
@@ -2863,7 +3023,7 @@ DOCTEST_MAKE_STD_HEADERS_CLEAN_FROM_WARNINGS_ON_WALL_BEGIN
#endif // DOCTEST_PLATFORM_WINDOWS
-// this is a fix for https://github.com/onqtam/doctest/issues/348
+// this is a fix for https://github.com/doctest/doctest/issues/348
// https://mail.gnome.org/archives/xml/2012-January/msg00000.html
#if !defined(HAVE_UNISTD_H) && !defined(STDOUT_FILENO)
#define STDOUT_FILENO fileno(stdout)
@@ -2885,8 +3045,12 @@ DOCTEST_MAKE_STD_HEADERS_CLEAN_FROM_WARNINGS_ON_WALL_END
#endif
#ifndef DOCTEST_THREAD_LOCAL
+#if DOCTEST_MSVC && (DOCTEST_MSVC < DOCTEST_COMPILER(19, 0, 0))
+#define DOCTEST_THREAD_LOCAL
+#else // DOCTEST_MSVC
#define DOCTEST_THREAD_LOCAL thread_local
-#endif
+#endif // DOCTEST_MSVC
+#endif // DOCTEST_THREAD_LOCAL
#ifndef DOCTEST_MULTI_LANE_ATOMICS_THREAD_LANES
#define DOCTEST_MULTI_LANE_ATOMICS_THREAD_LANES 32
@@ -2906,12 +3070,34 @@ DOCTEST_MAKE_STD_HEADERS_CLEAN_FROM_WARNINGS_ON_WALL_END
#define DOCTEST_CONFIG_NO_MULTI_LANE_ATOMICS
#endif
+#ifndef DOCTEST_CDECL
+#define DOCTEST_CDECL __cdecl
+#endif
+
namespace doctest {
bool is_running_in_test = false;
namespace {
using namespace detail;
+
+ template <typename Ex>
+ DOCTEST_NORETURN void throw_exception(Ex const& e) {
+#ifndef DOCTEST_CONFIG_NO_EXCEPTIONS
+ throw e;
+#else // DOCTEST_CONFIG_NO_EXCEPTIONS
+ std::cerr << "doctest will terminate because it needed to throw an exception.\n"
+ << "The message was: " << e.what() << '\n';
+ std::terminate();
+#endif // DOCTEST_CONFIG_NO_EXCEPTIONS
+ }
+
+#ifndef DOCTEST_INTERNAL_ERROR
+#define DOCTEST_INTERNAL_ERROR(msg) \
+ throw_exception(std::logic_error( \
+ __FILE__ ":" DOCTEST_TOSTR(__LINE__) ": Internal doctest error: " msg))
+#endif // DOCTEST_INTERNAL_ERROR
+
// case insensitive strcmp
int stricmp(const char* a, const char* b) {
for(;; a++, b++) {
@@ -2955,8 +3141,6 @@ namespace {
} // namespace
namespace detail {
- void my_memcpy(void* dest, const void* src, unsigned num) { memcpy(dest, src, num); }
-
String rawMemoryToString(const void* object, unsigned size) {
// Reverse order for little endian architectures
int i = 0, end = static_cast<int>(size), inc = 1;
@@ -2966,25 +3150,42 @@ namespace detail {
}
unsigned const char* bytes = static_cast<unsigned const char*>(object);
- std::ostringstream oss;
- oss << "0x" << std::setfill('0') << std::hex;
+ std::ostream* oss = tlssPush();
+ *oss << "0x" << std::setfill('0') << std::hex;
for(; i != end; i += inc)
- oss << std::setw(2) << static_cast<unsigned>(bytes[i]);
- return oss.str().c_str();
+ *oss << std::setw(2) << static_cast<unsigned>(bytes[i]);
+ return tlssPop();
}
- DOCTEST_THREAD_LOCAL std::ostringstream g_oss; // NOLINT(cert-err58-cpp)
+ DOCTEST_THREAD_LOCAL class
+ {
+ std::vector<std::streampos> stack;
+ std::stringstream ss;
+
+ public:
+ std::ostream* push() {
+ stack.push_back(ss.tellp());
+ return &ss;
+ }
+
+ String pop() {
+ if (stack.empty())
+ DOCTEST_INTERNAL_ERROR("TLSS was empty when trying to pop!");
- std::ostream* getTlsOss() {
- g_oss.clear(); // there shouldn't be anything worth clearing in the flags
- g_oss.str(""); // the slow way of resetting a string stream
- //g_oss.seekp(0); // optimal reset - as seen here: https://stackoverflow.com/a/624291/3162383
- return &g_oss;
+ std::streampos pos = stack.back();
+ stack.pop_back();
+ unsigned sz = static_cast<unsigned>(ss.tellp() - pos);
+ ss.rdbuf()->pubseekpos(pos, std::ios::in | std::ios::out);
+ return String(ss, sz);
+ }
+ } g_oss;
+
+ std::ostream* tlssPush() {
+ return g_oss.push();
}
- String getTlsOssResult() {
- //g_oss << std::ends; // needed - as shown here: https://stackoverflow.com/a/624291/3162383
- return g_oss.str().c_str();
+ String tlssPop() {
+ return g_oss.pop();
}
#ifndef DOCTEST_CONFIG_DISABLE
@@ -2995,8 +3196,7 @@ namespace timer_large_integer
#if defined(DOCTEST_PLATFORM_WINDOWS)
typedef ULONGLONG type;
#else // DOCTEST_PLATFORM_WINDOWS
- using namespace std;
- typedef uint64_t type;
+ typedef std::uint64_t type;
#endif // DOCTEST_PLATFORM_WINDOWS
}
@@ -3088,7 +3288,7 @@ typedef timer_large_integer::type ticks_t;
return result;
}
- T operator=(T desired) DOCTEST_NOEXCEPT {
+ T operator=(T desired) DOCTEST_NOEXCEPT { // lgtm [cpp/assignment-does-not-return-this]
store(desired);
return desired;
}
@@ -3103,7 +3303,7 @@ typedef timer_large_integer::type ticks_t;
private:
// Each thread has a different atomic that it operates on. If more than NumLanes threads
- // use this, some will use the same atomic. So performance will degrate a bit, but still
+ // use this, some will use the same atomic. So performance will degrade a bit, but still
// everything will work.
//
// The logic here is a bit tricky. The call should be as fast as possible, so that there
@@ -3198,7 +3398,8 @@ typedef timer_large_integer::type ticks_t;
(TestCaseFailureReason::FailedExactlyNumTimes & failure_flags);
// if any subcase has failed - the whole test case has failed
- if(failure_flags && !ok_to_fail)
+ testCaseSuccess = !(failure_flags && !ok_to_fail);
+ if(!testCaseSuccess)
numTestCasesFailed++;
}
};
@@ -3213,19 +3414,29 @@ typedef timer_large_integer::type ticks_t;
#endif // DOCTEST_CONFIG_DISABLE
} // namespace detail
+char* String::allocate(unsigned sz) {
+ if (sz <= last) {
+ buf[sz] = '\0';
+ setLast(last - sz);
+ return buf;
+ } else {
+ setOnHeap();
+ data.size = sz;
+ data.capacity = data.size + 1;
+ data.ptr = new char[data.capacity];
+ data.ptr[sz] = '\0';
+ return data.ptr;
+ }
+}
+
void String::setOnHeap() { *reinterpret_cast<unsigned char*>(&buf[last]) = 128; }
void String::setLast(unsigned in) { buf[last] = char(in); }
void String::copy(const String& other) {
- using namespace std;
if(other.isOnStack()) {
memcpy(buf, other.buf, len);
} else {
- setOnHeap();
- data.size = other.data.size;
- data.capacity = data.size + 1;
- data.ptr = new char[data.capacity];
- memcpy(data.ptr, other.data.ptr, data.size + 1);
+ memcpy(allocate(other.data.size), other.data.ptr, other.data.size);
}
}
@@ -3244,19 +3455,11 @@ String::String(const char* in)
: String(in, strlen(in)) {}
String::String(const char* in, unsigned in_size) {
- using namespace std;
- if(in_size <= last) {
- memcpy(buf, in, in_size);
- buf[in_size] = '\0';
- setLast(last - in_size);
- } else {
- setOnHeap();
- data.size = in_size;
- data.capacity = data.size + 1;
- data.ptr = new char[data.capacity];
- memcpy(data.ptr, in, in_size);
- data.ptr[in_size] = '\0';
- }
+ memcpy(allocate(in_size), in, in_size);
+}
+
+String::String(std::istream& in, unsigned in_size) {
+ in.read(allocate(in_size), in_size);
}
String::String(const String& other) { copy(other); }
@@ -3276,7 +3479,6 @@ String& String::operator+=(const String& other) {
const unsigned my_old_size = size();
const unsigned other_size = other.size();
const unsigned total_size = my_old_size + other_size;
- using namespace std;
if(isOnStack()) {
if(total_size < len) {
// append to the current stack space
@@ -3323,18 +3525,13 @@ String& String::operator+=(const String& other) {
return *this;
}
-// NOLINTNEXTLINE(clang-analyzer-cplusplus.NewDeleteLeaks)
-String String::operator+(const String& other) const { return String(*this) += other; }
-
String::String(String&& other) {
- using namespace std;
memcpy(buf, other.buf, len);
other.buf[0] = '\0';
other.setLast();
}
String& String::operator=(String&& other) {
- using namespace std;
if(this != &other) {
if(!isOnStack())
delete[] data.ptr;
@@ -3379,6 +3576,9 @@ int String::compare(const String& other, bool no_case) const {
return compare(other.c_str(), no_case);
}
+// NOLINTNEXTLINE(clang-analyzer-cplusplus.NewDeleteLeaks)
+String operator+(const String& lhs, const String& rhs) { return String(lhs) += rhs; }
+
// clang-format off
bool operator==(const String& lhs, const String& rhs) { return lhs.compare(rhs) == 0; }
bool operator!=(const String& lhs, const String& rhs) { return lhs.compare(rhs) != 0; }
@@ -3537,7 +3737,7 @@ DOCTEST_TO_STRING_OVERLOAD(int long long unsigned, "%llu")
String toString(std::nullptr_t) { return "NULL"; }
#if DOCTEST_MSVC >= DOCTEST_COMPILER(19, 20, 0)
-// see this issue on why this is needed: https://github.com/onqtam/doctest/issues/183
+// see this issue on why this is needed: https://github.com/doctest/doctest/issues/183
String toString(const std::string& in) { return in.c_str(); }
#endif // VS 2019
@@ -3581,7 +3781,7 @@ bool operator>(const Approx& lhs, double rhs) { return lhs.m_value > rhs && lhs
String toString(const Approx& in) {
// NOLINTNEXTLINE(clang-analyzer-cplusplus.NewDeleteLeaks)
- return String("Approx( ") + doctest::toString(in.m_value) + " )";
+ return "Approx( " + doctest::toString(in.m_value) + " )";
}
const ContextOptions* getContextOptions() { return DOCTEST_BRANCH_ON_DISABLED(nullptr, g_cs); }
@@ -3594,11 +3794,13 @@ Context::~Context() = default;
void Context::applyCommandLine(int, const char* const*) {}
void Context::addFilter(const char*, const char*) {}
void Context::clearFilters() {}
+void Context::setOption(const char*, bool) {}
void Context::setOption(const char*, int) {}
void Context::setOption(const char*, const char*) {}
bool Context::shouldExit() { return false; }
void Context::setAsDefaultForAssertsOutOfTestCases() {}
void Context::setAssertHandler(detail::assert_handler) {}
+void Context::setCout(std::ostream* out) {}
int Context::run() { return 0; }
IReporter::~IReporter() = default;
@@ -3769,8 +3971,8 @@ namespace detail {
DOCTEST_ITERATE_THROUGH_REPORTERS(subcase_start, m_signature);
}
- DOCTEST_MSVC_SUPPRESS_WARNING_WITH_PUSH(4996) // std::uncaught_exception is deprecated in C++17
- DOCTEST_GCC_SUPPRESS_WARNING_WITH_PUSH("-Wdeprecated-declarations")
+ DOCTEST_MSVC_SUPPRESS_WARNING_WITH_PUSH(4996) // std::uncaught_exception is deprecated in C++17
+ DOCTEST_GCC_SUPPRESS_WARNING_WITH_PUSH("-Wdeprecated-declarations")
DOCTEST_CLANG_SUPPRESS_WARNING_WITH_PUSH("-Wdeprecated-declarations")
Subcase::~Subcase() {
@@ -3797,8 +3999,8 @@ namespace detail {
}
}
- DOCTEST_CLANG_SUPPRESS_WARNING_POP
- DOCTEST_GCC_SUPPRESS_WARNING_POP
+ DOCTEST_CLANG_SUPPRESS_WARNING_POP
+ DOCTEST_GCC_SUPPRESS_WARNING_POP
DOCTEST_MSVC_SUPPRESS_WARNING_POP
Subcase::operator bool() const { return m_entered; }
@@ -3812,15 +4014,6 @@ namespace detail {
TestSuite& TestSuite::operator*(const char* in) {
m_test_suite = in;
- // clear state
- m_description = nullptr;
- m_skip = false;
- m_no_breaks = false;
- m_no_output = false;
- m_may_fail = false;
- m_should_fail = false;
- m_expected_failures = 0;
- m_timeout = 0;
return *this;
}
@@ -3925,29 +4118,6 @@ namespace {
return suiteOrderComparator(lhs, rhs);
}
-#ifdef DOCTEST_CONFIG_COLORS_WINDOWS
- HANDLE g_stdoutHandle;
- WORD g_origFgAttrs;
- WORD g_origBgAttrs;
- bool g_attrsInitted = false;
-
- int colors_init() {
- if(!g_attrsInitted) {
- g_stdoutHandle = GetStdHandle(STD_OUTPUT_HANDLE);
- g_attrsInitted = true;
- CONSOLE_SCREEN_BUFFER_INFO csbiInfo;
- GetConsoleScreenBufferInfo(g_stdoutHandle, &csbiInfo);
- g_origFgAttrs = csbiInfo.wAttributes & ~(BACKGROUND_GREEN | BACKGROUND_RED |
- BACKGROUND_BLUE | BACKGROUND_INTENSITY);
- g_origBgAttrs = csbiInfo.wAttributes & ~(FOREGROUND_GREEN | FOREGROUND_RED |
- FOREGROUND_BLUE | FOREGROUND_INTENSITY);
- }
- return 0;
- }
-
- int dumy_init_console_colors = colors_init();
-#endif // DOCTEST_CONFIG_COLORS_WINDOWS
-
DOCTEST_CLANG_SUPPRESS_WARNING_WITH_PUSH("-Wdeprecated-declarations")
void color_to_stream(std::ostream& s, Color::Enum code) {
static_cast<void>(s); // for DOCTEST_CONFIG_COLORS_NONE or DOCTEST_CONFIG_COLORS_WINDOWS
@@ -3981,10 +4151,26 @@ namespace {
#ifdef DOCTEST_CONFIG_COLORS_WINDOWS
if(g_no_colors ||
- (isatty(fileno(stdout)) == false && getContextOptions()->force_colors == false))
+ (_isatty(_fileno(stdout)) == false && getContextOptions()->force_colors == false))
return;
-#define DOCTEST_SET_ATTR(x) SetConsoleTextAttribute(g_stdoutHandle, x | g_origBgAttrs)
+ static struct ConsoleHelper {
+ HANDLE stdoutHandle;
+ WORD origFgAttrs;
+ WORD origBgAttrs;
+
+ ConsoleHelper() {
+ stdoutHandle = GetStdHandle(STD_OUTPUT_HANDLE);
+ CONSOLE_SCREEN_BUFFER_INFO csbiInfo;
+ GetConsoleScreenBufferInfo(stdoutHandle, &csbiInfo);
+ origFgAttrs = csbiInfo.wAttributes & ~(BACKGROUND_GREEN | BACKGROUND_RED |
+ BACKGROUND_BLUE | BACKGROUND_INTENSITY);
+ origBgAttrs = csbiInfo.wAttributes & ~(FOREGROUND_GREEN | FOREGROUND_RED |
+ FOREGROUND_BLUE | FOREGROUND_INTENSITY);
+ }
+ } ch;
+
+#define DOCTEST_SET_ATTR(x) SetConsoleTextAttribute(ch.stdoutHandle, x | ch.origBgAttrs)
// clang-format off
switch (code) {
@@ -4001,7 +4187,7 @@ namespace {
case Color::BrightWhite: DOCTEST_SET_ATTR(FOREGROUND_INTENSITY | FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_BLUE); break;
case Color::None:
case Color::Bright: // invalid
- default: DOCTEST_SET_ATTR(g_origFgAttrs);
+ default: DOCTEST_SET_ATTR(ch.origFgAttrs);
}
// clang-format on
#endif // DOCTEST_CONFIG_COLORS_WINDOWS
@@ -4145,8 +4331,16 @@ namespace detail {
g_infoContexts.push_back(this);
}
- DOCTEST_MSVC_SUPPRESS_WARNING_WITH_PUSH(4996) // std::uncaught_exception is deprecated in C++17
- DOCTEST_GCC_SUPPRESS_WARNING_WITH_PUSH("-Wdeprecated-declarations")
+ ContextScopeBase::ContextScopeBase(ContextScopeBase&& other) {
+ if (other.need_to_destroy) {
+ other.destroy();
+ }
+ other.need_to_destroy = false;
+ g_infoContexts.push_back(this);
+ }
+
+ DOCTEST_MSVC_SUPPRESS_WARNING_WITH_PUSH(4996) // std::uncaught_exception is deprecated in C++17
+ DOCTEST_GCC_SUPPRESS_WARNING_WITH_PUSH("-Wdeprecated-declarations")
DOCTEST_CLANG_SUPPRESS_WARNING_WITH_PUSH("-Wdeprecated-declarations")
// destroy cannot be inlined into the destructor because that would mean calling stringify after
@@ -4165,8 +4359,8 @@ namespace detail {
g_infoContexts.pop_back();
}
- DOCTEST_CLANG_SUPPRESS_WARNING_POP
- DOCTEST_GCC_SUPPRESS_WARNING_POP
+ DOCTEST_CLANG_SUPPRESS_WARNING_POP
+ DOCTEST_GCC_SUPPRESS_WARNING_POP
DOCTEST_MSVC_SUPPRESS_WARNING_POP
} // namespace detail
namespace {
@@ -4313,7 +4507,7 @@ namespace {
static unsigned int prev_abort_behavior;
static int prev_report_mode;
static _HFILE prev_report_file;
- static void (*prev_sigabrt_handler)(int);
+ static void (DOCTEST_CDECL *prev_sigabrt_handler)(int);
static std::terminate_handler original_terminate_handler;
static bool isSet;
static ULONG guaranteeSize;
@@ -4325,7 +4519,7 @@ namespace {
unsigned int FatalConditionHandler::prev_abort_behavior;
int FatalConditionHandler::prev_report_mode;
_HFILE FatalConditionHandler::prev_report_file;
- void (*FatalConditionHandler::prev_sigabrt_handler)(int);
+ void (DOCTEST_CDECL *FatalConditionHandler::prev_sigabrt_handler)(int);
std::terminate_handler FatalConditionHandler::original_terminate_handler;
bool FatalConditionHandler::isSet = false;
ULONG FatalConditionHandler::guaranteeSize = 0;
@@ -4498,7 +4692,7 @@ namespace detail {
}
if(m_exception.size())
- m_exception = String("\"") + m_exception + "\"";
+ m_exception = "\"" + m_exception + "\"";
if(is_running_in_test) {
addAssert(m_at);
@@ -4526,7 +4720,7 @@ namespace detail {
std::abort();
}
- void decomp_assert(assertType::Enum at, const char* file, int line, const char* expr,
+ bool decomp_assert(assertType::Enum at, const char* file, int line, const char* expr,
Result result) {
bool failed = !result.m_passed;
@@ -4537,20 +4731,30 @@ namespace detail {
DOCTEST_ASSERT_OUT_OF_TESTS(result.m_decomp);
DOCTEST_ASSERT_IN_TESTS(result.m_decomp);
// NOLINTNEXTLINE(clang-analyzer-cplusplus.NewDeleteLeaks)
+ return !failed;
}
MessageBuilder::MessageBuilder(const char* file, int line, assertType::Enum severity) {
- m_stream = getTlsOss();
+ m_stream = tlssPush();
m_file = file;
m_line = line;
m_severity = severity;
}
+ MessageBuilder::~MessageBuilder() {
+ if (!logged)
+ tlssPop();
+ }
+
IExceptionTranslator::IExceptionTranslator() = default;
IExceptionTranslator::~IExceptionTranslator() = default;
bool MessageBuilder::log() {
- m_string = getTlsOssResult();
+ if (!logged) {
+ m_string = tlssPop();
+ logged = true;
+ }
+
DOCTEST_ITERATE_THROUGH_REPORTERS(log_message, *this);
const bool isWarn = m_severity & assertType::is_warn;
@@ -4569,29 +4773,10 @@ namespace detail {
if(m_severity & assertType::is_require) //!OCLINT bitwise operator in conditional
throwException();
}
-
- MessageBuilder::~MessageBuilder() = default;
} // namespace detail
namespace {
using namespace detail;
- template <typename Ex>
- DOCTEST_NORETURN void throw_exception(Ex const& e) {
-#ifndef DOCTEST_CONFIG_NO_EXCEPTIONS
- throw e;
-#else // DOCTEST_CONFIG_NO_EXCEPTIONS
- std::cerr << "doctest will terminate because it needed to throw an exception.\n"
- << "The message was: " << e.what() << '\n';
- std::terminate();
-#endif // DOCTEST_CONFIG_NO_EXCEPTIONS
- }
-
-#ifndef DOCTEST_INTERNAL_ERROR
-#define DOCTEST_INTERNAL_ERROR(msg) \
- throw_exception(std::logic_error( \
- __FILE__ ":" DOCTEST_TOSTR(__LINE__) ": Internal doctest error: " msg))
-#endif // DOCTEST_INTERNAL_ERROR
-
// clang-format off
// =================================================================================================
@@ -5054,7 +5239,8 @@ namespace {
xml.scopedElement("TestCase").writeAttribute("name", in.data[i]->m_name)
.writeAttribute("testsuite", in.data[i]->m_test_suite)
.writeAttribute("filename", skipPathFromFilename(in.data[i]->m_file.c_str()))
- .writeAttribute("line", line(in.data[i]->m_line));
+ .writeAttribute("line", line(in.data[i]->m_line))
+ .writeAttribute("skipped", in.data[i]->m_skip);
}
xml.scopedElement("OverallResultsTestCases")
.writeAttribute("unskipped", in.run_stats->numTestCasesPassingFilters);
@@ -5124,7 +5310,8 @@ namespace {
xml.startElement("OverallResultsAsserts")
.writeAttribute("successes",
st.numAssertsCurrentTest - st.numAssertsFailedCurrentTest)
- .writeAttribute("failures", st.numAssertsFailedCurrentTest);
+ .writeAttribute("failures", st.numAssertsFailedCurrentTest)
+ .writeAttribute("test_case_success", st.testCaseSuccess);
if(opt.duration)
xml.writeAttribute("duration", st.seconds);
if(tc->m_expected_failures)
@@ -5143,8 +5330,6 @@ namespace {
}
void subcase_start(const SubcaseSignature& in) override {
- std::lock_guard<std::mutex> lock(mutex);
-
xml.startElement("SubCase")
.writeAttribute("name", in.m_name)
.writeAttribute("filename", skipPathFromFilename(in.m_file))
@@ -5440,7 +5625,6 @@ namespace {
}
void subcase_start(const SubcaseSignature& in) override {
- std::lock_guard<std::mutex> lock(mutex);
deepestSubcaseStackNames.push_back(in.m_name);
}
@@ -5606,9 +5790,11 @@ namespace {
}
void printIntro() {
- printVersion();
- s << Color::Cyan << "[doctest] " << Color::None
- << "run with \"--" DOCTEST_OPTIONS_PREFIX_DISPLAY "help\" for options\n";
+ if(opt.no_intro == false) {
+ printVersion();
+ s << Color::Cyan << "[doctest] " << Color::None
+ << "run with \"--" DOCTEST_OPTIONS_PREFIX_DISPLAY "help\" for options\n";
+ }
}
void printHelp() {
@@ -5693,12 +5879,18 @@ namespace {
<< Whitespace(sizePrefixDisplay*1) << "exits after the tests finish\n";
s << " -" DOCTEST_OPTIONS_PREFIX_DISPLAY "d, --" DOCTEST_OPTIONS_PREFIX_DISPLAY "duration=<bool> "
<< Whitespace(sizePrefixDisplay*1) << "prints the time duration of each test\n";
+ s << " -" DOCTEST_OPTIONS_PREFIX_DISPLAY "m, --" DOCTEST_OPTIONS_PREFIX_DISPLAY "minimal=<bool> "
+ << Whitespace(sizePrefixDisplay*1) << "minimal console output (only failures)\n";
+ s << " -" DOCTEST_OPTIONS_PREFIX_DISPLAY "q, --" DOCTEST_OPTIONS_PREFIX_DISPLAY "quiet=<bool> "
+ << Whitespace(sizePrefixDisplay*1) << "no console output\n";
s << " -" DOCTEST_OPTIONS_PREFIX_DISPLAY "nt, --" DOCTEST_OPTIONS_PREFIX_DISPLAY "no-throw=<bool> "
<< Whitespace(sizePrefixDisplay*1) << "skips exceptions-related assert checks\n";
s << " -" DOCTEST_OPTIONS_PREFIX_DISPLAY "ne, --" DOCTEST_OPTIONS_PREFIX_DISPLAY "no-exitcode=<bool> "
<< Whitespace(sizePrefixDisplay*1) << "returns (or exits) always with success\n";
s << " -" DOCTEST_OPTIONS_PREFIX_DISPLAY "nr, --" DOCTEST_OPTIONS_PREFIX_DISPLAY "no-run=<bool> "
<< Whitespace(sizePrefixDisplay*1) << "skips all runtime doctest operations\n";
+ s << " -" DOCTEST_OPTIONS_PREFIX_DISPLAY "ni, --" DOCTEST_OPTIONS_PREFIX_DISPLAY "no-intro=<bool> "
+ << Whitespace(sizePrefixDisplay*1) << "omit the framework intro in the output\n";
s << " -" DOCTEST_OPTIONS_PREFIX_DISPLAY "nv, --" DOCTEST_OPTIONS_PREFIX_DISPLAY "no-version=<bool> "
<< Whitespace(sizePrefixDisplay*1) << "omit the framework version in the output\n";
s << " -" DOCTEST_OPTIONS_PREFIX_DISPLAY "nc, --" DOCTEST_OPTIONS_PREFIX_DISPLAY "no-colors=<bool> "
@@ -5736,22 +5928,6 @@ namespace {
printReporters(getReporters(), "reporters");
}
- void list_query_results() {
- separator_to_stream();
- if(opt.count || opt.list_test_cases) {
- s << Color::Cyan << "[doctest] " << Color::None
- << "unskipped test cases passing the current filters: "
- << g_cs->numTestCasesPassingFilters << "\n";
- } else if(opt.list_test_suites) {
- s << Color::Cyan << "[doctest] " << Color::None
- << "unskipped test cases passing the current filters: "
- << g_cs->numTestCasesPassingFilters << "\n";
- s << Color::Cyan << "[doctest] " << Color::None
- << "test suites with unskipped test cases passing the current filters: "
- << g_cs->numTestSuitesPassingFilters << "\n";
- }
- }
-
// =========================================================================================
// WHAT FOLLOWS ARE OVERRIDES OF THE VIRTUAL METHODS OF THE REPORTER INTERFACE
// =========================================================================================
@@ -5797,9 +5973,15 @@ namespace {
}
}
- void test_run_start() override { printIntro(); }
+ void test_run_start() override {
+ if(!opt.minimal)
+ printIntro();
+ }
void test_run_end(const TestRunStats& p) override {
+ if(opt.minimal && p.numTestCasesFailed == 0)
+ return;
+
separator_to_stream();
s << std::dec;
@@ -5880,6 +6062,7 @@ namespace {
}
void test_case_exception(const TestCaseException& e) override {
+ std::lock_guard<std::mutex> lock(mutex);
if(tc->m_no_output)
return;
@@ -5904,14 +6087,12 @@ namespace {
}
void subcase_start(const SubcaseSignature& subc) override {
- std::lock_guard<std::mutex> lock(mutex);
subcasesStack.push_back(subc);
++currentSubcaseLevel;
hasLoggedCurrentTestStart = false;
}
void subcase_end() override {
- std::lock_guard<std::mutex> lock(mutex);
--currentSubcaseLevel;
hasLoggedCurrentTestStart = false;
}
@@ -6047,18 +6228,42 @@ namespace {
std::vector<String>& res) {
String filtersString;
if(parseOption(argc, argv, pattern, &filtersString)) {
- // tokenize with "," as a separator
- // cppcheck-suppress strtokCalled
- DOCTEST_CLANG_SUPPRESS_WARNING_WITH_PUSH("-Wdeprecated-declarations")
- auto pch = std::strtok(filtersString.c_str(), ","); // modifies the string
- while(pch != nullptr) {
- if(strlen(pch))
- res.push_back(pch);
- // uses the strtok() internal state to go to the next token
- // cppcheck-suppress strtokCalled
- pch = std::strtok(nullptr, ",");
+ // tokenize with "," as a separator, unless escaped with backslash
+ std::ostringstream s;
+ auto flush = [&s, &res]() {
+ auto string = s.str();
+ if(string.size() > 0) {
+ res.push_back(string.c_str());
+ }
+ s.str("");
+ };
+
+ bool seenBackslash = false;
+ const char* current = filtersString.c_str();
+ const char* end = current + strlen(current);
+ while(current != end) {
+ char character = *current++;
+ if(seenBackslash) {
+ seenBackslash = false;
+ if(character == ',') {
+ s.put(',');
+ continue;
+ }
+ s.put('\\');
+ }
+ if(character == '\\') {
+ seenBackslash = true;
+ } else if(character == ',') {
+ flush();
+ } else {
+ s.put(character);
+ }
+ }
+
+ if(seenBackslash) {
+ s.put('\\');
}
- DOCTEST_CLANG_SUPPRESS_WARNING_POP
+ flush();
return true;
}
return false;
@@ -6191,9 +6396,12 @@ void Context::parseArgs(int argc, const char* const* argv, bool withDefaults) {
DOCTEST_PARSE_AS_BOOL_OR_FLAG("case-sensitive", "cs", case_sensitive, false);
DOCTEST_PARSE_AS_BOOL_OR_FLAG("exit", "e", exit, false);
DOCTEST_PARSE_AS_BOOL_OR_FLAG("duration", "d", duration, false);
+ DOCTEST_PARSE_AS_BOOL_OR_FLAG("minimal", "m", minimal, false);
+ DOCTEST_PARSE_AS_BOOL_OR_FLAG("quiet", "q", quiet, false);
DOCTEST_PARSE_AS_BOOL_OR_FLAG("no-throw", "nt", no_throw, false);
DOCTEST_PARSE_AS_BOOL_OR_FLAG("no-exitcode", "ne", no_exitcode, false);
DOCTEST_PARSE_AS_BOOL_OR_FLAG("no-run", "nr", no_run, false);
+ DOCTEST_PARSE_AS_BOOL_OR_FLAG("no-intro", "ni", no_intro, false);
DOCTEST_PARSE_AS_BOOL_OR_FLAG("no-version", "nv", no_version, false);
DOCTEST_PARSE_AS_BOOL_OR_FLAG("no-colors", "nc", no_colors, false);
DOCTEST_PARSE_AS_BOOL_OR_FLAG("force-colors", "fc", force_colors, false);
@@ -6257,7 +6465,12 @@ void Context::clearFilters() {
curr.clear();
}
-// allows the user to override procedurally the int/bool options from the command line
+// allows the user to override procedurally the bool options from the command line
+void Context::setOption(const char* option, bool value) {
+ setOption(option, value ? "true" : "false");
+}
+
+// allows the user to override procedurally the int options from the command line
void Context::setOption(const char* option, int value) {
setOption(option, toString(value).c_str());
// NOLINTNEXTLINE(clang-analyzer-cplusplus.NewDeleteLeaks)
@@ -6277,6 +6490,31 @@ void Context::setAsDefaultForAssertsOutOfTestCases() { g_cs = p; }
void Context::setAssertHandler(detail::assert_handler ah) { p->ah = ah; }
+void Context::setCout(std::ostream* out) { p->cout = out; }
+
+static class DiscardOStream : public std::ostream
+{
+private:
+ class : public std::streambuf
+ {
+ private:
+ // allowing some buffering decreases the amount of calls to overflow
+ char buf[1024];
+
+ protected:
+ std::streamsize xsputn(const char_type*, std::streamsize count) override { return count; }
+
+ int_type overflow(int_type ch) override {
+ setp(std::begin(buf), std::end(buf));
+ return traits_type::not_eof(ch);
+ }
+ } discardBuf;
+
+public:
+ DiscardOStream()
+ : std::ostream(&discardBuf) {}
+} discardOut;
+
// the main function that does all the filtering and test running
int Context::run() {
using namespace detail;
@@ -6290,15 +6528,18 @@ int Context::run() {
g_no_colors = p->no_colors;
p->resetRunData();
- // stdout by default
- p->cout = &std::cout;
- p->cerr = &std::cerr;
-
- // or to a file if specified
std::fstream fstr;
- if(p->out.size()) {
- fstr.open(p->out.c_str(), std::fstream::out);
- p->cout = &fstr;
+ if(p->cout == nullptr) {
+ if(p->quiet) {
+ p->cout = &discardOut;
+ } else if(p->out.size()) {
+ // to a file if specified
+ fstr.open(p->out.c_str(), std::fstream::out);
+ p->cout = &fstr;
+ } else {
+ // stdout by default
+ p->cout = &std::cout;
+ }
}
FatalConditionHandler::allocateAltStackMem();
@@ -6531,13 +6772,6 @@ DOCTEST_MSVC_SUPPRESS_WARNING_POP
DOCTEST_ITERATE_THROUGH_REPORTERS(report_query, qdata);
}
- // see these issues on the reasoning for this:
- // - https://github.com/onqtam/doctest/issues/143#issuecomment-414418903
- // - https://github.com/onqtam/doctest/issues/126
- auto DOCTEST_FIX_FOR_MACOS_LIBCPP_IOSFWD_STRING_LINK_ERRORS = []() DOCTEST_NOINLINE
- { std::cout << std::string(); };
- DOCTEST_FIX_FOR_MACOS_LIBCPP_IOSFWD_STRING_LINK_ERRORS();
-
return cleanup_and_return();
}
@@ -6576,5 +6810,7 @@ DOCTEST_CLANG_SUPPRESS_WARNING_POP
DOCTEST_MSVC_SUPPRESS_WARNING_POP
DOCTEST_GCC_SUPPRESS_WARNING_POP
+DOCTEST_SUPPRESS_COMMON_WARNINGS_POP
+
#endif // DOCTEST_LIBRARY_IMPLEMENTATION
#endif // DOCTEST_CONFIG_IMPLEMENT
diff --git a/thirdparty/freetype/src/autofit/afblue.dat b/thirdparty/freetype/src/autofit/afblue.dat
deleted file mode 100644
index 201acc4f6f..0000000000
--- a/thirdparty/freetype/src/autofit/afblue.dat
+++ /dev/null
@@ -1,1121 +0,0 @@
-// afblue.dat
-//
-// Auto-fitter data for blue strings.
-//
-// Copyright (C) 2013-2022 by
-// David Turner, Robert Wilhelm, and Werner Lemberg.
-//
-// This file is part of the FreeType project, and may only be used,
-// modified, and distributed under the terms of the FreeType project
-// license, LICENSE.TXT. By continuing to use, modify, or distribute
-// this file you indicate that you have read the license and
-// understand and accept it fully.
-
-
-// This file contains data specific to blue zones. It gets processed by
-// a script to simulate `jagged arrays', with enumeration values holding
-// offsets into the arrays.
-//
-// The format of the file is rather simple: A section starts with three
-// labels separated by whitespace and followed by a colon (everything in a
-// single line); the first label gives the name of the enumeration template,
-// the second the name of the array template, and the third the name of the
-// `maximum' template. The script then fills the corresponding templates
-// (indicated by `@' characters around the name).
-//
-// A section contains one or more data records. Each data record consists
-// of two or more lines. The first line holds the enumeration name, and the
-// remaining lines the corresponding array data.
-//
-// There are two possible representations for array data.
-//
-// - A string of characters or character clusters (for example, representing
-// Aksharas, Devanagari syllables) in UTF-8 encoding enclosed in double
-// quotes, using C syntax, where the elements are separated by spaces.
-// There can be only one string per line, thus the starting and ending
-// double quote must be the first and last character in the line,
-// respectively, ignoring whitespace before and after the string. If
-// there are multiple strings (in multiple lines), they are concatenated
-// to a single string. In the output, a string gets represented as a
-// series of singles bytes, followed by a zero byte. The enumeration
-// values simply hold byte offsets to the start of the corresponding
-// strings.
-//
-// For strings, the `maximum' template holds the maximum number of
-// non-space characters in all strings.
-//
-// - Data blocks enclosed in balanced braces, which get copied verbatim and
-// which can span multiple lines. The opening brace of a block must be
-// the first character of a line (ignoring whitespace), and the closing
-// brace the last (ignoring whitespace also). The script appends a comma
-// character after each block and counts the number of blocks to set the
-// enumeration values.
-//
-// For data blocks, the `maximum' template holds the maximum number of
-// array elements.
-//
-// A section can contain either strings only or data blocks only.
-//
-// A comment line starts with `//'; it gets removed. A preprocessor
-// directive line (using the standard syntax of `cpp') starts with `#' and
-// gets copied verbatim to both the enumeration and the array. Whitespace
-// outside of a string is insignificant.
-//
-// Preprocessor directives are ignored while the script computes maximum
-// values; this essentially means that the maximum values can easily be too
-// large. Given that the purpose of those values is to create local
-// fixed-size arrays at compile time for further processing of the blue zone
-// data, this isn't a problem. Note the final zero byte of a string is not
-// counted. Note also that the count holds the number of UTF-8 encoded
-// characters, not bytes.
-
-
-// The blue zone string data, to be used in the blue stringsets below.
-
-AF_BLUE_STRING_ENUM AF_BLUE_STRINGS_ARRAY AF_BLUE_STRING_MAX_LEN:
-
- AF_BLUE_STRING_ADLAM_CAPITAL_TOP
- "𞤌 𞤅 𞤈 𞤏 𞤔 𞤚"
- AF_BLUE_STRING_ADLAM_CAPITAL_BOTTOM
- "𞤂 𞤖"
- AF_BLUE_STRING_ADLAM_SMALL_TOP
- "𞤬 𞤮 𞤻 𞤼 𞤾"
- AF_BLUE_STRING_ADLAM_SMALL_BOTTOM
- "𞤤 𞤨 𞤩 𞤭 𞤴 𞤸 𞤺 𞥀"
-
- AF_BLUE_STRING_ARABIC_TOP
- "ا إ ل ك ط ظ"
- AF_BLUE_STRING_ARABIC_BOTTOM
- "ت ث ط ظ ك"
- // We don't necessarily have access to medial forms via Unicode in case
- // Arabic presentational forms are missing. The only character that is
- // guaranteed to have the same vertical position with joining (this is,
- // non-isolated) forms is U+0640, ARABIC TATWEEL, which must join both
- // round and flat curves.
- AF_BLUE_STRING_ARABIC_JOIN
- "ـ"
-
- AF_BLUE_STRING_ARMENIAN_CAPITAL_TOP
- "Ա Մ Ւ Ս Բ Գ Դ Օ"
- AF_BLUE_STRING_ARMENIAN_CAPITAL_BOTTOM
- "Ւ Ո Դ Ճ Շ Ս Տ Օ"
- AF_BLUE_STRING_ARMENIAN_SMALL_ASCENDER
- "ե է ի մ վ ֆ ճ"
- AF_BLUE_STRING_ARMENIAN_SMALL_TOP
- "ա յ ւ ս գ շ ր օ"
- AF_BLUE_STRING_ARMENIAN_SMALL_BOTTOM
- "հ ո ճ ա ե ծ ս օ"
- AF_BLUE_STRING_ARMENIAN_SMALL_DESCENDER
- "բ ը ի լ ղ պ փ ց"
-
- AF_BLUE_STRING_AVESTAN_TOP
- "𐬀 𐬁 𐬐 𐬛"
- AF_BLUE_STRING_AVESTAN_BOTTOM
- "𐬀 𐬁"
-
- AF_BLUE_STRING_BAMUM_TOP
- "ꚧ ꚨ ꛛ ꛉ ꛁ ꛈ ꛫ ꛯ"
- AF_BLUE_STRING_BAMUM_BOTTOM
- "ꚭ ꚳ ꚶ ꛬ ꚢ ꚽ ꛯ ꛲"
-
- AF_BLUE_STRING_BENGALI_BASE
- "অ ড ত ন ব ভ ল ক"
- AF_BLUE_STRING_BENGALI_TOP
- "ই ট ঠ ি ী ৈ ৗ"
- AF_BLUE_STRING_BENGALI_HEAD
- "ও এ ড ত ন ব ল ক"
-
- AF_BLUE_STRING_BUHID_TOP
- "ᝐ ᝈ"
- AF_BLUE_STRING_BUHID_LARGE
- "ᝅ ᝊ ᝎ"
- AF_BLUE_STRING_BUHID_SMALL
- "ᝂ ᝃ ᝉ ᝌ"
- AF_BLUE_STRING_BUHID_BOTTOM
- "ᝀ ᝃ ᝆ ᝉ ᝋ ᝏ ᝑ"
-
- AF_BLUE_STRING_CANADIAN_SYLLABICS_TOP
- "ᗜ ᖴ ᐁ ᒣ ᑫ ᑎ ᔑ ᗰ"
- AF_BLUE_STRING_CANADIAN_SYLLABICS_BOTTOM
- "ᗶ ᖵ ᒧ ᐃ ᑌ ᒍ ᔑ ᗢ"
- AF_BLUE_STRING_CANADIAN_SYLLABICS_SMALL_TOP
- "ᓓ ᓕ ᓀ ᓂ ᓄ ᕄ ᕆ ᘣ"
- AF_BLUE_STRING_CANADIAN_SYLLABICS_SMALL_BOTTOM
- "ᕃ ᓂ ᓀ ᕂ ᓗ ᓚ ᕆ ᘣ"
- AF_BLUE_STRING_CANADIAN_SYLLABICS_SUPS_TOP
- "ᐪ ᙆ ᣘ ᐢ ᒾ ᣗ ᔆ"
- AF_BLUE_STRING_CANADIAN_SYLLABICS_SUPS_BOTTOM
- "ᙆ ᗮ ᒻ ᐞ ᔆ ᒡ ᒢ ᓑ"
-
- AF_BLUE_STRING_CARIAN_TOP
- "𐊧 𐊫 𐊬 𐊭 𐊱 𐊺 𐊼 𐊿"
- AF_BLUE_STRING_CARIAN_BOTTOM
- "𐊣 𐊧 𐊷 𐋀 𐊫 𐊸 𐋉"
-
- AF_BLUE_STRING_CHAKMA_TOP
- "𑄃 𑄅 𑄉 𑄙 𑄗"
- AF_BLUE_STRING_CHAKMA_BOTTOM
- "𑄅 𑄛 𑄝 𑄗 𑄓"
- AF_BLUE_STRING_CHAKMA_DESCENDER
- "𑄖𑄳𑄢 𑄘𑄳𑄢 𑄙𑄳𑄢 𑄤𑄳𑄢 𑄥𑄳𑄢"
-
- AF_BLUE_STRING_CHEROKEE_CAPITAL
- "Ꮖ Ꮋ Ꭼ Ꮓ Ꭴ Ꮳ Ꭶ Ꮥ"
- AF_BLUE_STRING_CHEROKEE_SMALL_ASCENDER
- "ꮒ ꮤ ꮶ ꭴ ꭾ ꮗ ꮝ ꮿ"
- AF_BLUE_STRING_CHEROKEE_SMALL
- "ꮖ ꭼ ꮓ ꮠ ꮳ ꭶ ꮥ ꮻ"
- AF_BLUE_STRING_CHEROKEE_SMALL_DESCENDER
- "ᏸ ꮐ ꭹ ꭻ"
-
- AF_BLUE_STRING_COPTIC_CAPITAL_TOP
- "Ⲍ Ⲏ Ⲡ Ⳟ Ⲟ Ⲑ Ⲥ Ⳋ"
- AF_BLUE_STRING_COPTIC_CAPITAL_BOTTOM
- "Ⳑ Ⳙ Ⳟ Ⲏ Ⲟ Ⲑ Ⳝ Ⲱ"
- AF_BLUE_STRING_COPTIC_SMALL_TOP
- "ⲍ ⲏ ⲡ ⳟ ⲟ ⲑ ⲥ ⳋ"
- AF_BLUE_STRING_COPTIC_SMALL_BOTTOM
- "ⳑ ⳙ ⳟ ⲏ ⲟ ⲑ ⳝ Ⳓ"
-
- AF_BLUE_STRING_CYPRIOT_TOP
- "𐠍 𐠙 𐠳 𐠱 𐠅 𐠓 𐠣 𐠦"
- AF_BLUE_STRING_CYPRIOT_BOTTOM
- "𐠃 𐠊 𐠛 𐠣 𐠳 𐠵 𐠐"
- AF_BLUE_STRING_CYPRIOT_SMALL
- "𐠈 𐠏 𐠖"
-
- AF_BLUE_STRING_CYRILLIC_CAPITAL_TOP
- "Б В Е П З О С Э"
- AF_BLUE_STRING_CYRILLIC_CAPITAL_BOTTOM
- "Б В Е Ш З О С Э"
- AF_BLUE_STRING_CYRILLIC_SMALL
- "х п н ш е з о с"
- AF_BLUE_STRING_CYRILLIC_SMALL_DESCENDER
- "р у ф"
-
- AF_BLUE_STRING_DESERET_CAPITAL_TOP
- "𐐂 𐐄 𐐋 𐐗 𐐑"
- AF_BLUE_STRING_DESERET_CAPITAL_BOTTOM
- "𐐀 𐐂 𐐄 𐐗 𐐛"
- AF_BLUE_STRING_DESERET_SMALL_TOP
- "𐐪 𐐬 𐐳 𐐿 𐐹"
- AF_BLUE_STRING_DESERET_SMALL_BOTTOM
- "𐐨 𐐪 𐐬 𐐿 𐑃"
-
- AF_BLUE_STRING_DEVANAGARI_BASE
- "क न म उ छ ट ठ ड"
- AF_BLUE_STRING_DEVANAGARI_TOP
- "ई ऐ ओ औ ि ी ो ौ"
- // note that some fonts have extreme variation in the height of the
- // round head elements; for this reason we also define the `base'
- // blue zone, which must be always present
- AF_BLUE_STRING_DEVANAGARI_HEAD
- "क म अ आ थ ध भ श"
- AF_BLUE_STRING_DEVANAGARI_BOTTOM
- "ु ृ"
-
- AF_BLUE_STRING_ETHIOPIC_TOP
- "ሀ ሃ ዘ ፐ ማ በ ዋ ዐ"
- AF_BLUE_STRING_ETHIOPIC_BOTTOM
- "ለ ሐ በ ዘ ሀ ሪ ዐ ጨ"
-
- AF_BLUE_STRING_GEORGIAN_MKHEDRULI_TOP
- "გ დ ე ვ თ ი ო ღ"
- AF_BLUE_STRING_GEORGIAN_MKHEDRULI_BOTTOM
- "ა ზ მ ს შ ძ ხ პ"
- AF_BLUE_STRING_GEORGIAN_MKHEDRULI_ASCENDER
- "ს ხ ქ ზ მ შ ჩ წ"
- AF_BLUE_STRING_GEORGIAN_MKHEDRULI_DESCENDER
- "ე ვ ჟ ტ უ ფ ქ ყ"
-
- AF_BLUE_STRING_GEORGIAN_ASOMTAVRULI_TOP
- "Ⴑ Ⴇ Ⴙ Ⴜ Ⴄ Ⴅ Ⴓ Ⴚ"
- AF_BLUE_STRING_GEORGIAN_ASOMTAVRULI_BOTTOM
- "Ⴄ Ⴅ Ⴇ Ⴈ Ⴆ Ⴑ Ⴊ Ⴋ"
-
- AF_BLUE_STRING_GEORGIAN_NUSKHURI_TOP
- "ⴁ ⴗ ⴂ ⴄ ⴅ ⴇ ⴔ ⴖ"
- AF_BLUE_STRING_GEORGIAN_NUSKHURI_BOTTOM
- "ⴈ ⴌ ⴖ ⴎ ⴃ ⴆ ⴋ ⴢ"
- AF_BLUE_STRING_GEORGIAN_NUSKHURI_ASCENDER
- "ⴐ ⴑ ⴓ ⴕ ⴙ ⴛ ⴡ ⴣ"
- AF_BLUE_STRING_GEORGIAN_NUSKHURI_DESCENDER
- "ⴄ ⴅ ⴔ ⴕ ⴁ ⴂ ⴘ ⴝ"
-
- AF_BLUE_STRING_GEORGIAN_MTAVRULI_TOP
- "Ნ Ჟ Ჳ Ჸ Გ Ე Ო Ჴ"
- AF_BLUE_STRING_GEORGIAN_MTAVRULI_BOTTOM
- "Ი Ჲ Ო Ჩ Მ Შ Ჯ Ჽ"
-
- AF_BLUE_STRING_GLAGOLITIC_CAPITAL_TOP
- "Ⰵ Ⱄ Ⱚ Ⰴ Ⰲ Ⰺ Ⱛ Ⰻ"
- AF_BLUE_STRING_GLAGOLITIC_CAPITAL_BOTTOM
- "Ⰵ Ⰴ Ⰲ Ⱚ Ⱎ Ⱑ Ⰺ Ⱄ"
- AF_BLUE_STRING_GLAGOLITIC_SMALL_TOP
- "ⰵ ⱄ ⱚ ⰴ ⰲ ⰺ ⱛ ⰻ"
- AF_BLUE_STRING_GLAGOLITIC_SMALL_BOTTOM
- "ⰵ ⰴ ⰲ ⱚ ⱎ ⱑ ⰺ ⱄ"
-
- AF_BLUE_STRING_GOTHIC_TOP
- "𐌲 𐌶 𐍀 𐍄 𐌴 𐍃 𐍈 𐌾"
- AF_BLUE_STRING_GOTHIC_BOTTOM
- "𐌶 𐌴 𐍃 𐍈"
-
- AF_BLUE_STRING_GREEK_CAPITAL_TOP
- "Γ Β Ε Ζ Θ Ο Ω"
- AF_BLUE_STRING_GREEK_CAPITAL_BOTTOM
- "Β Δ Ζ Ξ Θ Ο"
- AF_BLUE_STRING_GREEK_SMALL_BETA_TOP
- "β θ δ ζ λ ξ"
- AF_BLUE_STRING_GREEK_SMALL
- "α ε ι ο π σ τ ω"
- AF_BLUE_STRING_GREEK_SMALL_DESCENDER
- "β γ η μ ρ φ χ ψ"
-
- AF_BLUE_STRING_GUJARATI_TOP
- "ત ન ઋ ઌ છ ટ ર ૦"
- AF_BLUE_STRING_GUJARATI_BOTTOM
- "ખ ગ ઘ ઞ ઇ ઈ ઠ જ"
- AF_BLUE_STRING_GUJARATI_ASCENDER
- "ઈ ઊ િ ી લી શ્ચિ જિ સી"
- AF_BLUE_STRING_GUJARATI_DESCENDER
- "ુ ૃ ૄ ખુ છૃ છૄ"
- AF_BLUE_STRING_GUJARATI_DIGIT_TOP
- "૦ ૧ ૨ ૩ ૭"
-
- AF_BLUE_STRING_GURMUKHI_BASE
- "ਕ ਗ ਙ ਚ ਜ ਤ ਧ ਸ"
- AF_BLUE_STRING_GURMUKHI_HEAD
- "ਕ ਗ ਙ ਚ ਜ ਤ ਧ ਸ"
- AF_BLUE_STRING_GURMUKHI_TOP
- "ਇ ਈ ਉ ਏ ਓ ੳ ਿ ੀ"
- AF_BLUE_STRING_GURMUKHI_BOTTOM
- "ਅ ਏ ਓ ਗ ਜ ਠ ਰ ਸ"
- AF_BLUE_STRING_GURMUKHI_DIGIT_TOP
- "੦ ੧ ੨ ੩ ੭"
-
- AF_BLUE_STRING_HEBREW_TOP
- "ב ד ה ח ך כ ם ס"
- AF_BLUE_STRING_HEBREW_BOTTOM
- "ב ט כ ם ס צ"
- AF_BLUE_STRING_HEBREW_DESCENDER
- "ק ך ן ף ץ"
-
- AF_BLUE_STRING_KANNADA_TOP
- "ಇ ಊ ಐ ಣ ಸಾ ನಾ ದಾ ರಾ"
- AF_BLUE_STRING_KANNADA_BOTTOM
- "ಅ ಉ ಎ ಲ ೦ ೨ ೬ ೭"
-
- AF_BLUE_STRING_KAYAH_LI_TOP
- "꤅ ꤏ ꤁ ꤋ ꤀ ꤍ"
- AF_BLUE_STRING_KAYAH_LI_BOTTOM
- "꤈ ꤘ ꤀ ꤍ ꤢ"
- AF_BLUE_STRING_KAYAH_LI_ASCENDER
- "ꤖ ꤡ"
- AF_BLUE_STRING_KAYAH_LI_DESCENDER
- "ꤑ ꤜ ꤞ"
- AF_BLUE_STRING_KAYAH_LI_LARGE_DESCENDER
- "ꤑ꤬ ꤜ꤭ ꤔ꤬"
-
- AF_BLUE_STRING_KHMER_TOP
- "ខ ទ ន ឧ ឩ ា"
- AF_BLUE_STRING_KHMER_SUBSCRIPT_TOP
- "ក្ក ក្ខ ក្គ ក្ថ"
- AF_BLUE_STRING_KHMER_BOTTOM
- "ខ ឃ ច ឋ ប ម យ ឲ"
- AF_BLUE_STRING_KHMER_DESCENDER
- "ត្រ រៀ ឲ្យ អឿ"
- AF_BLUE_STRING_KHMER_LARGE_DESCENDER
- "ន្ត្រៃ ង្ខ្យ ក្បៀ ច្រៀ ន្តឿ ល្បឿ"
-
- AF_BLUE_STRING_KHMER_SYMBOLS_WAXING_TOP
- "᧠ ᧡"
- AF_BLUE_STRING_KHMER_SYMBOLS_WANING_BOTTOM
- "᧶ ᧹"
-
- AF_BLUE_STRING_LAO_TOP
- "າ ດ ອ ມ ລ ວ ຣ ງ"
- AF_BLUE_STRING_LAO_BOTTOM
- "າ ອ ບ ຍ ຣ ຮ ວ ຢ"
- AF_BLUE_STRING_LAO_ASCENDER
- "ປ ຢ ຟ ຝ"
- AF_BLUE_STRING_LAO_LARGE_ASCENDER
- "ໂ ໄ ໃ"
- AF_BLUE_STRING_LAO_DESCENDER
- "ງ ຊ ຖ ຽ ໆ ຯ"
-
- AF_BLUE_STRING_LATIN_CAPITAL_TOP
- "T H E Z O C Q S"
- AF_BLUE_STRING_LATIN_CAPITAL_BOTTOM
- "H E Z L O C U S"
- AF_BLUE_STRING_LATIN_SMALL_F_TOP
- "f i j k d b h"
- AF_BLUE_STRING_LATIN_SMALL_TOP
- "u v x z o e s c"
- AF_BLUE_STRING_LATIN_SMALL_BOTTOM
- "n r x z o e s c"
- AF_BLUE_STRING_LATIN_SMALL_DESCENDER
- "p q g j y"
-
- // we assume that both the subscript and superscript ranges
- // don't contain oldstyle digits (actually, most fonts probably
- // have digits only in those ranges)
- AF_BLUE_STRING_LATIN_SUBS_CAPITAL_TOP
- "₀ ₃ ₅ ₇ ₈"
- AF_BLUE_STRING_LATIN_SUBS_CAPITAL_BOTTOM
- "₀ ₁ ₂ ₃ ₈"
- AF_BLUE_STRING_LATIN_SUBS_SMALL_F_TOP
- "ᵢ ⱼ ₕ ₖ ₗ"
- AF_BLUE_STRING_LATIN_SUBS_SMALL
- "ₐ ₑ ₒ ₓ ₙ ₛ ᵥ ᵤ ᵣ"
- AF_BLUE_STRING_LATIN_SUBS_SMALL_DESCENDER
- "ᵦ ᵧ ᵨ ᵩ ₚ"
-
- AF_BLUE_STRING_LATIN_SUPS_CAPITAL_TOP
- "⁰ ³ ⁵ ⁷ ᵀ ᴴ ᴱ ᴼ"
- AF_BLUE_STRING_LATIN_SUPS_CAPITAL_BOTTOM
- "⁰ ¹ ² ³ ᴱ ᴸ ᴼ ᵁ"
- AF_BLUE_STRING_LATIN_SUPS_SMALL_F_TOP
- "ᵇ ᵈ ᵏ ʰ ʲ ᶠ ⁱ"
- AF_BLUE_STRING_LATIN_SUPS_SMALL
- "ᵉ ᵒ ʳ ˢ ˣ ᶜ ᶻ"
- AF_BLUE_STRING_LATIN_SUPS_SMALL_DESCENDER
- "ᵖ ʸ ᵍ"
-
- AF_BLUE_STRING_LISU_TOP
- "ꓡ ꓧ ꓱ ꓶ ꓩ ꓚ ꓵ ꓳ"
- AF_BLUE_STRING_LISU_BOTTOM
- "ꓕ ꓜ ꓞ ꓡ ꓛ ꓢ ꓳ ꓴ"
-
- AF_BLUE_STRING_MALAYALAM_TOP
- "ഒ ട ഠ റ ച പ ച്ച പ്പ"
- AF_BLUE_STRING_MALAYALAM_BOTTOM
- "ട ഠ ധ ശ ഘ ച ഥ ല"
-
- AF_BLUE_STRING_MEDEFAIDRIN_CAPITAL_TOP
- "𖹀 𖹁 𖹂 𖹃 𖹏 𖹚 𖹟"
- AF_BLUE_STRING_MEDEFAIDRIN_CAPITAL_BOTTOM
- "𖹀 𖹁 𖹂 𖹃 𖹏 𖹚 𖹒 𖹓"
- AF_BLUE_STRING_MEDEFAIDRIN_SMALL_F_TOP
- "𖹤 𖹬 𖹧 𖹴 𖹶 𖹾"
- AF_BLUE_STRING_MEDEFAIDRIN_SMALL_TOP
- "𖹠 𖹡 𖹢 𖹹 𖹳 𖹮"
- AF_BLUE_STRING_MEDEFAIDRIN_SMALL_BOTTOM
- "𖹠 𖹡 𖹢 𖹳 𖹭 𖹽"
- AF_BLUE_STRING_MEDEFAIDRIN_SMALL_DESCENDER
- "𖹥 𖹨 𖹩"
- AF_BLUE_STRING_MEDEFAIDRIN_DIGIT_TOP
- "𖺀 𖺅 𖺈 𖺄 𖺍"
-
- AF_BLUE_STRING_MONGOLIAN_TOP_BASE
- "ᠳ ᠴ ᠶ ᠽ ᡂ ᡊ ‍ᡡ‍ ‍ᡳ‍"
- AF_BLUE_STRING_MONGOLIAN_BOTTOM_BASE
- "ᡃ"
-
- AF_BLUE_STRING_MYANMAR_TOP
- "ခ ဂ င ဒ ဝ ၥ ၊ ။"
- AF_BLUE_STRING_MYANMAR_BOTTOM
- "င ဎ ဒ ပ ဗ ဝ ၊ ။"
- AF_BLUE_STRING_MYANMAR_ASCENDER
- "ဩ ြ ၍ ၏ ၆ ါ ိ"
- AF_BLUE_STRING_MYANMAR_DESCENDER
- "ဉ ည ဥ ဩ ဨ ၂ ၅ ၉"
-
- AF_BLUE_STRING_NKO_TOP
- "ߐ ߉ ߒ ߟ ߖ ߜ ߠ ߥ"
- AF_BLUE_STRING_NKO_BOTTOM
- "߀ ߘ ߡ ߠ ߥ"
- AF_BLUE_STRING_NKO_SMALL_TOP
- "ߏ ߛ ߋ"
- AF_BLUE_STRING_NKO_SMALL_BOTTOM
- "ߎ ߏ ߛ ߋ"
-
- AF_BLUE_STRING_OL_CHIKI
- "ᱛ ᱜ ᱝ ᱡ ᱢ ᱥ"
-
- AF_BLUE_STRING_OLD_TURKIC_TOP
- "𐰗 𐰘 𐰧"
- AF_BLUE_STRING_OLD_TURKIC_BOTTOM
- "𐰉 𐰗 𐰦 𐰧"
-
- AF_BLUE_STRING_OSAGE_CAPITAL_TOP
- "𐒾 𐓍 𐓒 𐓓 𐒻 𐓂 𐒵 𐓆"
- AF_BLUE_STRING_OSAGE_CAPITAL_BOTTOM
- "𐒰 𐓍 𐓂 𐒿 𐓎 𐒹"
- AF_BLUE_STRING_OSAGE_CAPITAL_DESCENDER
- "𐒼 𐒽 𐒾"
- AF_BLUE_STRING_OSAGE_SMALL_TOP
- "𐓵 𐓶 𐓺 𐓻 𐓝 𐓣 𐓪 𐓮"
- AF_BLUE_STRING_OSAGE_SMALL_BOTTOM
- "𐓘 𐓚 𐓣 𐓵 𐓡 𐓧 𐓪 𐓶"
- AF_BLUE_STRING_OSAGE_SMALL_ASCENDER
- "𐓤 𐓦 𐓸 𐓹 𐓛"
- AF_BLUE_STRING_OSAGE_SMALL_DESCENDER
- "𐓤 𐓥 𐓦"
-
- AF_BLUE_STRING_OSMANYA_TOP
- "𐒆 𐒉 𐒐 𐒒 𐒘 𐒛 𐒠 𐒣"
- AF_BLUE_STRING_OSMANYA_BOTTOM
- "𐒀 𐒂 𐒆 𐒈 𐒊 𐒒 𐒠 𐒩"
-
- AF_BLUE_STRING_ROHINGYA_TOP
- "𐴃 𐴀 𐴆 𐴖 𐴕"
- AF_BLUE_STRING_ROHINGYA_BOTTOM
- "𐴔 𐴖 𐴕 𐴑 𐴐"
- AF_BLUE_STRING_ROHINGYA_JOIN
- "ـ"
-
- AF_BLUE_STRING_SAURASHTRA_TOP
- "ꢜ ꢞ ꢳ ꢂ ꢖ ꢒ ꢝ ꢛ"
- AF_BLUE_STRING_SAURASHTRA_BOTTOM
- "ꢂ ꢨ ꢺ ꢤ ꢎ"
-
- AF_BLUE_STRING_SHAVIAN_TOP
- "𐑕 𐑙"
- AF_BLUE_STRING_SHAVIAN_BOTTOM
- "𐑔 𐑖 𐑗 𐑹 𐑻"
- AF_BLUE_STRING_SHAVIAN_DESCENDER
- "𐑟 𐑣"
- AF_BLUE_STRING_SHAVIAN_SMALL_TOP
- "𐑱 𐑲 𐑳 𐑴 𐑸 𐑺 𐑼"
- AF_BLUE_STRING_SHAVIAN_SMALL_BOTTOM
- "𐑴 𐑻 𐑹"
-
- AF_BLUE_STRING_SINHALA_TOP
- "ඉ ක ඝ ඳ ප ය ල ෆ"
- AF_BLUE_STRING_SINHALA_BOTTOM
- "එ ඔ ඝ ජ ට ථ ධ ර"
- AF_BLUE_STRING_SINHALA_DESCENDER
- "ද ඳ උ ල තූ තු බු දු"
-
- AF_BLUE_STRING_SUNDANESE_TOP
- "ᮋ ᮞ ᮮ ᮽ ᮰ ᮈ"
- AF_BLUE_STRING_SUNDANESE_BOTTOM
- "ᮄ ᮔ ᮕ ᮗ ᮰ ᮆ ᮈ ᮉ"
- AF_BLUE_STRING_SUNDANESE_DESCENDER
- "ᮼ ᳄"
-
- AF_BLUE_STRING_TAI_VIET_TOP
- "ꪆ ꪔ ꪒ ꪖ ꪫ"
- AF_BLUE_STRING_TAI_VIET_BOTTOM
- "ꪉ ꪫ ꪮ"
-
- AF_BLUE_STRING_TAMIL_TOP
- "உ ஒ ஓ ற ஈ க ங ச"
- AF_BLUE_STRING_TAMIL_BOTTOM
- "க ச ல ஶ உ ங ட ப"
-
- AF_BLUE_STRING_TELUGU_TOP
- "ఇ ఌ ఙ ఞ ణ ఱ ౯"
- AF_BLUE_STRING_TELUGU_BOTTOM
- "అ క చ ర ఽ ౨ ౬"
-
- AF_BLUE_STRING_THAI_TOP
- "บ เ แ อ ก า"
- AF_BLUE_STRING_THAI_BOTTOM
- "บ ป ษ ฯ อ ย ฮ"
- AF_BLUE_STRING_THAI_ASCENDER
- "ป ฝ ฟ"
- AF_BLUE_STRING_THAI_LARGE_ASCENDER
- "โ ใ ไ"
- AF_BLUE_STRING_THAI_DESCENDER
- "ฎ ฏ ฤ ฦ"
- AF_BLUE_STRING_THAI_LARGE_DESCENDER
- "ญ ฐ"
- AF_BLUE_STRING_THAI_DIGIT_TOP
- "๐ ๑ ๓"
-
- AF_BLUE_STRING_TIFINAGH
- "ⵔ ⵙ ⵛ ⵞ ⴵ ⴼ ⴹ ⵎ"
-
- AF_BLUE_STRING_VAI_TOP
- "ꗍ ꘖ ꘙ ꘜ ꖜ ꖝ ꔅ ꕢ"
- AF_BLUE_STRING_VAI_BOTTOM
- "ꗍ ꘖ ꘙ ꗞ ꔅ ꕢ ꖜ ꔆ"
-
-
-#ifdef AF_CONFIG_OPTION_CJK
-
- AF_BLUE_STRING_CJK_TOP
- "他 们 你 來 們 到 和 地"
- " 对 對 就 席 我 时 時 會"
- " 来 為 能 舰 說 说 这 這"
- " 齊 |"
- " 军 同 已 愿 既 星 是 景"
- " 民 照 现 現 理 用 置 要"
- " 軍 那 配 里 開 雷 露 面"
- " 顾"
- AF_BLUE_STRING_CJK_BOTTOM
- "个 为 人 他 以 们 你 來"
- " 個 們 到 和 大 对 對 就"
- " 我 时 時 有 来 為 要 說"
- " 说 |"
- " 主 些 因 它 想 意 理 生"
- " 當 看 着 置 者 自 著 裡"
- " 过 还 进 進 過 道 還 里"
- " 面"
-
-#ifdef AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT
-
- AF_BLUE_STRING_CJK_LEFT
- " 些 们 你 來 們 到 和 地"
- " 她 将 將 就 年 得 情 最"
- " 样 樣 理 能 說 说 这 這"
- " 通 |"
- " 即 吗 吧 听 呢 品 响 嗎"
- " 师 師 收 断 斷 明 眼 間"
- " 间 际 陈 限 除 陳 随 際"
- " 隨"
- AF_BLUE_STRING_CJK_RIGHT
- "事 前 學 将 將 情 想 或"
- " 政 斯 新 样 樣 民 沒 没"
- " 然 特 现 現 球 第 經 谁"
- " 起 |"
- " 例 別 别 制 动 動 吗 嗎"
- " 增 指 明 朝 期 构 物 确"
- " 种 調 调 費 费 那 都 間"
- " 间"
-
-#endif /* AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT */
-
-#endif /* AF_CONFIG_OPTION_CJK */
-
-
-// The blue zone stringsets, as used in the script styles, cf. `afstyles.h'.
-//
-// The AF_BLUE_PROPERTY_XXX flags are defined in `afblue.h'; here some
-// explanations.
-//
-// A blue zone in general is defined by a reference and an overshoot line.
-// During the hinting process, all coordinate values between those two lines
-// are set equal to the reference value, provided that the blue zone is not
-// wider than 0.75 pixels (otherwise the blue zone gets ignored). All
-// entries must have `AF_BLUE_STRING_MAX' as the final line.
-//
-// During the glyph analysis, edges are sorted from bottom to top, and then
-// sequentially checked, edge by edge, against the blue zones in the order
-// given below.
-//
-//
-// latin auto-hinter
-// -----------------
-//
-// Characters in a blue string are automatically classified as having a flat
-// (reference) or a round (overshoot) extremum. The blue zone is then set
-// up by the mean values of all flat extrema and all round extrema,
-// respectively. Only horizontal blue zones (i.e., adjusting vertical
-// coordinate values) are supported.
-//
-// Some scripts like Khmer need character composition to get all necessary
-// blue zones, since Unicode only provides an abstract data model that
-// doesn't represent all possible glyph shapes. For such character
-// clusters, the HarfBuzz library is used to convert them into the
-// corresponding glyphs. The largest glyph element (where `largest' can be
-// either `largest ascender' or `largest descender') then defines the
-// corresponding flat or round extremum.
-//
-// For the latin auto-hinter, the overshoot should be larger than the
-// reference for top zones, and vice versa for bottom zones.
-//
-// LATIN_TOP
-// Take the maximum flat and round coordinate values of the blue string
-// characters for computing the blue zone's reference and overshoot
-// values.
-//
-// If not set, take the minimum values.
-//
-// Mutually exclusive with `LATIN_SUB_TOP'.
-//
-// LATIN_SUB_TOP
-// For all glyphs of a character cluster, compute the maximum flat
-// and round coordinate values of each component, then take the
-// smallest of the maximum values. The idea is to get the top of
-// subscript glyphs, as used in Khmer, for example. Note that
-// this mechanism doesn't work for ordinary ligatures.
-//
-// This flags indicates a secondary blue zone: It gets removed if
-// there is a non-LATIN_SUB_TOP blue zone at the same coordinate
-// value (after scaling).
-//
-// Mutually exclusive with `LATIN_TOP'.
-//
-// LATIN_NEUTRAL
-// Ignore round extrema and define the blue zone with flat values only.
-// Both top and bottom of contours can match. This is useful for
-// scripts like Devanagari where vowel signs attach to the base
-// character and are implemented as components of composite glyphs.
-//
-// If not set, both round and flat extrema are taken into account.
-// Additionally, only the top or the bottom of a contour can match,
-// depending on the LATIN_TOP flag.
-//
-// Neutral blue zones should always follow non-neutral blue zones.
-//
-// LATIN_X_HEIGHT
-// Scale all glyphs vertically from the corresponding script to make the
-// reference line of this blue zone align on the grid. The scaling
-// takes place before all other blue zones get aligned to the grid.
-// Only one blue character string of a script style can have this flag.
-//
-// LATIN_LONG
-// Apply an additional constraint for blue zone values: Don't
-// necessarily use the extremum as-is but a segment of the topmost (or
-// bottommost) contour that is longer than a heuristic threshold, and
-// which is not too far away vertically from the real extremum. This
-// ensures that small bumps in the outline are ignored (for example, the
-// `vertical serifs' found in many Hebrew glyph designs).
-//
-// The segment must be at least EM/25 font units long, and the distance
-// to the extremum must be smaller than EM/4.
-//
-//
-// cjk auto-hinter
-// ---------------
-//
-// Characters in a blue string are *not* automatically classified. Instead,
-// first come the characters used for the overshoot value, then the
-// character `|', then the characters used for the reference value
-// (everything separated by space characters). The blue zone is then set up
-// by the mean values of all reference values and all overshoot values,
-// respectively. Both horizontal and vertical blue zones (i.e., adjusting
-// vertical and horizontal coordinate values, respectively) are supported.
-//
-// For the cjk auto-hinter, the overshoot should be smaller than the
-// reference for top zones, and vice versa for bottom zones.
-//
-// CJK_TOP
-// Take the maximum flat and round coordinate values of the blue string
-// characters. If not set, take the minimum values.
-//
-// CJK_RIGHT
-// A synonym for CJK_TOP. If CJK_HORIZ is set, this flag indicates the
-// right blue zone, taking horizontal maximum values.
-//
-// CJK_HORIZ
-// Define a blue zone for horizontal hinting (i.e., vertical blue
-// zones). If not set, this is a blue zone for vertical hinting.
-
-
-AF_BLUE_STRINGSET_ENUM AF_BLUE_STRINGSETS_ARRAY AF_BLUE_STRINGSET_MAX_LEN:
-
- AF_BLUE_STRINGSET_ADLM
- { AF_BLUE_STRING_ADLAM_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
- { AF_BLUE_STRING_ADLAM_CAPITAL_BOTTOM, 0 }
- { AF_BLUE_STRING_ADLAM_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP |
- AF_BLUE_PROPERTY_LATIN_X_HEIGHT }
- { AF_BLUE_STRING_ADLAM_SMALL_BOTTOM, 0 }
- { AF_BLUE_STRING_MAX, 0 }
-
- AF_BLUE_STRINGSET_ARAB
- { AF_BLUE_STRING_ARABIC_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
- { AF_BLUE_STRING_ARABIC_BOTTOM, 0 }
- { AF_BLUE_STRING_ARABIC_JOIN, AF_BLUE_PROPERTY_LATIN_NEUTRAL }
- { AF_BLUE_STRING_MAX, 0 }
-
- AF_BLUE_STRINGSET_ARMN
- { AF_BLUE_STRING_ARMENIAN_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
- { AF_BLUE_STRING_ARMENIAN_CAPITAL_BOTTOM, 0 }
- { AF_BLUE_STRING_ARMENIAN_SMALL_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP }
- { AF_BLUE_STRING_ARMENIAN_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP |
- AF_BLUE_PROPERTY_LATIN_X_HEIGHT }
- { AF_BLUE_STRING_ARMENIAN_SMALL_BOTTOM, 0 }
- { AF_BLUE_STRING_ARMENIAN_SMALL_DESCENDER, 0 }
- { AF_BLUE_STRING_MAX, 0 }
-
- AF_BLUE_STRINGSET_AVST
- { AF_BLUE_STRING_AVESTAN_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
- { AF_BLUE_STRING_AVESTAN_BOTTOM, 0 }
- { AF_BLUE_STRING_MAX, 0 }
-
- AF_BLUE_STRINGSET_BAMU
- { AF_BLUE_STRING_BAMUM_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
- { AF_BLUE_STRING_BAMUM_BOTTOM, 0 }
- { AF_BLUE_STRING_MAX, 0 }
-
- AF_BLUE_STRINGSET_BENG
- { AF_BLUE_STRING_BENGALI_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
- { AF_BLUE_STRING_BENGALI_HEAD, AF_BLUE_PROPERTY_LATIN_TOP }
- { AF_BLUE_STRING_BENGALI_BASE, AF_BLUE_PROPERTY_LATIN_TOP |
- AF_BLUE_PROPERTY_LATIN_NEUTRAL |
- AF_BLUE_PROPERTY_LATIN_X_HEIGHT }
- { AF_BLUE_STRING_BENGALI_BASE, 0 }
- { AF_BLUE_STRING_MAX, 0 }
-
- AF_BLUE_STRINGSET_BUHD
- { AF_BLUE_STRING_BUHID_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
- { AF_BLUE_STRING_BUHID_LARGE, AF_BLUE_PROPERTY_LATIN_TOP }
- { AF_BLUE_STRING_BUHID_SMALL, AF_BLUE_PROPERTY_LATIN_TOP |
- AF_BLUE_PROPERTY_LATIN_X_HEIGHT }
- { AF_BLUE_STRING_BUHID_BOTTOM, 0 }
- { AF_BLUE_STRING_MAX, 0 }
-
- AF_BLUE_STRINGSET_CAKM
- { AF_BLUE_STRING_CHAKMA_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
- { AF_BLUE_STRING_CHAKMA_BOTTOM, 0 }
- { AF_BLUE_STRING_CHAKMA_DESCENDER, 0 }
- { AF_BLUE_STRING_MAX, 0 }
-
- AF_BLUE_STRINGSET_CANS
- { AF_BLUE_STRING_CANADIAN_SYLLABICS_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
- { AF_BLUE_STRING_CANADIAN_SYLLABICS_BOTTOM, 0 }
- { AF_BLUE_STRING_CANADIAN_SYLLABICS_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP |
- AF_BLUE_PROPERTY_LATIN_X_HEIGHT }
- { AF_BLUE_STRING_CANADIAN_SYLLABICS_SMALL_BOTTOM, 0 }
- { AF_BLUE_STRING_CANADIAN_SYLLABICS_SUPS_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
- { AF_BLUE_STRING_CANADIAN_SYLLABICS_SUPS_BOTTOM, 0 }
- { AF_BLUE_STRING_MAX, 0 }
-
- AF_BLUE_STRINGSET_CARI
- { AF_BLUE_STRING_CARIAN_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
- { AF_BLUE_STRING_CARIAN_BOTTOM, 0 }
- { AF_BLUE_STRING_MAX, 0 }
-
- AF_BLUE_STRINGSET_CHER
- { AF_BLUE_STRING_CHEROKEE_CAPITAL, AF_BLUE_PROPERTY_LATIN_TOP }
- { AF_BLUE_STRING_CHEROKEE_CAPITAL, 0 }
- { AF_BLUE_STRING_CHEROKEE_SMALL_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP }
- { AF_BLUE_STRING_CHEROKEE_SMALL, AF_BLUE_PROPERTY_LATIN_TOP |
- AF_BLUE_PROPERTY_LATIN_X_HEIGHT }
- { AF_BLUE_STRING_CHEROKEE_SMALL, 0 }
- { AF_BLUE_STRING_CHEROKEE_SMALL_DESCENDER, 0 }
- { AF_BLUE_STRING_MAX, 0 }
-
- AF_BLUE_STRINGSET_COPT
- { AF_BLUE_STRING_COPTIC_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
- { AF_BLUE_STRING_COPTIC_CAPITAL_BOTTOM, 0 }
- { AF_BLUE_STRING_COPTIC_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP |
- AF_BLUE_PROPERTY_LATIN_X_HEIGHT }
- { AF_BLUE_STRING_COPTIC_SMALL_BOTTOM, 0 }
- { AF_BLUE_STRING_MAX, 0 }
-
- AF_BLUE_STRINGSET_CPRT
- { AF_BLUE_STRING_CYPRIOT_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
- { AF_BLUE_STRING_CYPRIOT_BOTTOM, 0 }
- { AF_BLUE_STRING_CYPRIOT_SMALL, AF_BLUE_PROPERTY_LATIN_TOP }
- { AF_BLUE_STRING_CYPRIOT_SMALL, 0 }
- { AF_BLUE_STRING_MAX, 0 }
-
- AF_BLUE_STRINGSET_CYRL
- { AF_BLUE_STRING_CYRILLIC_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
- { AF_BLUE_STRING_CYRILLIC_CAPITAL_BOTTOM, 0 }
- { AF_BLUE_STRING_CYRILLIC_SMALL, AF_BLUE_PROPERTY_LATIN_TOP |
- AF_BLUE_PROPERTY_LATIN_X_HEIGHT }
- { AF_BLUE_STRING_CYRILLIC_SMALL, 0 }
- { AF_BLUE_STRING_CYRILLIC_SMALL_DESCENDER, 0 }
- { AF_BLUE_STRING_MAX, 0 }
-
- AF_BLUE_STRINGSET_DEVA
- { AF_BLUE_STRING_DEVANAGARI_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
- { AF_BLUE_STRING_DEVANAGARI_HEAD, AF_BLUE_PROPERTY_LATIN_TOP }
- { AF_BLUE_STRING_DEVANAGARI_BASE, AF_BLUE_PROPERTY_LATIN_TOP |
- AF_BLUE_PROPERTY_LATIN_NEUTRAL |
- AF_BLUE_PROPERTY_LATIN_X_HEIGHT }
- { AF_BLUE_STRING_DEVANAGARI_BASE, 0 }
- { AF_BLUE_STRING_DEVANAGARI_BOTTOM, 0 }
- { AF_BLUE_STRING_MAX, 0 }
-
- AF_BLUE_STRINGSET_DSRT
- { AF_BLUE_STRING_DESERET_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
- { AF_BLUE_STRING_DESERET_CAPITAL_BOTTOM, 0 }
- { AF_BLUE_STRING_DESERET_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP |
- AF_BLUE_PROPERTY_LATIN_X_HEIGHT }
- { AF_BLUE_STRING_DESERET_SMALL_BOTTOM, 0 }
- { AF_BLUE_STRING_MAX, 0 }
-
- AF_BLUE_STRINGSET_ETHI
- { AF_BLUE_STRING_ETHIOPIC_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
- { AF_BLUE_STRING_ETHIOPIC_BOTTOM, 0 }
- { AF_BLUE_STRING_MAX, 0 }
-
- AF_BLUE_STRINGSET_GEOR
- { AF_BLUE_STRING_GEORGIAN_MKHEDRULI_TOP, AF_BLUE_PROPERTY_LATIN_TOP |
- AF_BLUE_PROPERTY_LATIN_X_HEIGHT }
- { AF_BLUE_STRING_GEORGIAN_MKHEDRULI_BOTTOM, 0 }
- { AF_BLUE_STRING_GEORGIAN_MKHEDRULI_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP }
- { AF_BLUE_STRING_GEORGIAN_MKHEDRULI_DESCENDER, 0 }
- { AF_BLUE_STRING_GEORGIAN_MTAVRULI_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
- { AF_BLUE_STRING_GEORGIAN_MTAVRULI_BOTTOM, 0 }
- { AF_BLUE_STRING_MAX, 0 }
-
- AF_BLUE_STRINGSET_GEOK
- { AF_BLUE_STRING_GEORGIAN_ASOMTAVRULI_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
- { AF_BLUE_STRING_GEORGIAN_ASOMTAVRULI_BOTTOM, 0 }
- { AF_BLUE_STRING_GEORGIAN_NUSKHURI_TOP, AF_BLUE_PROPERTY_LATIN_TOP |
- AF_BLUE_PROPERTY_LATIN_X_HEIGHT }
- { AF_BLUE_STRING_GEORGIAN_NUSKHURI_BOTTOM, 0 }
- { AF_BLUE_STRING_GEORGIAN_NUSKHURI_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP }
- { AF_BLUE_STRING_GEORGIAN_NUSKHURI_DESCENDER, 0 }
- { AF_BLUE_STRING_MAX, 0 }
-
- AF_BLUE_STRINGSET_GLAG
- { AF_BLUE_STRING_GLAGOLITIC_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
- { AF_BLUE_STRING_GLAGOLITIC_CAPITAL_BOTTOM, 0 }
- { AF_BLUE_STRING_GLAGOLITIC_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP |
- AF_BLUE_PROPERTY_LATIN_X_HEIGHT }
- { AF_BLUE_STRING_GLAGOLITIC_SMALL_BOTTOM, 0 }
- { AF_BLUE_STRING_MAX, 0 }
-
- AF_BLUE_STRINGSET_GOTH
- { AF_BLUE_STRING_GOTHIC_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
- { AF_BLUE_STRING_GOTHIC_BOTTOM, 0 }
- { AF_BLUE_STRING_MAX, 0 }
-
- AF_BLUE_STRINGSET_GREK
- { AF_BLUE_STRING_GREEK_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
- { AF_BLUE_STRING_GREEK_CAPITAL_BOTTOM, 0 }
- { AF_BLUE_STRING_GREEK_SMALL_BETA_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
- { AF_BLUE_STRING_GREEK_SMALL, AF_BLUE_PROPERTY_LATIN_TOP |
- AF_BLUE_PROPERTY_LATIN_X_HEIGHT }
- { AF_BLUE_STRING_GREEK_SMALL, 0 }
- { AF_BLUE_STRING_GREEK_SMALL_DESCENDER, 0 }
- { AF_BLUE_STRING_MAX, 0 }
-
- AF_BLUE_STRINGSET_GUJR
- { AF_BLUE_STRING_GUJARATI_TOP, AF_BLUE_PROPERTY_LATIN_TOP |
- AF_BLUE_PROPERTY_LATIN_X_HEIGHT }
- { AF_BLUE_STRING_GUJARATI_BOTTOM, 0 }
- { AF_BLUE_STRING_GUJARATI_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP }
- { AF_BLUE_STRING_GUJARATI_DESCENDER, 0 }
- { AF_BLUE_STRING_GUJARATI_DIGIT_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
- { AF_BLUE_STRING_MAX, 0 }
-
- AF_BLUE_STRINGSET_GURU
- { AF_BLUE_STRING_GURMUKHI_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
- { AF_BLUE_STRING_GURMUKHI_HEAD, AF_BLUE_PROPERTY_LATIN_TOP }
- { AF_BLUE_STRING_GURMUKHI_BASE, AF_BLUE_PROPERTY_LATIN_TOP |
- AF_BLUE_PROPERTY_LATIN_NEUTRAL |
- AF_BLUE_PROPERTY_LATIN_X_HEIGHT }
- { AF_BLUE_STRING_GURMUKHI_BOTTOM, 0 }
- { AF_BLUE_STRING_GURMUKHI_DIGIT_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
- { AF_BLUE_STRING_MAX, 0 }
-
- AF_BLUE_STRINGSET_HEBR
- { AF_BLUE_STRING_HEBREW_TOP, AF_BLUE_PROPERTY_LATIN_TOP |
- AF_BLUE_PROPERTY_LATIN_LONG }
- { AF_BLUE_STRING_HEBREW_BOTTOM, 0 }
- { AF_BLUE_STRING_HEBREW_DESCENDER, 0 }
- { AF_BLUE_STRING_MAX, 0 }
-
- AF_BLUE_STRINGSET_KNDA
- { AF_BLUE_STRING_KANNADA_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
- { AF_BLUE_STRING_KANNADA_BOTTOM, 0 }
- { AF_BLUE_STRING_MAX, 0 }
-
- AF_BLUE_STRINGSET_KALI
- { AF_BLUE_STRING_KAYAH_LI_TOP, AF_BLUE_PROPERTY_LATIN_TOP |
- AF_BLUE_PROPERTY_LATIN_X_HEIGHT }
- { AF_BLUE_STRING_KAYAH_LI_BOTTOM, 0 }
- { AF_BLUE_STRING_KAYAH_LI_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP }
- { AF_BLUE_STRING_KAYAH_LI_DESCENDER, 0 }
- { AF_BLUE_STRING_KAYAH_LI_LARGE_DESCENDER, 0 }
- { AF_BLUE_STRING_MAX, 0 }
-
- AF_BLUE_STRINGSET_KHMR
- { AF_BLUE_STRING_KHMER_TOP, AF_BLUE_PROPERTY_LATIN_TOP |
- AF_BLUE_PROPERTY_LATIN_X_HEIGHT }
- { AF_BLUE_STRING_KHMER_SUBSCRIPT_TOP, AF_BLUE_PROPERTY_LATIN_SUB_TOP }
- { AF_BLUE_STRING_KHMER_BOTTOM, 0 }
- { AF_BLUE_STRING_KHMER_DESCENDER, 0 }
- { AF_BLUE_STRING_KHMER_LARGE_DESCENDER, 0 }
- { AF_BLUE_STRING_MAX, 0 }
-
- AF_BLUE_STRINGSET_KHMS
- { AF_BLUE_STRING_KHMER_SYMBOLS_WAXING_TOP, AF_BLUE_PROPERTY_LATIN_TOP |
- AF_BLUE_PROPERTY_LATIN_X_HEIGHT }
- { AF_BLUE_STRING_KHMER_SYMBOLS_WANING_BOTTOM, 0 }
- { AF_BLUE_STRING_MAX, 0 }
-
- AF_BLUE_STRINGSET_LAO
- { AF_BLUE_STRING_LAO_TOP, AF_BLUE_PROPERTY_LATIN_TOP |
- AF_BLUE_PROPERTY_LATIN_X_HEIGHT }
- { AF_BLUE_STRING_LAO_BOTTOM, 0 }
- { AF_BLUE_STRING_LAO_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP }
- { AF_BLUE_STRING_LAO_LARGE_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP }
- { AF_BLUE_STRING_LAO_DESCENDER, 0 }
- { AF_BLUE_STRING_MAX, 0 }
-
- AF_BLUE_STRINGSET_LATN
- { AF_BLUE_STRING_LATIN_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
- { AF_BLUE_STRING_LATIN_CAPITAL_BOTTOM, 0 }
- { AF_BLUE_STRING_LATIN_SMALL_F_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
- { AF_BLUE_STRING_LATIN_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP |
- AF_BLUE_PROPERTY_LATIN_X_HEIGHT }
- { AF_BLUE_STRING_LATIN_SMALL_BOTTOM, 0 }
- { AF_BLUE_STRING_LATIN_SMALL_DESCENDER, 0 }
- { AF_BLUE_STRING_MAX, 0 }
-
- AF_BLUE_STRINGSET_LATB
- { AF_BLUE_STRING_LATIN_SUBS_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
- { AF_BLUE_STRING_LATIN_SUBS_CAPITAL_BOTTOM, 0 }
- { AF_BLUE_STRING_LATIN_SUBS_SMALL_F_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
- { AF_BLUE_STRING_LATIN_SUBS_SMALL, AF_BLUE_PROPERTY_LATIN_TOP |
- AF_BLUE_PROPERTY_LATIN_X_HEIGHT }
- { AF_BLUE_STRING_LATIN_SUBS_SMALL, 0 }
- { AF_BLUE_STRING_LATIN_SUBS_SMALL_DESCENDER, 0 }
- { AF_BLUE_STRING_MAX, 0 }
-
- AF_BLUE_STRINGSET_LATP
- { AF_BLUE_STRING_LATIN_SUPS_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
- { AF_BLUE_STRING_LATIN_SUPS_CAPITAL_BOTTOM, 0 }
- { AF_BLUE_STRING_LATIN_SUPS_SMALL_F_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
- { AF_BLUE_STRING_LATIN_SUPS_SMALL, AF_BLUE_PROPERTY_LATIN_TOP |
- AF_BLUE_PROPERTY_LATIN_X_HEIGHT }
- { AF_BLUE_STRING_LATIN_SUPS_SMALL, 0 }
- { AF_BLUE_STRING_LATIN_SUPS_SMALL_DESCENDER, 0 }
- { AF_BLUE_STRING_MAX, 0 }
-
- AF_BLUE_STRINGSET_LISU
- { AF_BLUE_STRING_LISU_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
- { AF_BLUE_STRING_LISU_BOTTOM, 0 }
- { AF_BLUE_STRING_MAX, 0 }
-
- AF_BLUE_STRINGSET_MLYM
- { AF_BLUE_STRING_MALAYALAM_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
- { AF_BLUE_STRING_MALAYALAM_BOTTOM, 0 }
- { AF_BLUE_STRING_MAX, 0 }
-
- AF_BLUE_STRINGSET_MEDF
- { AF_BLUE_STRING_MEDEFAIDRIN_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
- { AF_BLUE_STRING_MEDEFAIDRIN_CAPITAL_BOTTOM, 0 }
- { AF_BLUE_STRING_MEDEFAIDRIN_SMALL_F_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
- { AF_BLUE_STRING_MEDEFAIDRIN_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP |
- AF_BLUE_PROPERTY_LATIN_X_HEIGHT }
- { AF_BLUE_STRING_MEDEFAIDRIN_SMALL_BOTTOM, 0 }
- { AF_BLUE_STRING_MEDEFAIDRIN_SMALL_DESCENDER, 0 }
- { AF_BLUE_STRING_MEDEFAIDRIN_DIGIT_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
- { AF_BLUE_STRING_MAX, 0 }
-
- AF_BLUE_STRINGSET_MONG
- { AF_BLUE_STRING_MONGOLIAN_TOP_BASE, AF_BLUE_PROPERTY_LATIN_TOP }
- { AF_BLUE_STRING_MONGOLIAN_BOTTOM_BASE, 0 }
- { AF_BLUE_STRING_MAX, 0 }
-
- AF_BLUE_STRINGSET_MYMR
- { AF_BLUE_STRING_MYANMAR_TOP, AF_BLUE_PROPERTY_LATIN_TOP |
- AF_BLUE_PROPERTY_LATIN_X_HEIGHT }
- { AF_BLUE_STRING_MYANMAR_BOTTOM, 0 }
- { AF_BLUE_STRING_MYANMAR_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP }
- { AF_BLUE_STRING_MYANMAR_DESCENDER, 0 }
- { AF_BLUE_STRING_MAX, 0 }
-
- AF_BLUE_STRINGSET_NKOO
- { AF_BLUE_STRING_NKO_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
- { AF_BLUE_STRING_NKO_BOTTOM, 0 }
- { AF_BLUE_STRING_NKO_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP |
- AF_BLUE_PROPERTY_LATIN_X_HEIGHT }
- { AF_BLUE_STRING_NKO_SMALL_BOTTOM, 0 }
- { AF_BLUE_STRING_MAX, 0 }
-
- AF_BLUE_STRINGSET_NONE
- { AF_BLUE_STRING_MAX, 0 }
-
- AF_BLUE_STRINGSET_OLCK
- { AF_BLUE_STRING_OL_CHIKI, AF_BLUE_PROPERTY_LATIN_TOP }
- { AF_BLUE_STRING_OL_CHIKI, 0 }
- { AF_BLUE_STRING_MAX, 0 }
-
- AF_BLUE_STRINGSET_ORKH
- { AF_BLUE_STRING_OLD_TURKIC_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
- { AF_BLUE_STRING_OLD_TURKIC_BOTTOM, 0 }
- { AF_BLUE_STRING_MAX, 0 }
-
- AF_BLUE_STRINGSET_OSGE
- { AF_BLUE_STRING_OSAGE_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
- { AF_BLUE_STRING_OSAGE_CAPITAL_BOTTOM, 0 }
- { AF_BLUE_STRING_OSAGE_CAPITAL_DESCENDER, 0 }
- { AF_BLUE_STRING_OSAGE_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP |
- AF_BLUE_PROPERTY_LATIN_X_HEIGHT }
- { AF_BLUE_STRING_OSAGE_SMALL_BOTTOM, 0 }
- { AF_BLUE_STRING_OSAGE_SMALL_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP }
- { AF_BLUE_STRING_OSAGE_SMALL_DESCENDER, 0 }
- { AF_BLUE_STRING_MAX, 0 }
-
- AF_BLUE_STRINGSET_OSMA
- { AF_BLUE_STRING_OSMANYA_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
- { AF_BLUE_STRING_OSMANYA_BOTTOM, 0 }
- { AF_BLUE_STRING_MAX, 0 }
-
- AF_BLUE_STRINGSET_ROHG
- { AF_BLUE_STRING_ROHINGYA_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
- { AF_BLUE_STRING_ROHINGYA_BOTTOM, 0 }
- { AF_BLUE_STRING_ROHINGYA_JOIN, AF_BLUE_PROPERTY_LATIN_NEUTRAL }
- { AF_BLUE_STRING_MAX, 0 }
-
- AF_BLUE_STRINGSET_SAUR
- { AF_BLUE_STRING_SAURASHTRA_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
- { AF_BLUE_STRING_SAURASHTRA_BOTTOM, 0 }
- { AF_BLUE_STRING_MAX, 0 }
-
- AF_BLUE_STRINGSET_SHAW
- { AF_BLUE_STRING_SHAVIAN_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
- { AF_BLUE_STRING_SHAVIAN_BOTTOM, 0 }
- { AF_BLUE_STRING_SHAVIAN_DESCENDER, 0 }
- { AF_BLUE_STRING_SHAVIAN_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP |
- AF_BLUE_PROPERTY_LATIN_X_HEIGHT }
- { AF_BLUE_STRING_SHAVIAN_SMALL_BOTTOM, 0 }
- { AF_BLUE_STRING_MAX, 0 }
-
- AF_BLUE_STRINGSET_SINH
- { AF_BLUE_STRING_SINHALA_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
- { AF_BLUE_STRING_SINHALA_BOTTOM, 0 }
- { AF_BLUE_STRING_SINHALA_DESCENDER, 0 }
- { AF_BLUE_STRING_MAX, 0 }
-
- AF_BLUE_STRINGSET_SUND
- { AF_BLUE_STRING_SUNDANESE_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
- { AF_BLUE_STRING_SUNDANESE_BOTTOM, 0 }
- { AF_BLUE_STRING_SUNDANESE_DESCENDER, 0 }
- { AF_BLUE_STRING_MAX, 0 }
-
- AF_BLUE_STRINGSET_TAML
- { AF_BLUE_STRING_TAMIL_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
- { AF_BLUE_STRING_TAMIL_BOTTOM, 0 }
- { AF_BLUE_STRING_MAX, 0 }
-
- AF_BLUE_STRINGSET_TAVT
- { AF_BLUE_STRING_TAI_VIET_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
- { AF_BLUE_STRING_TAI_VIET_BOTTOM, 0 }
- { AF_BLUE_STRING_MAX, 0 }
-
- AF_BLUE_STRINGSET_TELU
- { AF_BLUE_STRING_TELUGU_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
- { AF_BLUE_STRING_TELUGU_BOTTOM, 0 }
- { AF_BLUE_STRING_MAX, 0 }
-
- AF_BLUE_STRINGSET_THAI
- { AF_BLUE_STRING_THAI_TOP, AF_BLUE_PROPERTY_LATIN_TOP |
- AF_BLUE_PROPERTY_LATIN_X_HEIGHT }
- { AF_BLUE_STRING_THAI_BOTTOM, 0 }
- { AF_BLUE_STRING_THAI_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP }
- { AF_BLUE_STRING_THAI_LARGE_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP }
- { AF_BLUE_STRING_THAI_DESCENDER, 0 }
- { AF_BLUE_STRING_THAI_LARGE_DESCENDER, 0 }
- { AF_BLUE_STRING_THAI_DIGIT_TOP, 0 }
- { AF_BLUE_STRING_MAX, 0 }
-
- AF_BLUE_STRINGSET_TFNG
- { AF_BLUE_STRING_TIFINAGH, AF_BLUE_PROPERTY_LATIN_TOP }
- { AF_BLUE_STRING_TIFINAGH, 0 }
- { AF_BLUE_STRING_MAX, 0 }
-
- AF_BLUE_STRINGSET_VAII
- { AF_BLUE_STRING_VAI_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
- { AF_BLUE_STRING_VAI_BOTTOM, 0 }
- { AF_BLUE_STRING_MAX, 0 }
-
-#ifdef AF_CONFIG_OPTION_CJK
-
- AF_BLUE_STRINGSET_HANI
- { AF_BLUE_STRING_CJK_TOP, AF_BLUE_PROPERTY_CJK_TOP }
- { AF_BLUE_STRING_CJK_BOTTOM, 0 }
-#ifdef AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT
- { AF_BLUE_STRING_CJK_LEFT, AF_BLUE_PROPERTY_CJK_HORIZ }
- { AF_BLUE_STRING_CJK_RIGHT, AF_BLUE_PROPERTY_CJK_HORIZ |
- AF_BLUE_PROPERTY_CJK_RIGHT }
-#endif /* AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT */
- { AF_BLUE_STRING_MAX, 0 }
-
-#endif /* AF_CONFIG_OPTION_CJK */
-
-
-// END
diff --git a/thirdparty/freetype/src/base/ftver.rc b/thirdparty/freetype/src/base/ftver.rc
deleted file mode 100644
index eb6090ecc2..0000000000
--- a/thirdparty/freetype/src/base/ftver.rc
+++ /dev/null
@@ -1,61 +0,0 @@
-/***************************************************************************/
-/* */
-/* ftver.rc */
-/* */
-/* FreeType VERSIONINFO resource for Windows DLLs. */
-/* */
-/* Copyright (C) 2018-2022 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
-#include<windows.h>
-
-#define FT_VERSION 2,12,1,0
-#define FT_VERSION_STR "2.12.1"
-
-VS_VERSION_INFO VERSIONINFO
-FILEVERSION FT_VERSION
-PRODUCTVERSION FT_VERSION
-FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
-#ifdef _DEBUG
-FILEFLAGS VS_FF_DEBUG
-#endif
-#ifdef DLL_EXPORT
-FILETYPE VFT_DLL
-#define FT_FILENAME "freetype.dll"
-#else
-FILETYPE VFT_STATIC_LIB
-#define FT_FILENAME "freetype.lib"
-#endif
-BEGIN
- BLOCK "StringFileInfo"
- BEGIN
- BLOCK "040904E4"
- BEGIN
- VALUE "CompanyName", "The FreeType Project"
- VALUE "FileDescription", "Font Rendering Library"
- VALUE "FileVersion", FT_VERSION_STR
- VALUE "ProductName", "FreeType"
- VALUE "ProductVersion", FT_VERSION_STR
- VALUE "LegalCopyright", "\251 2000-2022 The FreeType Project www.freetype.org. All rights reserved."
- VALUE "InternalName", "freetype"
- VALUE "OriginalFilename", FT_FILENAME
- END
- END
-
- BLOCK "VarFileInfo"
- BEGIN
- /* The following line should only be modified for localized versions. */
- /* It consists of any number of WORD,WORD pairs, with each pair */
- /* describing a "language,codepage" combination supported by the file. */
- VALUE "Translation", 0x409, 1252
- END
-END
diff --git a/thirdparty/freetype/src/bdf/README b/thirdparty/freetype/src/bdf/README
deleted file mode 100644
index d7cb8c14ef..0000000000
--- a/thirdparty/freetype/src/bdf/README
+++ /dev/null
@@ -1,152 +0,0 @@
- FreeType font driver for BDF fonts
-
- Francesco Zappa Nardelli
- <francesco.zappa.nardelli@ens.fr>
-
-
-Introduction
-************
-
-BDF (Bitmap Distribution Format) is a bitmap font format defined by Adobe,
-which is intended to be easily understood by both humans and computers.
-This code implements a BDF driver for the FreeType library, following the
-Adobe Specification V 2.2. The specification of the BDF font format is
-available from Adobe's web site:
-
- https://adobe-type-tools.github.io/font-tech-notes/pdfs/5005.BDF_Spec.pdf
-
-Many good bitmap fonts in bdf format come with XFree86 (www.XFree86.org).
-They do not define vertical metrics, because the X Consortium BDF
-specification has removed them.
-
-
-Encodings
-*********
-
-[This section is out of date, retained for historical reasons. BDF
- properties can be retrieved with `FT_Get_BDF_Property`, character set ID
- values with `FT_Get_BDF_Charset_ID`.]
-
-The variety of encodings that accompanies bdf fonts appears to encompass the
-small set defined in freetype.h. On the other hand, two properties that
-specify encoding and registry are usually defined in bdf fonts.
-
-I decided to make these two properties directly accessible, leaving to the
-client application the work of interpreting them. For instance:
-
-
- #include FT_INTERNAL_BDF_TYPES_H
-
- FT_Face face;
- BDF_Public_Face bdfface;
-
-
- FT_New_Face( library, ..., &face );
-
- bdfface = (BDF_Public_Face)face;
-
- if ( ( bdfface->charset_registry == "ISO10646" ) &&
- ( bdfface->charset_encoding == "1" ) )
- [..]
-
-
-Thus the driver always exports `ft_encoding_none' as face->charmap.encoding.
-FT_Get_Char_Index's behavior is unmodified, that is, it converts the ULong
-value given as argument into the corresponding glyph number.
-
-If the two properties are not available, Adobe Standard Encoding should be
-assumed.
-
-
-Anti-Aliased Bitmaps
-********************
-
-The driver supports an extension to the BDF format as used in Mark Leisher's
-xmbdfed bitmap font editor. Microsoft's SBIT tool expects bitmap fonts in
-that format for adding anti-aliased them to TrueType fonts. It introduces a
-fourth field to the `SIZE' keyword which gives the bpp value (bits per
-pixel) of the glyph data in the font. Possible values are 1 (the default),
-2 (four gray levels), 4 (16 gray levels), and 8 (256 gray levels). The
-driver returns either a bitmap with 1 bit per pixel or a pixmap with 8bits
-per pixel (using 4, 16, and 256 gray levels, respectively).
-
-
-Known problems
-**************
-
-- A font is entirely loaded into memory. Obviously, this is not the Right
- Thing(TM). If you have big fonts I suggest you convert them into PCF
- format (using the bdftopcf utility): the PCF font drive of FreeType can
- perform incremental glyph loading.
-
-When I have some time, I will implement on-demand glyph parsing.
-
-- Except for encodings properties, client applications have no visibility of
- the PCF_Face object. This means that applications cannot directly access
- font tables and must trust FreeType.
-
-- Currently, glyph names are ignored.
-
- I plan to give full visibility of the BDF_Face object in an upcoming
- revision of the driver, thus implementing also glyph names.
-
-- As I have never seen a BDF font that defines vertical metrics, vertical
- metrics are (parsed and) discarded. If you own a BDF font that defines
- vertical metrics, please let me know (I will implement them in 5-10
- minutes).
-
-
-License
-*******
-
-Copyright (C) 2001-2002 by Francesco Zappa Nardelli
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-*** Portions of the driver (that is, bdflib.c and bdf.h):
-
-Copyright 2000 Computing Research Labs, New Mexico State University
-Copyright 2001-2002, 2011 Francesco Zappa Nardelli
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the "Software"),
-to deal in the Software without restriction, including without limitation
-the rights to use, copy, modify, merge, publish, distribute, sublicense,
-and/or sell copies of the Software, and to permit persons to whom the
-Software is furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-THE COMPUTING RESEARCH LAB OR NEW MEXICO STATE UNIVERSITY BE LIABLE FOR ANY
-CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT
-OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
-THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-
-Credits
-*******
-
-This driver is based on excellent Mark Leisher's bdf library. If you
-find something good in this driver you should probably thank him, not
-me.
diff --git a/thirdparty/freetype/src/gxvalid/README b/thirdparty/freetype/src/gxvalid/README
deleted file mode 100644
index 921b3ac92e..0000000000
--- a/thirdparty/freetype/src/gxvalid/README
+++ /dev/null
@@ -1,532 +0,0 @@
-gxvalid: TrueType GX validator
-==============================
-
-
-1. What is this
----------------
-
- `gxvalid' is a module to validate TrueType GX tables: a collection of
- additional tables in TrueType font which are used by `QuickDraw GX
- Text', Apple Advanced Typography (AAT). In addition, gxvalid can
- validates `kern' tables which have been extended for AAT. Like the
- otvalid module, gxvalid uses FreeType 2's validator framework
- (ftvalid).
-
- You can link gxvalid with your program; before running your own layout
- engine, gxvalid validates a font file. As the result, you can remove
- error-checking code from the layout engine. It is also possible to
- use gxvalid as a stand-alone font validator; the `ftvalid' test
- program included in the ft2demo bundle calls gxvalid internally.
- A stand-alone font validator may be useful for font developers.
-
- This documents documents the following issues.
-
- - supported TrueType GX tables
- - fundamental validation limitations
- - permissive error handling of broken GX tables
- - `kern' table issue.
-
-
-2. Supported tables
--------------------
-
- The following GX tables are currently supported.
-
- bsln
- feat
- just
- kern(*)
- lcar
- mort
- morx
- opbd
- prop
- trak
-
- The following GX tables are currently unsupported.
-
- cvar
- fdsc
- fmtx
- fvar
- gvar
- Zapf
-
- The following GX tables won't be supported.
-
- acnt(**)
- hsty(***)
-
- The following undocumented tables in TrueType fonts designed for Apple
- platform aren't handled either.
-
- addg
- CVTM
- TPNM
- umif
-
-
- *) The `kern' validator handles both the classic and the new kern
- formats; the former is supported on both Microsoft and Apple
- platforms, while the latter is supported on Apple platforms.
-
- **) `acnt' tables are not supported by currently available Apple font
- tools.
-
- ***) There is one more Apple extension, `hsty', but it is for
- Newton-OS, not GX (Newton-OS is a platform by Apple, but it can
- use sfnt- housed bitmap fonts only). Therefore, it should be
- excluded from `Apple platform' in the context of TrueType.
- gxvalid ignores it as Apple font tools do so.
-
-
- We have checked 183 fonts bundled with MacOS 9.1, MacOS 9.2, MacOS
- 10.0, MacOS X 10.1, MSIE for MacOS, and AppleWorks 6.0. In addition,
- we have checked 67 Dynalab fonts (designed for MacOS) and 189 Ricoh
- fonts (designed for Windows and MacOS dual platforms). The number of
- fonts including TrueType GX tables are as follows.
-
- bsln: 76
- feat: 191
- just: 84
- kern: 59
- lcar: 4
- mort: 326
- morx: 19
- opbd: 4
- prop: 114
- trak: 16
-
- Dynalab and Ricoh fonts don't have GX tables except of `feat' and
- `mort'.
-
-
-3. Fundamental validation limitations
--------------------------------------
-
- TrueType GX provides layout information to libraries for font
- rasterizers and text layout. gxvalid can check whether the layout
- data in a font is conformant to the TrueType GX format specified by
- Apple. But gxvalid cannot check a how QuickDraw GX/AAT renderer uses
- the stored information.
-
- 3-1. Validation of State Machine activity
- -----------------------------------------
-
- QuickDraw GX/AAT uses a `State Machine' to provide `stateful' layout
- features, and TrueType GX stores the state transition diagram of
- this `State Machine' in a `StateTable' data structure. While the
- State Machine receives a series of glyph IDs, the State Machine
- starts with `start of text' state, walks around various states and
- generates various layout information to the renderer, and finally
- reaches the `end of text' state.
-
- gxvalid can check essential errors like:
-
- - possibility of state transitions to undefined states
- - existence of glyph IDs that the State Machine doesn't know how
- to handle
- - the State Machine cannot compute the layout information from
- given diagram
-
- These errors can be checked within finite steps, and without the
- State Machine itself, because these are `expression' errors of state
- transition diagram.
-
- There is no limitation about how long the State Machine walks
- around, so validation of the algorithm in the state transition
- diagram requires infinite steps, even if we had a State Machine in
- gxvalid. Therefore, the following errors and problems cannot be
- checked.
-
- - existence of states which the State Machine never transits to
- - the possibility that the State Machine never reaches `end of
- text'
- - the possibility of stack underflow/overflow in the State Machine
- (in ligature and contextual glyph substitutions, the State
- Machine can store 16 glyphs onto its stack)
-
- In addition, gxvalid doesn't check `temporary glyph IDs' used in the
- chained State Machines (in `mort' and `morx' tables). If a layout
- feature is implemented by a single State Machine, a glyph ID
- converted by the State Machine is passed to the glyph renderer, thus
- it should not point to an undefined glyph ID. But if a layout
- feature is implemented by chained State Machines, a component State
- Machine (if it is not the final one) is permitted to generate
- undefined glyph IDs for temporary use, because it is handled by next
- component State Machine and not by the glyph renderer. To validate
- such temporary glyph IDs, gxvalid must stack all undefined glyph IDs
- which can occur in the output of the previous State Machine and
- search them in the `ClassTable' structure of the current State
- Machine. It is too complex to list all possible glyph IDs from the
- StateTable, especially from a ligature substitution table.
-
- 3-2. Validation of relationship between multiple layout features
- ----------------------------------------------------------------
-
- gxvalid does not validate the relationship between multiple layout
- features at all.
-
- If multiple layout features are defined in TrueType GX tables,
- possible interactions, overrides, and conflicts between layout
- features are implicitly given in the font too. For example, there
- are several predefined spacing control features:
-
- - Text Spacing (Proportional/Monospace/Half-width/Normal)
- - Number Spacing (Monospaced-numbers/Proportional-numbers)
- - Kana Spacing (Full-width/Proportional)
- - Ideographic Spacing (Full-width/Proportional)
- - CJK Roman Spacing (Half-width/Proportional/Default-roman
- /Full-width-roman/Proportional)
-
- If all layout features are independently managed, we can activate
- inconsistent typographic rules like `Text Spacing=Monospace' and
- `Ideographic Spacing=Proportional' at the same time.
-
- The combinations of layout features is managed by a 32bit integer
- (one bit each for selector setting), so we can define relationships
- between up to 32 features, theoretically. But if one feature
- setting affects another feature setting, we need typographic
- priority rules to validate the relationship. Unfortunately, the
- TrueType GX format specification does not give such information even
- for predefined features.
-
-
-4. Permissive error handling of broken GX tables
-------------------------------------------------
-
- When Apple's font rendering system finds an inconsistency, like a
- specification violation or an unspecified value in a TrueType GX
- table, it does not always return error. In most cases, the rendering
- engine silently ignores such wrong values or even whole tables. In
- fact, MacOS is shipped with fonts including broken GX/AAT tables, but
- no harmful effects due to `officially broken' fonts are observed by
- end-users.
-
- gxvalid is designed to continue the validation process as long as
- possible. When gxvalid find wrong values, gxvalid warns it at least,
- and takes a fallback procedure if possible. The fallback procedure
- depends on the debug level.
-
- We used the following three tools to investigate Apple's error handling.
-
- - FontValidator (for MacOS 8.5 - 9.2) resource fork font
- - ftxvalidator (for MacOS X 10.1 -) dfont or naked-sfnt
- - ftxdumperfuser (for MacOS X 10.1 -) dfont or naked-sfnt
-
- However, all tests were done on a PowerPC based Macintosh; at present,
- we have not checked those tools on a m68k-based Macintosh.
-
- In total, we checked 183 fonts bundled to MacOS 9.1, MacOS 9.2, MacOS
- 10.0, MacOS X 10.1, MSIE for MacOS, and AppleWorks 6.0. These fonts
- are distributed officially, but many broken GX/AAT tables were found
- by Apple's font tools. In the following, we list typical violation of
- the GX specification, in fonts officially distributed with those Apple
- systems.
-
- 4-1. broken BinSrchHeader (19/183)
- ----------------------------------
-
- `BinSrchHeader' is a header of a data array for m68k platforms to
- access memory efficiently. Although there are only two independent
- parameters for real (`unitSize' and `nUnits'), BinSrchHeader has
- three additional parameters which can be calculated from `unitSize'
- and `nUnits', for fast setup. Apple font tools ignore them
- silently, so gxvalid warns if it finds and inconsistency, and always
- continues validation. The additional parameters are ignored
- regardless of the consistency.
-
- 19 fonts include such inconsistencies; all breaks are in the
- BinSrchHeader structure of the `kern' table.
-
- 4-2. too-short LookupTable (5/183)
- ----------------------------------
-
- LookupTable format 0 is a simple array to get a value from a given
- GID (glyph ID); the index of this array is a GID too. Therefore,
- the length of the array is expected to be same as the maximum GID
- value defined in the `maxp' table, but there are some fonts whose
- LookupTable format 0 is too short to cover all GIDs. FontValidator
- ignores this error silently, ftxvalidator and ftxdumperfuser both
- warn and continue. Similar problems are found in format 3 subtables
- of `kern'. gxvalid warns always and abort if the validation level
- is set to FT_VALIDATE_PARANOID.
-
- 5 fonts include too-short kern format 0 subtables.
- 1 font includes too-short kern format 3 subtable.
-
- 4-3. broken LookupTable format 2 (1/183)
- ----------------------------------------
-
- LookupTable format 2, subformat 4 covers the GID space by a
- collection of segments which are specified by `firstGlyph' and
- `lastGlyph'. Some fonts store `firstGlyph' and `lastGlyph' in
- reverse order, so the segment specification is broken. Apple font
- tools ignore this error silently; a broken segment is ignored as if
- it did not exist. gxvalid warns and normalize the segment at
- FT_VALIDATE_DEFAULT, or ignore the segment at FT_VALIDATE_TIGHT, or
- abort at FT_VALIDATE_PARANOID.
-
- 1 font includes broken LookupTable format 2, in the `just' table.
-
- *) It seems that all fonts manufactured by ITC for AppleWorks have
- this error.
-
- 4-4. bad bracketing in glyph property (14/183)
- ----------------------------------------------
-
- GX/AAT defines a `bracketing' property of the glyphs in the `prop'
- table, to control layout features of strings enclosed inside and
- outside of brackets. Some fonts give inappropriate bracket
- properties to glyphs. Apple font tools warn about this error;
- gxvalid warns too and aborts at FT_VALIDATE_PARANOID.
-
- 14 fonts include wrong bracket properties.
-
-
- 4-5. invalid feature number (117/183)
- -------------------------------------
-
- The GX/AAT extension can include 255 different layout features,
- but popular layout features are predefined (see
- https://developer.apple.com/fonts/TrueType-Reference-Manual/RM09/AppendixF.html).
- Some fonts include feature numbers which are incompatible with the
- predefined feature registry.
-
- In our survey, there are 140 fonts including `feat' table.
-
- a) 67 fonts use a feature number which should not be used.
- b) 117 fonts set the wrong feature range (nSetting). This is mostly
- found in the `mort' and `morx' tables.
-
- Apple font tools give no warning, although they cannot recognize
- what the feature is. At FT_VALIDATE_DEFAULT, gxvalid warns but
- continues in both cases (a, b). At FT_VALIDATE_TIGHT, gxvalid warns
- and aborts for (a), but continues for (b). At FT_VALIDATE_PARANOID,
- gxvalid warns and aborts in both cases (a, b).
-
- 4-6. invalid prop version (10/183)
- ----------------------------------
-
- As most TrueType GX tables, the `prop' table must start with a 32bit
- version identifier: 0x00010000, 0x00020000 or 0x00030000. But some
- fonts store nonsense binary data instead. When Apple font tools
- find them, they abort the processing immediately, and the data which
- follows is unhandled. gxvalid does the same.
-
- 10 fonts include broken `prop' version.
-
- All of these fonts are classic TrueType fonts for the Japanese
- script, manufactured by Apple.
-
- 4-7. unknown resource name (2/183)
- ------------------------------------
-
- NOTE: THIS IS NOT A TRUETYPE GX ERROR.
-
- If a TrueType font is stored in the resource fork or in dfont
- format, the data must be tagged as `sfnt' in the resource fork index
- to invoke TrueType font handler for the data. But the TrueType font
- data in `Keyboard.dfont' is tagged as `kbd', and that in
- `LastResort.dfont' is tagged as `lst'. Apple font tools can detect
- that the data is in TrueType format and successfully validate them.
- Maybe this is possible because they are known to be dfont. The
- current implementation of the resource fork driver of FreeType
- cannot do that, thus gxvalid cannot validate them.
-
- 2 fonts use an unknown tag for the TrueType font resource.
-
-5. `kern' table issues
-----------------------
-
- In common terminology of TrueType, `kern' is classified as a basic and
- platform-independent table. But there are Apple extensions of `kern',
- and there is an extension which requires a GX state machine for
- contextual kerning. Therefore, gxvalid includes a special validator
- for `kern' tables. Unfortunately, there is no exact algorithm to
- check Apple's extension, so gxvalid includes a heuristic algorithm to
- find the proper validation routines for all possible data formats,
- including the data format for Microsoft. By calling
- classic_kern_validate() instead of gxv_validate(), you can specify the
- `kern' format explicitly. However, current FreeType2 uses Microsoft
- `kern' format only, others are ignored (and should be handled in a
- library one level higher than FreeType).
-
- 5-1. History
- ------------
-
- The original 16bit version of `kern' was designed by Apple in the
- pre-GX era, and it was also approved by Microsoft. Afterwards,
- Apple designed a new 32bit version of the `kern' table. According
- to the documentation, the difference between the 16bit and 32bit
- version is only the size of variables in the `kern' header. In the
- following, we call the original 16bit version as `classic', and
- 32bit version as `new'.
-
- 5-2. Versions and dialects which should be differentiated
- ---------------------------------------------------------
-
- The `kern' table consists of a table header and several subtables.
- The version number which identifies a `classic' or a `new' version
- is explicitly written in the table header, but there are
- undocumented differences between Microsoft's and Apple's formats.
- It is called a `dialect' in the following. There are three cases
- which should be handled: the new Apple-dialect, the classic
- Apple-dialect, and the classic Microsoft-dialect. An analysis of
- the formats and the auto detection algorithm of gxvalid is described
- in the following.
-
- 5-2-1. Version detection: classic and new kern
- ----------------------------------------------
-
- According to Apple TrueType specification, there are only two
- differences between the classic and the new:
-
- - The `kern' table header starts with the version number.
- The classic version starts with 0x0000 (16bit),
- the new version starts with 0x00010000 (32bit).
-
- - In the `kern' table header, the number of subtables follows
- the version number.
- In the classic version, it is stored as a 16bit value.
- In the new version, it is stored as a 32bit value.
-
- From Apple font tool's output (DumpKERN is also tested in addition
- to the three Apple font tools in above), there is another
- undocumented difference. In the new version, the subtable header
- includes a 16bit variable named `tupleIndex' which does not exist
- in the classic version.
-
- The new version can store all subtable formats (0, 1, 2, and 3),
- but the Apple TrueType specification does not mention the subtable
- formats available in the classic version.
-
- 5-2-2. Available subtable formats in classic version
- ----------------------------------------------------
-
- Although the Apple TrueType specification recommends to use the
- classic version in the case if the font is designed for both the
- Apple and Microsoft platforms, it does not document the available
- subtable formats in the classic version.
-
- According to the Microsoft TrueType specification, the subtable
- format assured for Windows and OS/2 support is only subtable
- format 0. The Microsoft TrueType specification also describes
- subtable format 2, but does not mention which platforms support
- it. Subtable formats 1, 3, and higher are documented as reserved
- for future use. Therefore, the classic version can store subtable
- formats 0 and 2, at least. `ttfdump.exe', a font tool provided by
- Microsoft, ignores the subtable format written in the subtable
- header, and parses the table as if all subtables are in format 0.
-
- `kern' subtable format 1 uses a StateTable, so it cannot be
- utilized without a GX State Machine. Therefore, it is reasonable
- to assume that format 1 (and 3) were introduced after Apple had
- introduced GX and moved to the new 32bit version.
-
- 5-2-3. Apple and Microsoft dialects
- -----------------------------------
-
- The `kern' subtable has a 16bit `coverage' field to describe
- kerning attributes, but bit interpretations by Apple and Microsoft
- are different: For example, Apple uses bits 0-7 to identify the
- subtable, while Microsoft uses bits 8-15.
-
- In addition, due to the output of DumpKERN and FontValidator,
- Apple's bit interpretations of coverage in classic and new version
- are incompatible also. In summary, there are three dialects:
- classic Apple dialect, classic Microsoft dialect, and new Apple
- dialect. The classic Microsoft dialect and the new Apple dialect
- are documented by each vendors' TrueType font specification, but
- the documentation for classic Apple dialect is not available.
-
- For example, in the new Apple dialect, bit 15 is documented as
- `set to 1 if the kerning is vertical'. On the other hand, in
- classic Microsoft dialect, bit 1 is documented as `set to 1 if the
- kerning is horizontal'. From the outputs of DumpKERN and
- FontValidator, classic Apple dialect recognizes 15 as `set to 1
- when the kerning is horizontal'. From the results of similar
- experiments, classic Apple dialect seems to be the Endian reverse
- of the classic Microsoft dialect.
-
- As a conclusion it must be noted that no font tool can identify
- classic Apple dialect or classic Microsoft dialect automatically.
-
- 5-2-4. gxvalid auto dialect detection algorithm
- -----------------------------------------------
-
- The first 16 bits of the `kern' table are enough to identify the
- version:
-
- - if the first 16 bits are 0x0000, the `kern' table is in
- classic Apple dialect or classic Microsoft dialect
- - if the first 16 bits are 0x0001, and next 16 bits are 0x0000,
- the kern table is in new Apple dialect.
-
- If the `kern' table is a classic one, the 16bit `coverage' field
- is checked next. Firstly, the coverage bits are decoded for the
- classic Apple dialect using the following bit masks (this is based
- on DumpKERN output):
-
- 0x8000: 1=horizontal, 0=vertical
- 0x4000: not used
- 0x2000: 1=cross-stream, 0=normal
- 0x1FF0: reserved
- 0x000F: subtable format
-
- If any of reserved bits are set or the subtable bits is
- interpreted as format 1 or 3, we take it as `impossible in classic
- Apple dialect' and retry, using the classic Microsoft dialect.
-
- The most popular coverage in new Apple-dialect: 0x8000,
- The most popular coverage in classic Apple-dialect: 0x0000,
- The most popular coverage in classic Microsoft dialect: 0x0001.
-
- 5-3. Tested fonts
- -----------------
-
- We checked 59 fonts bundled with MacOS and 38 fonts bundled with
- Windows, where all font include a `kern' table.
-
- - fonts bundled with MacOS
- * new Apple dialect
- format 0: 18
- format 2: 1
- format 3: 1
- * classic Apple dialect
- format 0: 14
- * classic Microsoft dialect
- format 0: 15
-
- - fonts bundled with Windows
- * classic Microsoft dialect
- format 0: 38
-
- It looks strange that classic Microsoft-dialect fonts are bundled to
- MacOS: they come from MSIE for MacOS, except of MarkerFelt.dfont.
-
-
- ACKNOWLEDGEMENT
- ---------------
-
- Some parts of gxvalid are derived from both the `gxlayout' module and
- the `otvalid' module. Development of gxlayout was supported by the
- Information-technology Promotion Agency(IPA), Japan.
-
- The detailed analysis of undefined glyph ID utilization in `mort' and
- `morx' tables is provided by George Williams.
-
-------------------------------------------------------------------------
-
-Copyright (C) 2004-2022 by
-suzuki toshiya, Masatake YAMATO, Red hat K.K.,
-David Turner, Robert Wilhelm, and Werner Lemberg.
-
-This file is part of the FreeType project, and may only be used,
-modified, and distributed under the terms of the FreeType project
-license, LICENSE.TXT. By continuing to use, modify, or distribute this
-file you indicate that you have read the license and understand and
-accept it fully.
-
-
---- end of README ---
diff --git a/thirdparty/freetype/src/gzip/README.freetype b/thirdparty/freetype/src/gzip/README.freetype
deleted file mode 100644
index 493b807198..0000000000
--- a/thirdparty/freetype/src/gzip/README.freetype
+++ /dev/null
@@ -1,22 +0,0 @@
-Name: zlib
-Short Name: zlib
-URL: http://zlib.net/
-Version: 1.2.12
-License: see `zlib.h`
-
-Description:
-"A massively spiffy yet delicately unobtrusive compression library."
-
-'zlib' is a free, general-purpose, legally unencumbered lossless
-data-compression library. 'zlib' implements the "deflate" compression
-algorithm described by RFC 1951, which combines the LZ77 (Lempel-Ziv)
-algorithm with Huffman coding. zlib also implements the zlib (RFC 1950) and
-gzip (RFC 1952) wrapper formats.
-
-Local Modifications:
-The files in this directory have been prepared as follows.
-
- - Take the unmodified source code files from the zlib distribution that are
- included by `ftgzip.c`.
- - Run zlib's `zlib2ansi` script on all `.c` files.
- - Apply the diff file(s) in the `patches` folder.
diff --git a/thirdparty/freetype/src/gzip/patches/freetype-zlib.diff b/thirdparty/freetype/src/gzip/patches/freetype-zlib.diff
deleted file mode 100644
index 20d84293f3..0000000000
--- a/thirdparty/freetype/src/gzip/patches/freetype-zlib.diff
+++ /dev/null
@@ -1,372 +0,0 @@
-[zlib] Fix zlib sources for compilation with FreeType
-
-We must ensure that they do not issue compiler errors or warnings when they
-are compiled as part of `src/gzip/ftgzip.c`.
-
-* src/gzip/adler32.c: Do not define unused functions when `Z_FREETYPE`
-is set.
-
-* src/gzip/gzguts.h (COPY): Rename to...
-(COPY__): ... this since `COPY` and `COPY_` conflict with enum values,
-which have the same name in `zlib.h`.
-
-* src/gzip/inflate.c, src/gzip/adler32.c: Omit unused function
-declarations when `Z_FREETYPE` is defined.
-
-* src/gzip/zlib.h: Include `ftzconf.h` instead of `zconf.h` to avoid
-conflicts with system-installed headers.
-Omit unused function declarations when `Z_FREETYPE` is defined.
-
-* src/gzip/zutil.h: Use `ft_memxxx` functions instead of `memxxx`.
-Omit unused function declarations when `Z_FREETYPE` is defined.
-
-* src/gzip/inflate.h, src/gzip/inftrees.h: Add header guard macros to
-prevent compiler errors.
-
-diff --git a/src/gzip/adler32.c b/src/gzip/adler32.c
-index be5e8a247..aa032e1dd 100644
---- a/src/gzip/adler32.c
-+++ b/src/gzip/adler32.c
-@@ -7,7 +7,9 @@
-
- #include "zutil.h"
-
-+#ifndef Z_FREETYPE
- local uLong adler32_combine_ OF((uLong adler1, uLong adler2, z_off64_t len2));
-+#endif
-
- #define BASE 65521U /* largest prime smaller than 65536 */
- #define NMAX 5552
-@@ -139,6 +141,8 @@ uLong ZEXPORT adler32(
- return adler32_z(adler, buf, len);
- }
-
-+#ifndef Z_FREETYPE
-+
- /* ========================================================================= */
- local uLong adler32_combine_(
- uLong adler1,
-@@ -184,3 +188,5 @@ uLong ZEXPORT adler32_combine64(
- {
- return adler32_combine_(adler1, adler2, len2);
- }
-+
-+#endif /* !Z_FREETYPE */
-diff --git a/src/gzip/gzguts.h b/src/gzip/gzguts.h
-index 57faf3716..4f09a52a7 100644
---- a/src/gzip/gzguts.h
-+++ b/src/gzip/gzguts.h
-@@ -163,7 +163,7 @@
-
- /* values for gz_state how */
- #define LOOK 0 /* look for a gzip header */
--#define COPY 1 /* copy input directly */
-+#define COPY__ 1 /* copy input directly */
- #define GZIP 2 /* decompress a gzip stream */
-
- /* internal gzip file state data structure */
-diff --git a/src/gzip/inflate.c b/src/gzip/inflate.c
-index 4375557b4..5bf5b815e 100644
---- a/src/gzip/inflate.c
-+++ b/src/gzip/inflate.c
-@@ -99,8 +99,10 @@ local int updatewindow OF((z_streamp strm, const unsigned char FAR *end,
- #ifdef BUILDFIXED
- void makefixed OF((void));
- #endif
-+#ifndef Z_FREETYPE
- local unsigned syncsearch OF((unsigned FAR *have, const unsigned char FAR *buf,
- unsigned len));
-+#endif
-
- local int inflateStateCheck(
- z_streamp strm)
-@@ -245,6 +247,8 @@ int ZEXPORT inflateInit_(
- return inflateInit2_(strm, DEF_WBITS, version, stream_size);
- }
-
-+#ifndef Z_FREETYPE
-+
- int ZEXPORT inflatePrime(
- z_streamp strm,
- int bits,
-@@ -266,6 +270,8 @@ int ZEXPORT inflatePrime(
- return Z_OK;
- }
-
-+#endif /* !Z_FREETYPE */
-+
- /*
- Return state with length and distance decoding tables and index sizes set to
- fixed code decoding. Normally this returns fixed tables from inffixed.h.
-@@ -1312,6 +1318,8 @@ int ZEXPORT inflateEnd(
- return Z_OK;
- }
-
-+#ifndef Z_FREETYPE
-+
- int ZEXPORT inflateGetDictionary(
- z_streamp strm,
- Bytef *dictionary,
-@@ -1471,6 +1479,8 @@ int ZEXPORT inflateSync(
- return Z_OK;
- }
-
-+#endif /* !Z_FREETYPE */
-+
- /*
- Returns true if inflate is currently at the end of a block generated by
- Z_SYNC_FLUSH or Z_FULL_FLUSH. This function is used by one PPP
-@@ -1489,6 +1499,8 @@ int ZEXPORT inflateSyncPoint(
- return state->mode == STORED && state->bits == 0;
- }
-
-+#ifndef Z_FREETYPE
-+
- int ZEXPORT inflateCopy(
- z_streamp dest,
- z_streamp source)
-@@ -1536,6 +1548,8 @@ int ZEXPORT inflateCopy(
- return Z_OK;
- }
-
-+#endif /* !Z_FREETYPE */
-+
- int ZEXPORT inflateUndermine(
- z_streamp strm,
- int subvert)
-@@ -1569,6 +1583,8 @@ int ZEXPORT inflateValidate(
- return Z_OK;
- }
-
-+#ifndef Z_FREETYPE
-+
- long ZEXPORT inflateMark(
- z_streamp strm)
- {
-@@ -1590,3 +1606,5 @@ unsigned long ZEXPORT inflateCodesUsed(
- state = (struct inflate_state FAR *)strm->state;
- return (unsigned long)(state->next - state->codes);
- }
-+
-+#endif /* !Z_FREETYPE */
-diff --git a/src/gzip/inflate.h b/src/gzip/inflate.h
-index f127b6b1f..c6f5a52e1 100644
---- a/src/gzip/inflate.h
-+++ b/src/gzip/inflate.h
-@@ -3,6 +3,9 @@
- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-
-+#ifndef INFLATE_H
-+#define INFLATE_H
-+
- /* WARNING: this file should *not* be used by applications. It is
- part of the implementation of the compression library and is
- subject to change. Applications should only use zlib.h.
-@@ -124,3 +127,5 @@ struct inflate_state {
- int back; /* bits back of last unprocessed length/lit */
- unsigned was; /* initial length of match */
- };
-+
-+#endif /* INFLATE_H */
-diff --git a/src/gzip/inftrees.h b/src/gzip/inftrees.h
-index baa53a0b1..c94eb78b5 100644
---- a/src/gzip/inftrees.h
-+++ b/src/gzip/inftrees.h
-@@ -3,6 +3,9 @@
- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-
-+#ifndef INFTREES_H
-+#define INFTREES_H
-+
- /* WARNING: this file should *not* be used by applications. It is
- part of the implementation of the compression library and is
- subject to change. Applications should only use zlib.h.
-@@ -60,3 +63,5 @@ typedef enum {
- int ZLIB_INTERNAL inflate_table OF((codetype type, unsigned short FAR *lens,
- unsigned codes, code FAR * FAR *table,
- unsigned FAR *bits, unsigned short FAR *work));
-+
-+#endif /* INFTREES_H_ */
-diff --git a/src/gzip/zlib.h b/src/gzip/zlib.h
-index 4a98e38bf..d760140c2 100644
---- a/src/gzip/zlib.h
-+++ b/src/gzip/zlib.h
-@@ -31,7 +31,7 @@
- #ifndef ZLIB_H
- #define ZLIB_H
-
--#include "zconf.h"
-+#include "ftzconf.h"
-
- #ifdef __cplusplus
- extern "C" {
-@@ -211,6 +211,8 @@ typedef gz_header FAR *gz_headerp;
-
- #define Z_NULL 0 /* for initializing zalloc, zfree, opaque */
-
-+#ifndef Z_FREETYPE
-+
- #define zlib_version zlibVersion()
- /* for compatibility with versions < 1.0.2 */
-
-@@ -246,7 +248,6 @@ ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level));
- this will be done by deflate().
- */
-
--
- ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush));
- /*
- deflate compresses as much data as possible, and stops when the input
-@@ -373,6 +374,7 @@ ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm));
- deallocated).
- */
-
-+#endif /* !Z_FREETYPE */
-
- /*
- ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm));
-@@ -534,6 +536,8 @@ ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm));
- The following functions are needed only in some special applications.
- */
-
-+#ifndef Z_FREETYPE
-+
- /*
- ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm,
- int level,
-@@ -956,6 +960,8 @@ ZEXTERN int ZEXPORT inflateCopy OF((z_streamp dest,
- destination.
- */
-
-+#endif /* !Z_FREETYPE */
-+
- ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm));
- /*
- This function is equivalent to inflateEnd followed by inflateInit,
-@@ -980,6 +986,8 @@ ZEXTERN int ZEXPORT inflateReset2 OF((z_streamp strm,
- the windowBits parameter is invalid.
- */
-
-+#ifndef Z_FREETYPE
-+
- ZEXTERN int ZEXPORT inflatePrime OF((z_streamp strm,
- int bits,
- int value));
-@@ -1069,6 +1077,8 @@ ZEXTERN int ZEXPORT inflateGetHeader OF((z_streamp strm,
- stream state was inconsistent.
- */
-
-+#endif /* !Z_FREETYPE */
-+
- /*
- ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits,
- unsigned char FAR *window));
-@@ -1095,6 +1105,8 @@ typedef unsigned (*in_func) OF((void FAR *,
- z_const unsigned char FAR * FAR *));
- typedef int (*out_func) OF((void FAR *, unsigned char FAR *, unsigned));
-
-+#ifndef Z_FREETYPE
-+
- ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm,
- in_func in, void FAR *in_desc,
- out_func out, void FAR *out_desc));
-@@ -1214,6 +1226,8 @@ ZEXTERN uLong ZEXPORT zlibCompileFlags OF((void));
- 27-31: 0 (reserved)
- */
-
-+#endif /* !Z_FREETYPE */
-+
- #ifndef Z_SOLO
-
- /* utility functions */
-@@ -1742,6 +1756,8 @@ ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len));
- if (crc != original_crc) error();
- */
-
-+#ifndef Z_FREETYPE
-+
- ZEXTERN uLong ZEXPORT crc32_z OF((uLong crc, const Bytef *buf,
- z_size_t len));
- /*
-@@ -1822,6 +1838,19 @@ ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits,
- ZLIB_VERSION, (int)sizeof(z_stream))
- #endif
-
-+#else /* Z_FREETYPE */
-+
-+
-+ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int windowBits,
-+ const char *version, int stream_size));
-+
-+# define inflateInit2(strm, windowBits) \
-+ inflateInit2_((strm), (windowBits), ZLIB_VERSION, \
-+ (int)sizeof(z_stream))
-+
-+#endif /* Z_FREETYPE */
-+
-+
- #ifndef Z_SOLO
-
- /* gzgetc() macro and its supporting function and exposed data structure. Note
-@@ -1901,13 +1930,16 @@ ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */
-
- #else /* Z_SOLO */
-
-+#ifndef Z_FREETYPE
- ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t));
- ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t));
- ZEXTERN uLong ZEXPORT crc32_combine_gen OF((z_off_t));
-+#endif
-
- #endif /* !Z_SOLO */
-
- /* undocumented functions */
-+#ifndef Z_FREETYPE
- ZEXTERN const char * ZEXPORT zError OF((int));
- ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp));
- ZEXTERN const z_crc_t FAR * ZEXPORT get_crc_table OF((void));
-@@ -1927,6 +1959,7 @@ ZEXTERN int ZEXPORTVA gzvprintf Z_ARG((gzFile file,
- va_list va));
- # endif
- #endif
-+#endif /* !Z_FREETYPE */
-
- #ifdef __cplusplus
- }
-diff --git a/src/gzip/zutil.h b/src/gzip/zutil.h
-index d9a20ae1b..14f0f1a85 100644
---- a/src/gzip/zutil.h
-+++ b/src/gzip/zutil.h
-@@ -188,6 +188,8 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
- #pragma warn -8066
- #endif
-
-+#ifndef Z_FREETYPE
-+
- /* provide prototypes for these when building zlib without LFS */
- #if !defined(_WIN32) && \
- (!defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0)
-@@ -195,6 +197,8 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
- ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t));
- #endif
-
-+#endif /* !Z_FREETYPE */
-+
- /* common defaults */
-
- #ifndef OS_CODE
-@@ -226,9 +230,9 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
- # define zmemcmp _fmemcmp
- # define zmemzero(dest, len) _fmemset(dest, 0, len)
- # else
--# define zmemcpy memcpy
--# define zmemcmp memcmp
--# define zmemzero(dest, len) memset(dest, 0, len)
-+# define zmemcpy ft_memcpy
-+# define zmemcmp ft_memcmp
-+# define zmemzero(dest, len) ft_memset(dest, 0, len)
- # endif
- #else
- void ZLIB_INTERNAL zmemcpy OF((Bytef* dest, const Bytef* source, uInt len));
diff --git a/thirdparty/freetype/src/pcf/README b/thirdparty/freetype/src/pcf/README
deleted file mode 100644
index 09ea970eda..0000000000
--- a/thirdparty/freetype/src/pcf/README
+++ /dev/null
@@ -1,96 +0,0 @@
- FreeType font driver for PCF fonts
-
- Francesco Zappa Nardelli
- <francesco.zappa.nardelli@ens.fr>
-
-
-Introduction
-************
-
-PCF (Portable Compiled Format) is a binary bitmap font format, largely used
-in X world. This code implements a PCF driver for the FreeType library.
-Glyph images are loaded into memory only on demand, thus leading to a small
-memory footprint.
-
-Information on the PCF font format can only be worked out from
-`pcfread.c', and `pcfwrite.c', to be found, for instance, in the XFree86
-(www.xfree86.org) source tree (xc/lib/font/bitmap/).
-
-Many good bitmap fonts in bdf format come with XFree86: they can be
-compiled into the pcf format using the `bdftopcf' utility.
-
-
-Supported hardware
-******************
-
-The driver has been tested on linux/x86 and sunos5.5/sparc. In both
-cases the compiler was gcc. When back in Paris, I will test it also
-on linux/alpha.
-
-
-Encodings
-*********
-
-Use `FT_Get_BDF_Charset_ID' to access the encoding and registry.
-
-The driver always exports `ft_encoding_none' as face->charmap.encoding.
-FT_Get_Char_Index() behavior is unmodified, that is, it converts the ULong
-value given as argument into the corresponding glyph number.
-
-
-Known problems
-**************
-
-- dealing explicitly with encodings breaks the uniformity of FreeType 2
- API.
-
-- except for encodings properties, client applications have no
- visibility of the PCF_Face object. This means that applications
- cannot directly access font tables and are obliged to trust
- FreeType.
-
-- currently, glyph names and ink_metrics are ignored.
-
-I plan to give full visibility of the PCF_Face object in the next
-release of the driver, thus implementing also glyph names and
-ink_metrics.
-
-- height is defined as (ascent - descent). Is this correct?
-
-- if unable to read size information from the font, PCF_Init_Face
- sets available_size->width and available_size->height to 12.
-
-- too many english grammar errors in the readme file :-(
-
-
-License
-*******
-
-Copyright (C) 2000 by Francesco Zappa Nardelli
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-
-Credits
-*******
-
-Keith Packard wrote the pcf driver found in XFree86. His work is at
-the same time the specification and the sample implementation of the
-PCF format. Undoubtedly, this driver is inspired from his work.
diff --git a/thirdparty/freetype/src/psnames/rules.mk b/thirdparty/freetype/src/psnames/rules.mk
deleted file mode 100644
index 3768e2f1d8..0000000000
--- a/thirdparty/freetype/src/psnames/rules.mk
+++ /dev/null
@@ -1,73 +0,0 @@
-#
-# FreeType 2 psnames driver configuration rules
-#
-
-
-# Copyright (C) 1996-2022 by
-# David Turner, Robert Wilhelm, and Werner Lemberg.
-#
-# This file is part of the FreeType project, and may only be used, modified,
-# and distributed under the terms of the FreeType project license,
-# LICENSE.TXT. By continuing to use, modify, or distribute this file you
-# indicate that you have read the license and understand and accept it
-# fully.
-
-
-# psnames driver directory
-#
-PSNAMES_DIR := $(SRC_DIR)/psnames
-
-
-# compilation flags for the driver
-#
-PSNAMES_COMPILE := $(CC) $(ANSIFLAGS) \
- $I$(subst /,$(COMPILER_SEP),$(PSNAMES_DIR)) \
- $(INCLUDE_FLAGS) \
- $(FT_CFLAGS)
-
-
-# psnames driver sources (i.e., C files)
-#
-PSNAMES_DRV_SRC := $(PSNAMES_DIR)/psmodule.c
-
-
-# psnames driver headers
-#
-PSNAMES_DRV_H := $(PSNAMES_DRV_SRC:%.c=%.h) \
- $(PSNAMES_DIR)/psnamerr.h \
- $(PSNAMES_DIR)/pstables.h
-
-
-# psnames driver object(s)
-#
-# PSNAMES_DRV_OBJ_M is used during `multi' builds
-# PSNAMES_DRV_OBJ_S is used during `single' builds
-#
-PSNAMES_DRV_OBJ_M := $(PSNAMES_DRV_SRC:$(PSNAMES_DIR)/%.c=$(OBJ_DIR)/%.$O)
-PSNAMES_DRV_OBJ_S := $(OBJ_DIR)/psnames.$O
-
-# psnames driver source file for single build
-#
-PSNAMES_DRV_SRC_S := $(PSNAMES_DIR)/psnames.c
-
-
-# psnames driver - single object
-#
-$(PSNAMES_DRV_OBJ_S): $(PSNAMES_DRV_SRC_S) $(PSNAMES_DRV_SRC) \
- $(FREETYPE_H) $(PSNAMES_DRV_H)
- $(PSNAMES_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(PSNAMES_DRV_SRC_S))
-
-
-# psnames driver - multiple objects
-#
-$(OBJ_DIR)/%.$O: $(PSNAMES_DIR)/%.c $(FREETYPE_H) $(PSNAMES_DRV_H)
- $(PSNAMES_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<)
-
-
-# update main driver object lists
-#
-DRV_OBJS_S += $(PSNAMES_DRV_OBJ_S)
-DRV_OBJS_M += $(PSNAMES_DRV_OBJ_M)
-
-
-# EOF
diff --git a/thirdparty/freetype/src/raster/module.mk b/thirdparty/freetype/src/raster/module.mk
deleted file mode 100644
index b56a4902ba..0000000000
--- a/thirdparty/freetype/src/raster/module.mk
+++ /dev/null
@@ -1,23 +0,0 @@
-#
-# FreeType 2 renderer module definition
-#
-
-
-# Copyright (C) 1996-2022 by
-# David Turner, Robert Wilhelm, and Werner Lemberg.
-#
-# This file is part of the FreeType project, and may only be used, modified,
-# and distributed under the terms of the FreeType project license,
-# LICENSE.TXT. By continuing to use, modify, or distribute this file you
-# indicate that you have read the license and understand and accept it
-# fully.
-
-
-FTMODULE_H_COMMANDS += RASTER_MODULE
-
-define RASTER_MODULE
-$(OPEN_DRIVER) FT_Renderer_Class, ft_raster1_renderer_class $(CLOSE_DRIVER)
-$(ECHO_DRIVER)raster $(ECHO_DRIVER_DESC)monochrome bitmap renderer$(ECHO_DRIVER_DONE)
-endef
-
-# EOF
diff --git a/thirdparty/recastnavigation/Recast/Include/RecastAlloc.h b/thirdparty/recastnavigation/Recast/Include/RecastAlloc.h
index e436af9a01..071278d659 100644
--- a/thirdparty/recastnavigation/Recast/Include/RecastAlloc.h
+++ b/thirdparty/recastnavigation/Recast/Include/RecastAlloc.h
@@ -22,7 +22,7 @@
#include <stddef.h>
#include <stdint.h>
-#include <RecastAssert.h>
+#include "RecastAssert.h"
/// Provides hint values to the memory allocator on how long the
/// memory is expected to be used.
@@ -106,6 +106,8 @@ class rcVectorBase {
// Creates an array of the given size, copies all of this vector's data into it, and returns it.
T* allocate_and_copy(rcSizeType size);
void resize_impl(rcSizeType size, const T* value);
+ // Requires: min_capacity > m_cap.
+ rcSizeType get_new_capacity(rcSizeType min_capacity);
public:
typedef rcSizeType size_type;
typedef T value_type;
@@ -196,8 +198,7 @@ void rcVectorBase<T, H>::push_back(const T& value) {
return;
}
- rcAssert(RC_SIZE_MAX / 2 >= m_size);
- rcSizeType new_cap = m_size ? 2*m_size : 1;
+ const rcSizeType new_cap = get_new_capacity(m_cap + 1);
T* data = allocate_and_copy(new_cap);
// construct between allocate and destroy+free in case value is
// in this vector.
@@ -208,25 +209,44 @@ void rcVectorBase<T, H>::push_back(const T& value) {
rcFree(m_data);
m_data = data;
}
+
+template <typename T, rcAllocHint H>
+rcSizeType rcVectorBase<T, H>::get_new_capacity(rcSizeType min_capacity) {
+ rcAssert(min_capacity <= RC_SIZE_MAX);
+ if (rcUnlikely(m_cap >= RC_SIZE_MAX / 2))
+ return RC_SIZE_MAX;
+ return 2 * m_cap > min_capacity ? 2 * m_cap : min_capacity;
+}
+
template <typename T, rcAllocHint H>
void rcVectorBase<T, H>::resize_impl(rcSizeType size, const T* value) {
if (size < m_size) {
destroy_range(size, m_size);
m_size = size;
} else if (size > m_size) {
- T* new_data = allocate_and_copy(size);
- // We defer deconstructing/freeing old data until after constructing
- // new elements in case "value" is there.
- if (value) {
- construct_range(new_data + m_size, new_data + size, *value);
+ if (size <= m_cap) {
+ if (value) {
+ construct_range(m_data + m_size, m_data + size, *value);
+ } else {
+ construct_range(m_data + m_size, m_data + size);
+ }
+ m_size = size;
} else {
- construct_range(new_data + m_size, new_data + size);
+ const rcSizeType new_cap = get_new_capacity(size);
+ T* new_data = allocate_and_copy(new_cap);
+ // We defer deconstructing/freeing old data until after constructing
+ // new elements in case "value" is there.
+ if (value) {
+ construct_range(new_data + m_size, new_data + size, *value);
+ } else {
+ construct_range(new_data + m_size, new_data + size);
+ }
+ destroy_range(0, m_size);
+ rcFree(m_data);
+ m_data = new_data;
+ m_cap = new_cap;
+ m_size = size;
}
- destroy_range(0, m_size);
- rcFree(m_data);
- m_data = new_data;
- m_cap = size;
- m_size = size;
}
}
template <typename T, rcAllocHint H>
@@ -303,6 +323,7 @@ public:
rcIntArray(int n) : m_impl(n, 0) {}
void push(int item) { m_impl.push_back(item); }
void resize(int size) { m_impl.resize(size); }
+ void clear() { m_impl.clear(); }
int pop()
{
int v = m_impl.back();
diff --git a/thirdparty/recastnavigation/Recast/Source/RecastContour.cpp b/thirdparty/recastnavigation/Recast/Source/RecastContour.cpp
index 6574c11b6b..1293d4fbde 100644
--- a/thirdparty/recastnavigation/Recast/Source/RecastContour.cpp
+++ b/thirdparty/recastnavigation/Recast/Source/RecastContour.cpp
@@ -921,8 +921,8 @@ bool rcBuildContours(rcContext* ctx, rcCompactHeightfield& chf,
continue;
const unsigned char area = chf.areas[i];
- verts.resize(0);
- simplified.resize(0);
+ verts.clear();
+ simplified.clear();
ctx->startTimer(RC_TIMER_BUILD_CONTOURS_TRACE);
walkContour(x, y, i, chf, flags, verts);
diff --git a/thirdparty/recastnavigation/Recast/Source/RecastMeshDetail.cpp b/thirdparty/recastnavigation/Recast/Source/RecastMeshDetail.cpp
index 9a423cab8a..1999200c1a 100644
--- a/thirdparty/recastnavigation/Recast/Source/RecastMeshDetail.cpp
+++ b/thirdparty/recastnavigation/Recast/Source/RecastMeshDetail.cpp
@@ -653,8 +653,8 @@ static bool buildPolyDetail(rcContext* ctx, const float* in, const int nin,
for (int i = 0; i < nin; ++i)
rcVcopy(&verts[i*3], &in[i*3]);
- edges.resize(0);
- tris.resize(0);
+ edges.clear();
+ tris.clear();
const float cs = chf.cs;
const float ics = 1.0f/cs;
@@ -803,7 +803,7 @@ static bool buildPolyDetail(rcContext* ctx, const float* in, const int nin,
int x1 = (int)ceilf(bmax[0]/sampleDist);
int z0 = (int)floorf(bmin[2]/sampleDist);
int z1 = (int)ceilf(bmax[2]/sampleDist);
- samples.resize(0);
+ samples.clear();
for (int z = z0; z < z1; ++z)
{
for (int x = x0; x < x1; ++x)
@@ -864,8 +864,8 @@ static bool buildPolyDetail(rcContext* ctx, const float* in, const int nin,
// Create new triangulation.
// TODO: Incremental add instead of full rebuild.
- edges.resize(0);
- tris.resize(0);
+ edges.clear();
+ tris.clear();
delaunayHull(ctx, nverts, verts, nhull, hull, tris, edges);
}
}
@@ -935,7 +935,7 @@ static void seedArrayWithPolyCenter(rcContext* ctx, const rcCompactHeightfield&
pcy /= npoly;
// Use seeds array as a stack for DFS
- array.resize(0);
+ array.clear();
array.push(startCellX);
array.push(startCellY);
array.push(startSpanIndex);
@@ -1001,7 +1001,7 @@ static void seedArrayWithPolyCenter(rcContext* ctx, const rcCompactHeightfield&
rcSwap(dirs[directDir], dirs[3]);
}
- array.resize(0);
+ array.clear();
// getHeightData seeds are given in coordinates with borders
array.push(cx+bs);
array.push(cy+bs);
@@ -1030,7 +1030,7 @@ static void getHeightData(rcContext* ctx, const rcCompactHeightfield& chf,
// Note: Reads to the compact heightfield are offset by border size (bs)
// since border size offset is already removed from the polymesh vertices.
- queue.resize(0);
+ queue.clear();
// Set all heights to RC_UNSET_HEIGHT.
memset(hp.data, 0xff, sizeof(unsigned short)*hp.width*hp.height);
diff --git a/thirdparty/recastnavigation/Recast/Source/RecastRegion.cpp b/thirdparty/recastnavigation/Recast/Source/RecastRegion.cpp
index e1fc0ee788..48318688bc 100644
--- a/thirdparty/recastnavigation/Recast/Source/RecastRegion.cpp
+++ b/thirdparty/recastnavigation/Recast/Source/RecastRegion.cpp
@@ -650,7 +650,7 @@ static bool mergeRegions(rcRegion& rega, rcRegion& regb)
return false;
// Merge neighbours.
- rega.connections.resize(0);
+ rega.connections.clear();
for (int i = 0, ni = acon.size(); i < ni-1; ++i)
rega.connections.push(acon[(insa+1+i) % ni]);
@@ -876,8 +876,8 @@ static bool mergeAndFilterRegions(rcContext* ctx, int minRegionArea, int mergeRe
// Also keep track of the regions connects to a tile border.
bool connectsToBorder = false;
int spanCount = 0;
- stack.resize(0);
- trace.resize(0);
+ stack.clear();
+ trace.clear();
reg.visited = true;
stack.push(i);
@@ -1068,7 +1068,7 @@ static bool mergeAndFilterLayerRegions(rcContext* ctx, int minRegionArea,
{
const rcCompactCell& c = chf.cells[x+y*w];
- lregs.resize(0);
+ lregs.clear();
for (int i = (int)c.index, ni = (int)(c.index+c.count); i < ni; ++i)
{
@@ -1139,7 +1139,7 @@ static bool mergeAndFilterLayerRegions(rcContext* ctx, int minRegionArea,
// Start search.
root.id = layerId;
- stack.resize(0);
+ stack.clear();
stack.push(i);
while (stack.size() > 0)
diff --git a/thirdparty/xatlas/xatlas.cpp b/thirdparty/xatlas/xatlas.cpp
index d92ef1a83a..5c5c57ecab 100644
--- a/thirdparty/xatlas/xatlas.cpp
+++ b/thirdparty/xatlas/xatlas.cpp
@@ -4753,13 +4753,10 @@ public:
Vector2 *v = m_vertexBuffers[m_activeVertexBuffer];
v[m_numVertices] = v[0];
m_area = 0;
- float centroidx = 0, centroidy = 0;
for (uint32_t k = 0; k < m_numVertices; k++) {
// http://local.wasp.uwa.edu.au/~pbourke/geometry/polyarea/
float f = v[k].x * v[k + 1].y - v[k + 1].x * v[k].y;
m_area += f;
- centroidx += f * (v[k].x + v[k + 1].x);
- centroidy += f * (v[k].y + v[k + 1].y);
}
m_area = 0.5f * fabsf(m_area);
}
@@ -9089,7 +9086,6 @@ AddMeshError AddMesh(Atlas *atlas, const MeshDecl &meshDecl, uint32_t meshCountH
const uint32_t kMaxWarnings = 50;
uint32_t warningCount = 0;
internal::Array<uint32_t> triIndices;
- uint32_t firstFaceIndex = 0;
internal::Triangulator triangulator;
for (uint32_t face = 0; face < faceCount; face++) {
// Decode face indices.
@@ -9199,7 +9195,6 @@ AddMeshError AddMesh(Atlas *atlas, const MeshDecl &meshDecl, uint32_t meshCountH
for (uint32_t i = 0; i < triIndices.size(); i++)
meshPolygonMapping->triangleToPolygonIndicesMap.push_back(triIndices[i]);
}
- firstFaceIndex += faceVertexCount;
}
if (warningCount > kMaxWarnings)
XA_PRINT(" %u additional warnings truncated\n", warningCount - kMaxWarnings);