aboutsummaryrefslogtreecommitdiffstats
path: root/src/alloc.c
diff options
context:
space:
mode:
authorPaul Eggert2016-01-30 18:38:51 -0800
committerPaul Eggert2016-01-30 18:39:27 -0800
commit93b144bbaa4bcef356655613cf2fc4fa14e09df6 (patch)
tree153608e5a1b17f44249bab8537caaa9a3a8f1043 /src/alloc.c
parent71b20b31c8ee25bcd0de1a954c9ca7b49140b3b2 (diff)
downloademacs-93b144bbaa4bcef356655613cf2fc4fa14e09df6.tar.gz
emacs-93b144bbaa4bcef356655613cf2fc4fa14e09df6.zip
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/alloc.c')
-rw-r--r--src/alloc.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/alloc.c b/src/alloc.c
index d379761c168..5f74d9061e5 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -1105,15 +1105,18 @@ lisp_free (void *block)
1105 1105
1106/* Use aligned_alloc if it or a simple substitute is available. 1106/* Use aligned_alloc if it or a simple substitute is available.
1107 Address sanitization breaks aligned allocation, as of gcc 4.8.2 and 1107 Address sanitization breaks aligned allocation, as of gcc 4.8.2 and
1108 clang 3.3 anyway. */ 1108 clang 3.3 anyway. Aligned allocation is incompatible with
1109 unexmacosx.c, so don't use it on Darwin. */
1109 1110
1110#if ! ADDRESS_SANITIZER 1111#if ! ADDRESS_SANITIZER && ! DARWIN_OS
1111# if !defined SYSTEM_MALLOC && !defined DOUG_LEA_MALLOC && !defined HYBRID_MALLOC 1112# if !defined SYSTEM_MALLOC && !defined DOUG_LEA_MALLOC && !defined HYBRID_MALLOC
1112# define USE_ALIGNED_ALLOC 1 1113# define USE_ALIGNED_ALLOC 1
1114# ifndef HAVE_ALIGNED_ALLOC
1113/* Defined in gmalloc.c. */ 1115/* Defined in gmalloc.c. */
1114void *aligned_alloc (size_t, size_t); 1116void *aligned_alloc (size_t, size_t);
1117# endif
1115# elif defined HYBRID_MALLOC 1118# elif defined HYBRID_MALLOC
1116# if defined ALIGNED_ALLOC || defined HAVE_POSIX_MEMALIGN 1119# if defined HAVE_ALIGNED_ALLOC || defined HAVE_POSIX_MEMALIGN
1117# define USE_ALIGNED_ALLOC 1 1120# define USE_ALIGNED_ALLOC 1
1118# define aligned_alloc hybrid_aligned_alloc 1121# define aligned_alloc hybrid_aligned_alloc
1119/* Defined in gmalloc.c. */ 1122/* Defined in gmalloc.c. */