mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-11 15:06:14 +01:00
Fix build when G_DISABLE_CAST_CHECKS is defined to empty string
The usual use of G_DISABLE_CAST_CHECKS is to define it without giving it
a value. The value was never looked at until
f946e45a0c
, where I decided it would be
cool to ignore it if defined to 0. But this broke the original usage, so
we need to revert that.
I thought it would be a good idea to look at the value in order to give
applications an off switch for the new behavior, so you could continue
to build optimized builds with cast checks enabled. We could still try
to find a way to do that in the future if desired, e.g. by introducing a
new G_ENABLE_CAST_CHECKS definition. But this doesn't seem especially
important. G_DISABLE_CAST_CHECKS is not documented anyway, so how we
handle cast checks is entirely up to GLib.
This commit is contained in:
parent
52917f57ca
commit
8c54de8fa0
@ -2501,7 +2501,7 @@ const gchar * g_type_name_from_class (GTypeClass *g_class);
|
||||
|
||||
|
||||
/* --- implementation bits --- */
|
||||
#if (defined(G_DISABLE_CAST_CHECKS) && G_DISABLE_CAST_CHECKS != 0) || (!defined(G_DISABLE_CAST_CHECKS) && defined(__OPTIMIZE__))
|
||||
#if defined(G_DISABLE_CAST_CHECKS) || defined(__OPTIMIZE__)
|
||||
# define _G_TYPE_CIC(ip, gt, ct) ((ct*) ip)
|
||||
# define _G_TYPE_CCC(cp, gt, ct) ((ct*) cp)
|
||||
#else
|
||||
|
Loading…
Reference in New Issue
Block a user