On Thu, 22 Dec 2022 23:05:03 GMT, Kim Barrett <kbarr...@openjdk.org> wrote:
> Please review this change to provide and use mechanisms for dealing with uses > of the standard assert macro (from <assert.h> or <cassert>) in 3rd party code > that we use in HotSpot. > > We provide a pair of utility header files, to be included before and after a > header that may use (and so include) the standard assert macro. These new > headers provide a scope in which the HotSpot assert macro is not defined, and > then reinstated after. > > We also define NDEBUG in release builds of HotSpot, so any uses of the > standard assert macro in such 3rd party code will be disabled. > > Finally, we use the new utility headers in some gtests and in our gtest > wrapper header (unittest.hpp), eliminating problems the gtest implementation > and with some versions of some standard libraries that the tests use. > > Testing: > mach5 tier1 This pull request has now been integrated. Changeset: 3e2314d0 Author: Kim Barrett <kbarr...@openjdk.org> URL: https://git.openjdk.org/jdk/commit/3e2314d08218dc8a4f4fc61bd4e1d5e58a0129c7 Stats: 122 lines in 8 files changed: 102 ins; 16 del; 4 mod 8299254: Support dealing with standard assert macro Reviewed-by: erikj, xuelei, dholmes, mikael ------------- PR: https://git.openjdk.org/jdk/pull/11770