mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-09-27 17:52:58 +02:00
Fix Windows build errors in valgrind.h
valgrind.h is a verbatim copy taken from Valgrind project. Previously that file had local changes that got dropped by last update. To avoid regressing again, do not edit valgrind.h anymore and instead add a gvalgrind.h wrapper that gets included instead. This fix 2 errors: - uintptr_t is not defined when including valgrind.h on mingw. - MSVC compiler is not supported on amd64-Win64 platform.
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "../glib/valgrind.h"
|
||||
#include "../glib/gvalgrind.h"
|
||||
#include <string.h>
|
||||
|
||||
#include <ffi.h>
|
||||
@@ -200,6 +200,7 @@ g_closure_new_simple (guint sizeof_closure,
|
||||
|
||||
private_size = sizeof (GRealClosure) - sizeof (GClosure);
|
||||
|
||||
#ifdef ENABLE_VALGRIND
|
||||
/* See comments in gtype.c about what's going on here... */
|
||||
if (RUNNING_ON_VALGRIND)
|
||||
{
|
||||
@@ -213,6 +214,7 @@ g_closure_new_simple (guint sizeof_closure,
|
||||
VALGRIND_MALLOCLIKE_BLOCK (allocated + sizeof (gpointer), private_size - sizeof (gpointer), 0, TRUE);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
allocated = g_malloc0 (private_size + sizeof_closure);
|
||||
|
||||
closure = (GClosure *) (allocated + private_size);
|
||||
@@ -613,6 +615,7 @@ g_closure_unref (GClosure *closure)
|
||||
closure_invoke_notifiers (closure, FNOTIFY);
|
||||
g_free (closure->notifiers);
|
||||
|
||||
#ifdef ENABLE_VALGRIND
|
||||
/* See comments in gtype.c about what's going on here... */
|
||||
if (RUNNING_ON_VALGRIND)
|
||||
{
|
||||
@@ -627,6 +630,7 @@ g_closure_unref (GClosure *closure)
|
||||
VALGRIND_FREELIKE_BLOCK (closure, 0);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
g_free (G_REAL_CLOSURE (closure));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user