Browse Source

Update assert API to latest bx.

Branimir Karadžić 3 months ago
parent
commit
a1a2ae3c12
2 changed files with 8 additions and 11 deletions
  1. 7 7
      src/bimg_p.h
  2. 1 4
      src/image_decode.cpp

+ 7 - 7
src/bimg_p.h

@@ -31,13 +31,13 @@
 		}                                             \
 		}                                             \
 	BX_MACRO_BLOCK_END
 	BX_MACRO_BLOCK_END
 
 
-#define _BIMG_ASSERT(_condition, _format, ...)                                                                 \
-	BX_MACRO_BLOCK_BEGIN                                                                                       \
-		if (!BX_IGNORE_C4127(_condition)                                                                       \
-		&&  bx::assertFunction(bx::Location::current(), "ASSERT " #_condition " -> " _format, ##__VA_ARGS__) ) \
-		{                                                                                                      \
-			bx::debugBreak();                                                                                  \
-		}                                                                                                      \
+#define _BIMG_ASSERT(_condition, _format, ...)                                                                    \
+	BX_MACRO_BLOCK_BEGIN                                                                                          \
+		if (!BX_IGNORE_C4127(_condition)                                                                          \
+		&&  bx::assertFunction(bx::Location::current(), 0, "ASSERT " #_condition " -> " _format, ##__VA_ARGS__) ) \
+		{                                                                                                         \
+			bx::debugBreak();                                                                                     \
+		}                                                                                                         \
 	BX_MACRO_BLOCK_END
 	BX_MACRO_BLOCK_END
 
 
 #include <bimg/bimg.h>
 #include <bimg/bimg.h>

+ 1 - 4
src/image_decode.cpp

@@ -60,13 +60,10 @@ BX_PRAGMA_DIAGNOSTIC_IGNORED_CLANG_GCC("-Wshadow");
 BX_PRAGMA_DIAGNOSTIC_IGNORED_CLANG_GCC("-Wsign-compare");
 BX_PRAGMA_DIAGNOSTIC_IGNORED_CLANG_GCC("-Wsign-compare");
 BX_PRAGMA_DIAGNOSTIC_IGNORED_GCC("-Wunused-but-set-variable");
 BX_PRAGMA_DIAGNOSTIC_IGNORED_GCC("-Wunused-but-set-variable");
 BX_PRAGMA_DIAGNOSTIC_IGNORED_GCC("-Warray-bounds");
 BX_PRAGMA_DIAGNOSTIC_IGNORED_GCC("-Warray-bounds");
-#if BX_COMPILER_GCC >= 60000
 BX_PRAGMA_DIAGNOSTIC_IGNORED_GCC("-Wmisleading-indentation");
 BX_PRAGMA_DIAGNOSTIC_IGNORED_GCC("-Wmisleading-indentation");
 BX_PRAGMA_DIAGNOSTIC_IGNORED_GCC("-Wshift-negative-value");
 BX_PRAGMA_DIAGNOSTIC_IGNORED_GCC("-Wshift-negative-value");
-#	if BX_COMPILER_GCC >= 70000
 BX_PRAGMA_DIAGNOSTIC_IGNORED_GCC("-Wimplicit-fallthrough");
 BX_PRAGMA_DIAGNOSTIC_IGNORED_GCC("-Wimplicit-fallthrough");
-#	endif // BX_COMPILER_GCC >= 70000
-#endif // BX_COMPILER_GCC >= 60000_
+BX_PRAGMA_DIAGNOSTIC_IGNORED_MSVC(4505); // unreferenced function with internal linkage has been removed
 #define STBI_MALLOC(_size)        lodepng_malloc(_size)
 #define STBI_MALLOC(_size)        lodepng_malloc(_size)
 #define STBI_REALLOC(_ptr, _size) lodepng_realloc(_ptr, _size)
 #define STBI_REALLOC(_ptr, _size) lodepng_realloc(_ptr, _size)
 #define STBI_FREE(_ptr)           lodepng_free(_ptr)
 #define STBI_FREE(_ptr)           lodepng_free(_ptr)