glib: Use G_CXX_STD_VERSION to check how to behave with C++ compilers

This commit is contained in:
Marco Trevisan (Treviño)
2022-09-14 01:31:39 +02:00
parent f9845abe39
commit 372ab7a964
6 changed files with 35 additions and 38 deletions

View File

@@ -195,7 +195,7 @@ typedef void (*GTestFixtureFunc) (gpointer fixture,
} G_STMT_END
/* Use nullptr in C++ to catch misuse of these macros. */
#if defined(__cplusplus) && __cplusplus >= 201100L
#if G_CXX_STD_CHECK_VERSION (11)
#define g_assert_null(expr) G_STMT_START { if G_LIKELY ((expr) == nullptr) ; else \
g_assertion_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, \
"'" #expr "' should be nullptr"); \