• Michael Catanzaro's avatar
    Add separate definitions of g_assert_[non]null() for C++ · 4a0ce6b4
    Michael Catanzaro authored
    In C++ we can use nullptr to ensure g_assert_[non]null() is only called
    with pointers. This will introduce build failures in tests that would
    have previously compiled, but only in C++, and only for code that
    misused these macros. Code using the macros properly will be fine.
    
    This change caught a couple bugs in WebKit's API tests, where I had
    accidentally used these functions improperly. E.g. this is now a build
    failure in C++:
    
    g_assert_null(webkit_context_menu_get_n_items(menu)); /* Oops! */
    
    Either I wanted to use cmpuint there, or I wanted to use
    webkit_context_menu_get_items() to receive a GList* instead.
    
    Another example that will no longer build in C++:
    
    g_assert_null(0); /* Contrived, but 0 is not a pointer! */
    4a0ce6b4
Name
Last commit
Last update
.gitlab-ci Loading commit data...
build Loading commit data...
docs Loading commit data...
fuzzing Loading commit data...
gio Loading commit data...
glib Loading commit data...
gmodule Loading commit data...
gobject Loading commit data...
gthread Loading commit data...
m4macros Loading commit data...
po Loading commit data...
subprojects Loading commit data...
tests Loading commit data...
.dir-locals.el Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
.gitlab-ci.yml Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTING.md Loading commit data...
COPYING Loading commit data...
HACKING Loading commit data...
INSTALL.in Loading commit data...
NEWS Loading commit data...
NEWS.pre-1-3 Loading commit data...
README Loading commit data...
README.md Loading commit data...
README.rationale Loading commit data...
README.win32 Loading commit data...
check-abis.sh Loading commit data...
gio-2.0.pc.in Loading commit data...
gio-unix-2.0.pc.in Loading commit data...
gio-windows-2.0.pc.in Loading commit data...
glib-2.0.pc.in Loading commit data...
glib-gettextize.in Loading commit data...
glib.doap Loading commit data...
glib.supp Loading commit data...
gmodule-2.0.pc.in Loading commit data...
gmodule-export-2.0.pc.in Loading commit data...
gmodule-no-export-2.0.pc.in Loading commit data...
gobject-2.0.pc.in Loading commit data...
gthread-2.0.pc.in Loading commit data...
meson.build Loading commit data...
meson_options.txt Loading commit data...
msvc_recommended_pragmas.h Loading commit data...
sanity_check Loading commit data...
template-tap.test.in Loading commit data...
template.test.in Loading commit data...