-
-
Notifications
You must be signed in to change notification settings - Fork 126
Description
Macros like CSFML_CALL aim to be friendly to users who incorrectly pass NULL to a parameter that expects a non-null argument. In some cases this results in functions that return placeholder values or short-circuit their logic to avoid a null pointer deref. What I like about this approach is that it results in well-defined behavior in all build types.
What I propose instead is a simpler approach where we eliminate most macros in Internal.h in favor of a simpler CSFML_ASSERT macro that terminates the program (perhaps with a helpful log message) when invalid null arguments are found. I'd rather users be notified ASAP that their code is incorrect than CSFML make attempts to gracefully handle code that users should have never written in the first place.