Skip to content
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

Assertion overhaul #1080

Merged
merged 1 commit into from
Nov 27, 2019
Merged

Conversation

lgritz
Copy link
Collaborator

@lgritz lgritz commented Nov 23, 2019

New macros:

  • OSL_ASSERT / OSL_ASSERT_MSG -- always test, always print error if the
    test fails, abort only in debug build.

  • OSL_DASSERT / OSL_DASSERT_MSG -- debug mode only test, print, abort.
    Does nothing for release build.

Eschew the old OIIO macros ASSERT/DASSERT, since it is perferable to not
purposely abort when in release mode.

Ported over from OIIO copies of a few other related macros.

This patch just adds definitions, we will change the existing macros
in subsequent PRs.

New macros:

* OSL_ASSERT / OSL_ASSERT_MSG -- always test, always print error if the
  test fails, abort only in debug build.

* OSL_DASSERT / OSL_DASSERT_MSG -- debug mode only test, print, abort.
  Does nothing for release build.

Eschew the old OIIO macros ASSERT/DASSERT, since it is perferable to not
purposely abort when in release mode.

Ported over from OIIO copies of a few other related macros.

This patch just adds definitions, we will change the existing macros
in subsequent PRs.
@lgritz
Copy link
Collaborator Author

lgritz commented Nov 27, 2019

Merging because this only adds things, can't break existing code.

@lgritz lgritz merged commit 1e68690 into AcademySoftwareFoundation:master Nov 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant