1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-03-21 22:50:08 +03:00

Define LIBXML_THREAD_ALLOC_ENABLED via xmlversion.h

Otherwise, direct calls to xmlFree() etc. from the application will
use a different set of allocation functions to what was used to allocate
the memory internally.
This commit is contained in:
Tim Starling 2012-10-29 13:41:55 +11:00 committed by Daniel Veillard
parent 6a36fbe3b3
commit 0ad948ede2
2 changed files with 12 additions and 1 deletions

View File

@ -954,6 +954,7 @@ WITH_THREADS=0
THREAD_CFLAGS=""
TEST_THREADS=""
THREADS_W32=""
WITH_THREAD_ALLOC=0
if test "$with_threads" = "no" ; then
echo Disabling multithreaded support
@ -1017,7 +1018,7 @@ else
fi
fi
if test "$with_thread_alloc" = "yes" -a "$WITH_THREADS" = "1" ; then
THREAD_CFLAGS="$THREAD_CFLAGS -DLIBXML_THREAD_ALLOC_ENABLED"
WITH_THREAD_ALLOC=1
fi
AC_SUBST(THREAD_LIBS)
@ -1025,6 +1026,7 @@ AC_SUBST(BASE_THREAD_LIBS)
AC_SUBST(WITH_THREADS)
AC_SUBST(THREAD_CFLAGS)
AC_SUBST(TEST_THREADS)
AC_SUBST(WITH_THREAD_ALLOC)
AM_CONDITIONAL([THREADS_W32],[test -n "$THREADS_W32"])
dnl

View File

@ -97,6 +97,15 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version);
#endif
#endif
/**
* LIBXML_THREAD_ALLOC_ENABLED:
*
* Whether the allocation hooks are per-thread
*/
#if @WITH_THREAD_ALLOC@
#define LIBXML_THREAD_ALLOC_ENABLED
#endif
/**
* LIBXML_TREE_ENABLED:
*