mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-26 05:56:14 +01:00
Merge branch 'mcatanzaro/cast-checks' into 'main'
Automatically disable cast checks when building with optimization See merge request GNOME/glib!2850
This commit is contained in:
commit
f946e45a0c
@ -2501,15 +2501,16 @@ const gchar * g_type_name_from_class (GTypeClass *g_class);
|
|||||||
|
|
||||||
|
|
||||||
/* --- implementation bits --- */
|
/* --- implementation bits --- */
|
||||||
#ifndef G_DISABLE_CAST_CHECKS
|
#if (defined(G_DISABLE_CAST_CHECKS) && G_DISABLE_CAST_CHECKS != 0) || (!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
|
||||||
# define _G_TYPE_CIC(ip, gt, ct) \
|
# define _G_TYPE_CIC(ip, gt, ct) \
|
||||||
((ct*) (void *) g_type_check_instance_cast ((GTypeInstance*) ip, gt))
|
((ct*) (void *) g_type_check_instance_cast ((GTypeInstance*) ip, gt))
|
||||||
# define _G_TYPE_CCC(cp, gt, ct) \
|
# define _G_TYPE_CCC(cp, gt, ct) \
|
||||||
((ct*) (void *) g_type_check_class_cast ((GTypeClass*) cp, gt))
|
((ct*) (void *) g_type_check_class_cast ((GTypeClass*) cp, gt))
|
||||||
#else /* G_DISABLE_CAST_CHECKS */
|
#endif
|
||||||
# define _G_TYPE_CIC(ip, gt, ct) ((ct*) ip)
|
|
||||||
# define _G_TYPE_CCC(cp, gt, ct) ((ct*) cp)
|
|
||||||
#endif /* G_DISABLE_CAST_CHECKS */
|
|
||||||
#define _G_TYPE_CHI(ip) (g_type_check_instance ((GTypeInstance*) ip))
|
#define _G_TYPE_CHI(ip) (g_type_check_instance ((GTypeInstance*) ip))
|
||||||
#define _G_TYPE_CHV(vl) (g_type_check_value ((GValue*) vl))
|
#define _G_TYPE_CHV(vl) (g_type_check_value ((GValue*) vl))
|
||||||
#define _G_TYPE_IGC(ip, gt, ct) ((ct*) (((GTypeInstance*) ip)->g_class))
|
#define _G_TYPE_IGC(ip, gt, ct) ((ct*) (((GTypeInstance*) ip)->g_class))
|
||||||
|
Loading…
Reference in New Issue
Block a user