From: Tim Janik Date: Tue, 14 Feb 2006 16:31:37 +0000 (+0000) Subject: only define _XOPEN_SOURCE to 600 to get at posix_memalign() in case we X-Git-Tag: GLIB_2_10_0~17 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8a8f185febd8cfa0ea05f92e68b8962479486bef;p=platform%2Fupstream%2Fglib.git only define _XOPEN_SOURCE to 600 to get at posix_memalign() in case we Tue Feb 14 17:00:43 2006 Tim Janik * glib/gslice.c: only define _XOPEN_SOURCE to 600 to get at posix_memalign() in case we actually are going to use it, because we detected a compliant implementation (#328997). * configure.in (enable_included_printf): don't include malloc.h when testing for posix_memalign() funcitonality, since this may break the test on some systems (#328997). --- diff --git a/ChangeLog b/ChangeLog index 715f756..ea6b4b5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +Tue Feb 14 17:00:43 2006 Tim Janik + + * glib/gslice.c: only define _XOPEN_SOURCE to 600 to get at + posix_memalign() in case we actually are going to use it, because + we detected a compliant implementation (#328997). + + * configure.in (enable_included_printf): don't include malloc.h when + testing for posix_memalign() funcitonality, since this may break the + test on some systems (#328997). + 2006-02-14 Matthias Clasen * glib/gstrfuncs.c: Improve docs. diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 715f756..ea6b4b5 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,13 @@ +Tue Feb 14 17:00:43 2006 Tim Janik + + * glib/gslice.c: only define _XOPEN_SOURCE to 600 to get at + posix_memalign() in case we actually are going to use it, because + we detected a compliant implementation (#328997). + + * configure.in (enable_included_printf): don't include malloc.h when + testing for posix_memalign() funcitonality, since this may break the + test on some systems (#328997). + 2006-02-14 Matthias Clasen * glib/gstrfuncs.c: Improve docs. diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12 index 715f756..ea6b4b5 100644 --- a/ChangeLog.pre-2-12 +++ b/ChangeLog.pre-2-12 @@ -1,3 +1,13 @@ +Tue Feb 14 17:00:43 2006 Tim Janik + + * glib/gslice.c: only define _XOPEN_SOURCE to 600 to get at + posix_memalign() in case we actually are going to use it, because + we detected a compliant implementation (#328997). + + * configure.in (enable_included_printf): don't include malloc.h when + testing for posix_memalign() funcitonality, since this may break the + test on some systems (#328997). + 2006-02-14 Matthias Clasen * glib/gstrfuncs.c: Improve docs. diff --git a/configure.in b/configure.in index d23aa81..480d7b1 100644 --- a/configure.in +++ b/configure.in @@ -1028,8 +1028,8 @@ AC_CACHE_VAL(glib_cv_compliant_posix_memalign,[ if test "$ac_cv_func_posix_memalign" = "yes" ; then AC_TRY_RUN([ #define _XOPEN_SOURCE 600 - #include - #include + #include /* posix_memalign() should be defined here */ + /* some systems break if #include used */ static void test_memalign (size_t boundary, size_t size) { void *mem = 0; if (posix_memalign (&mem, boundary, size) != 0 || !mem) diff --git a/glib/gslice.c b/glib/gslice.c index 4d377f2..afc6b72 100644 --- a/glib/gslice.c +++ b/glib/gslice.c @@ -20,7 +20,11 @@ #include "config.h" -#ifdef HAVE_POSIX_MEMALIGN +#if defined HAVE_POSIX_MEMALIGN && defined POSIX_MEMALIGN_WITH_COMPLIANT_ALLOCS +# define HAVE_COMPLIANT_POSIX_MEMALIGN 1 +#endif + +#ifdef HAVE_COMPLIANT_POSIX_MEMALIGN #define _XOPEN_SOURCE 600 /* posix_memalign() */ #endif #include /* posix_memalign() */ @@ -38,10 +42,6 @@ #include #endif -#if defined HAVE_POSIX_MEMALIGN && defined POSIX_MEMALIGN_WITH_COMPLIANT_ALLOCS -# define HAVE_COMPLIANT_POSIX_MEMALIGN 1 -#endif - /* the GSlice allocator is split up into 4 layers, roughly modelled after the slab * allocator and magazine extensions as outlined in: