glib-private: Add infrastructure to detect AddressSanitizer

Signed-off-by: Simon McVittie <smcv@collabora.com>
This commit is contained in:
Simon McVittie 2021-01-28 21:01:51 +00:00
parent 5685546ab1
commit 98804781ce

View File

@ -22,6 +22,19 @@
#include "gwakeup.h" #include "gwakeup.h"
#include "gstdioprivate.h" #include "gstdioprivate.h"
/* gcc defines __SANITIZE_ADDRESS__, clang sets the address_sanitizer
* feature flag */
#if defined(__SANITIZE_ADDRESS__) || g_macro__has_feature(address_sanitizer)
/*
* %_GLIB_ADDRESS_SANITIZER:
*
* Private macro defined if the AddressSanitizer is in use.
*/
#define _GLIB_ADDRESS_SANITIZER
#endif
GMainContext * g_get_worker_context (void); GMainContext * g_get_worker_context (void);
gboolean g_check_setuid (void); gboolean g_check_setuid (void);
GMainContext * g_main_context_new_with_next_id (guint next_id); GMainContext * g_main_context_new_with_next_id (guint next_id);