-
Notifications
You must be signed in to change notification settings - Fork 139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create macros for throwing to avoid boilerplate code #151
Conversation
…ptions if the LLGL_DEBUG or LLGL_ENABLE_EXCEPTIONS are defined
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I appreciate the cleanup work here. Another jobsite I wanted to pickup a long time ago and only did so incrementally. I'm fine with the new macro in the public interface for the few places with exceptions, like the container classes, but for all internal code, I'd prefer to stick with the LLGL_TRAP
/LLGL_ASSERT
macros as described in the comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can boil this down to just one new macro in the public interface. I left some more comments in the code changes.
…he LLGL_TRAP and LLGL_ASSERT macros
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found one last issue, the rest looks good. Once you updated this last bit, I'll merge tomorrow after the CIS build went through.
I made some changes to the new exception throwing with e8d86d7. I hope you don't feel blindsided, I appreciate you getting the ball rolling on this matter. The behavior hasn't really changed, this will still throw exceptions if enabled, but in the case they are disabled, this provides a nice callstack to the standard error or breaks the debugger if one is attached. The only downside is that this change only accepts a handful of predefined exceptions such as |
This PR adds a new
Throw.h
file with theLLGL_THROW
andLLGL_THROW_IF
macros that work only if theLLGL_DEBUG
or theLLGL_ENABLE_EXCEPTIONS
are defined. So now LLGL can build with the-fno-exceptions
compiler flag.