summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2016-01-30 18:38:51 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2016-01-30 18:39:27 -0800
commit93b144bbaa4bcef356655613cf2fc4fa14e09df6 (patch)
tree153608e5a1b17f44249bab8537caaa9a3a8f1043 /src
parent71b20b31c8ee25bcd0de1a954c9ca7b49140b3b2 (diff)
Pacify GCC on C library without glibc API
Without this change, with --enable-gcc-warnings GCC would complain “error: redundant redeclaration of ‘aligned_alloc’”. * configure.ac: Simplify aligned_alloc testing. * src/alloc.c (aligned_alloc): Don’t use if DARWIN_OS, since the simplified configure.ac no longer checks for that. Don’t declare if HAVE_ALIGNED_ALLOC. Correct misspelling of HAVE_ALIGNED_ALLOC in ifdef.
Diffstat (limited to 'src')
-rw-r--r--src/alloc.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/alloc.c b/src/alloc.c
index d379761c16..5f74d9061e 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -1105,15 +1105,18 @@ lisp_free (void *block)
/* Use aligned_alloc if it or a simple substitute is available.
Address sanitization breaks aligned allocation, as of gcc 4.8.2 and
- clang 3.3 anyway. */
+ clang 3.3 anyway. Aligned allocation is incompatible with
+ unexmacosx.c, so don't use it on Darwin. */
-#if ! ADDRESS_SANITIZER
+#if ! ADDRESS_SANITIZER && ! DARWIN_OS
# if !defined SYSTEM_MALLOC && !defined DOUG_LEA_MALLOC && !defined HYBRID_MALLOC
# define USE_ALIGNED_ALLOC 1
+# ifndef HAVE_ALIGNED_ALLOC
/* Defined in gmalloc.c. */
void *aligned_alloc (size_t, size_t);
+# endif
# elif defined HYBRID_MALLOC
-# if defined ALIGNED_ALLOC || defined HAVE_POSIX_MEMALIGN
+# if defined HAVE_ALIGNED_ALLOC || defined HAVE_POSIX_MEMALIGN
# define USE_ALIGNED_ALLOC 1
# define aligned_alloc hybrid_aligned_alloc
/* Defined in gmalloc.c. */