gboisse / gfx

A minimalist and easy to use graphics API.
MIT License
502 stars 36 forks source link

Enable assert macros on release #145

Open pawkubik opened 1 month ago

pawkubik commented 1 month ago

The current master fails on Release mode with MSVC:

[build] gfx.cpp(8413): error C2220: the following warning is treated as an error
[build] gfx.cpp(7716) : warning C6011: Dereferencing NULL pointer 'parameter.parameter_'. : Lines: 7704, 7705, 7706, 7708, 7711, 7712, 7713, 7714, 7715, 7716

There is GFX_ASSERT(parameter.parameter_ != nullptr) macro that stops the flow of the function and avoids the dereferencing, but it was only enabled in the Debug mode.

I changed it to occur in both Debug and Release and changed GFX_BREAKPOINT to no-op in Release mode.