mirror of
https://github.com/mkxp-z/mkxp-z.git
synced 2025-08-31 11:13:03 +02:00
Patch boost_assert to use stb_sprintf on platforms with no snprintf implementation
This commit is contained in:
parent
3d044087e0
commit
08ad3e9f8f
1 changed files with 12 additions and 5 deletions
|
@ -1,13 +1,20 @@
|
|||
# Makes Boost use `sprintf` instead of `snprintf` on platforms with no `snprintf` support.
|
||||
# Polyfills `std::snprintf` on platforms where it isn't provided by the C++ standard library.
|
||||
|
||||
--- a/include/boost/assert/source_location.hpp
|
||||
+++ b/include/boost/assert/source_location.hpp
|
||||
@@ -76,7 +76,7 @@ public:
|
||||
@@ -76,11 +76,11 @@ public:
|
||||
# pragma warning( disable: 4996 )
|
||||
#endif
|
||||
|
||||
-#if ( defined(_MSC_VER) && _MSC_VER < 1900 ) || ( defined(__MINGW32__) && !defined(__MINGW64_VERSION_MAJOR) )
|
||||
+#if ( defined(_MSC_VER) && _MSC_VER < 1900 ) || ( defined(__MINGW32__) && !defined(__MINGW64_VERSION_MAJOR) ) || defined(MKXPZ_NO_SNPRINTF)
|
||||
# define BOOST_ASSERT_SNPRINTF(buffer, format, arg) std::sprintf(buffer, format, arg)
|
||||
#else
|
||||
-# define BOOST_ASSERT_SNPRINTF(buffer, format, arg) std::sprintf(buffer, format, arg)
|
||||
-#else
|
||||
+
|
||||
+
|
||||
+#include "../../../../../src/mkxp-polyfill.h"
|
||||
# define BOOST_ASSERT_SNPRINTF(buffer, format, arg) std::snprintf(buffer, sizeof(buffer)/sizeof(buffer[0]), format, arg)
|
||||
-#endif
|
||||
+
|
||||
|
||||
std::string to_string() const
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue