aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2013-11-08 08:24:40 -0800
committerPaul Eggert2013-11-08 08:24:40 -0800
commit220a304ac3e1948e40ea76a82bc62bd81c2a6906 (patch)
tree258d6b1b3b7ef513a7e040faf7b3d687b1d93d03
parent71731c03382ba72c08d8a8d15ee074b4d3c97e66 (diff)
downloademacs-220a304ac3e1948e40ea76a82bc62bd81c2a6906.tar.gz
emacs-220a304ac3e1948e40ea76a82bc62bd81c2a6906.zip
Merge from gnulib.
This incorporates: 2013-11-08 extern-inline: port better to OS X 10.9 2013-11-08 fpending: fix regression on DragonFly BSD * lib/fpending.h, m4/extern-inline.m4, m4/fpending.m4: Update from gnulib.
-rw-r--r--ChangeLog8
-rw-r--r--lib/fpending.h2
-rw-r--r--m4/extern-inline.m418
-rw-r--r--m4/fpending.m418
-rw-r--r--src/ChangeLog2
-rw-r--r--src/gmalloc.c9
6 files changed, 37 insertions, 20 deletions
diff --git a/ChangeLog b/ChangeLog
index 05ab15e0da6..f1be2c7d655 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
12013-11-08 Paul Eggert <eggert@cs.ucla.edu>
2
3 Merge from gnulib, incorporating:
4 2013-11-08 extern-inline: port better to OS X 10.9
5 2013-11-08 fpending: fix regression on DragonFly BSD
6 * lib/fpending.h, m4/extern-inline.m4, m4/fpending.m4:
7 Update from gnulib.
8
12013-11-07 Paul Eggert <eggert@cs.ucla.edu> 92013-11-07 Paul Eggert <eggert@cs.ucla.edu>
2 10
3 Port to C11 aligned_alloc. 11 Port to C11 aligned_alloc.
diff --git a/lib/fpending.h b/lib/fpending.h
index 30d67fcd74f..306a083e34a 100644
--- a/lib/fpending.h
+++ b/lib/fpending.h
@@ -24,6 +24,6 @@
24# include <stdio_ext.h> 24# include <stdio_ext.h>
25#endif 25#endif
26 26
27#ifndef __fpending 27#if !HAVE_DECL___FPENDING
28size_t __fpending (FILE *) _GL_ATTRIBUTE_PURE; 28size_t __fpending (FILE *) _GL_ATTRIBUTE_PURE;
29#endif 29#endif
diff --git a/m4/extern-inline.m4 b/m4/extern-inline.m4
index e4454d8fe3d..9f93c29e4d4 100644
--- a/m4/extern-inline.m4
+++ b/m4/extern-inline.m4
@@ -1,4 +1,3 @@
1# extern-inline.m4 serial 2
2dnl 'extern inline' a la ISO C99. 1dnl 'extern inline' a la ISO C99.
3 2
4dnl Copyright 2012-2013 Free Software Foundation, Inc. 3dnl Copyright 2012-2013 Free Software Foundation, Inc.
@@ -20,15 +19,20 @@ AC_DEFUN([gl_EXTERN_INLINE],
20 'reference to static identifier "f" in extern inline function'. 19 'reference to static identifier "f" in extern inline function'.
21 This bug was observed with Sun C 5.12 SunOS_i386 2011/11/16. 20 This bug was observed with Sun C 5.12 SunOS_i386 2011/11/16.
22 21
23 Suppress the use of extern inline on problematic Apple configurations, as 22 Suppress the use of extern inline on problematic Apple configurations.
24 Libc at least through Libc-825.26 (2013-04-09) mishandles it; see, e.g., 23 OS X 10.8 and earlier mishandle it; see, e.g.,
25 <http://lists.gnu.org/archive/html/bug-gnulib/2012-12/msg00023.html>. 24 <http://lists.gnu.org/archive/html/bug-gnulib/2012-12/msg00023.html>.
25 OS X 10.9 has a macro __header_inline indicating the bug is fixed for C and
26 for clang but remains for g++; see <http://trac.macports.org/ticket/41033>.
26 Perhaps Apple will fix this some day. */ 27 Perhaps Apple will fix this some day. */
27#if (defined __APPLE__ \ 28#if (defined __APPLE__ \
28 && ((! defined _DONT_USE_CTYPE_INLINE_ \ 29 && (defined __header_inline \
29 && (defined __GNUC__ || defined __cplusplus)) \ 30 ? (defined __cplusplus && defined __GNUC_STDC_INLINE__ \
30 || (defined _FORTIFY_SOURCE && 0 < _FORTIFY_SOURCE \ 31 && ! defined __clang__) \
31 && defined __GNUC__ && ! defined __cplusplus))) 32 : ((! defined _DONT_USE_CTYPE_INLINE_ \
33 && (defined __GNUC__ || defined __cplusplus)) \
34 || (defined _FORTIFY_SOURCE && 0 < _FORTIFY_SOURCE \
35 && defined __GNUC__ && ! defined __cplusplus))))
32# define _GL_EXTERN_INLINE_APPLE_BUG 36# define _GL_EXTERN_INLINE_APPLE_BUG
33#endif 37#endif
34#if ((__GNUC__ \ 38#if ((__GNUC__ \
diff --git a/m4/fpending.m4 b/m4/fpending.m4
index c8d9e8b7ba8..669105b9b53 100644
--- a/m4/fpending.m4
+++ b/m4/fpending.m4
@@ -1,4 +1,4 @@
1# serial 20 1# serial 21
2 2
3# Copyright (C) 2000-2001, 2004-2013 Free Software Foundation, Inc. 3# Copyright (C) 2000-2001, 2004-2013 Free Software Foundation, Inc.
4# This file is free software; the Free Software Foundation 4# This file is free software; the Free Software Foundation
@@ -16,19 +16,23 @@ dnl we have to grub around in the FILE struct.
16AC_DEFUN([gl_FUNC_FPENDING], 16AC_DEFUN([gl_FUNC_FPENDING],
17[ 17[
18 AC_CHECK_HEADERS_ONCE([stdio_ext.h]) 18 AC_CHECK_HEADERS_ONCE([stdio_ext.h])
19 fp_headers='
20 #include <stdio.h>
21 #if HAVE_STDIO_EXT_H
22 # include <stdio_ext.h>
23 #endif
24 '
19 AC_CACHE_CHECK([for __fpending], [gl_cv_func___fpending], 25 AC_CACHE_CHECK([for __fpending], [gl_cv_func___fpending],
20 [ 26 [
21 AC_LINK_IFELSE( 27 AC_LINK_IFELSE(
22 [AC_LANG_PROGRAM( 28 [AC_LANG_PROGRAM([$fp_headers],
23 [[#include <stdio.h>
24 #if HAVE_STDIO_EXT_H
25 # include <stdio_ext.h>
26 #endif
27 ]],
28 [[return ! __fpending (stdin);]])], 29 [[return ! __fpending (stdin);]])],
29 [gl_cv_func___fpending=yes], 30 [gl_cv_func___fpending=yes],
30 [gl_cv_func___fpending=no]) 31 [gl_cv_func___fpending=no])
31 ]) 32 ])
33 if test $gl_cv_func___fpending = yes; then
34 AC_CHECK_DECLS([__fpending], [], [], [$fp_headers])
35 fi
32]) 36])
33 37
34AC_DEFUN([gl_PREREQ_FPENDING], 38AC_DEFUN([gl_PREREQ_FPENDING],
diff --git a/src/ChangeLog b/src/ChangeLog
index fdb4b24233f..2a5c828578f 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -16,6 +16,8 @@
16 16
172013-11-08 Paul Eggert <eggert@cs.ucla.edu> 172013-11-08 Paul Eggert <eggert@cs.ucla.edu>
18 18
19 * gmalloc.c (special_realloc, calloc, mallochook): Use tail calls.
20
19 * chartab.c (make_sub_char_table): Fix size typo (Bug#15825). 21 * chartab.c (make_sub_char_table): Fix size typo (Bug#15825).
20 This bug was introduced in my 2013-06-21 change, and caused 22 This bug was introduced in my 2013-06-21 change, and caused
21 struct Lisp_Sub_Char_Table objects to be given too many slots, 23 struct Lisp_Sub_Char_Table objects to be given too many slots,
diff --git a/src/gmalloc.c b/src/gmalloc.c
index fc728eeea7e..c50df25cd41 100644
--- a/src/gmalloc.c
+++ b/src/gmalloc.c
@@ -1307,8 +1307,8 @@ special_realloc (void *ptr, size_t size)
1307 type == 0 ? bss_sbrk_heapinfo[block].busy.info.size * BLOCKSIZE 1307 type == 0 ? bss_sbrk_heapinfo[block].busy.info.size * BLOCKSIZE
1308 : (size_t) 1 << type; 1308 : (size_t) 1 << type;
1309 result = _malloc_internal_nolock (size); 1309 result = _malloc_internal_nolock (size);
1310 if (result != NULL) 1310 if (result)
1311 memcpy (result, ptr, min (oldsize, size)); 1311 return memcpy (result, ptr, min (oldsize, size));
1312 return result; 1312 return result;
1313} 1313}
1314#endif 1314#endif
@@ -1501,7 +1501,7 @@ calloc (size_t nmemb, size_t size)
1501 1501
1502 result = malloc (bytes); 1502 result = malloc (bytes);
1503 if (result) 1503 if (result)
1504 memset (result, 0, bytes); 1504 return memset (result, 0, bytes);
1505 return result; 1505 return result;
1506} 1506}
1507/* Copyright (C) 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc. 1507/* Copyright (C) 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
@@ -1814,8 +1814,7 @@ mallochook (size_t size)
1814 hdr->size = size; 1814 hdr->size = size;
1815 hdr->magic = MAGICWORD; 1815 hdr->magic = MAGICWORD;
1816 ((char *) &hdr[1])[size] = MAGICBYTE; 1816 ((char *) &hdr[1])[size] = MAGICBYTE;
1817 memset (hdr + 1, MALLOCFLOOD, size); 1817 return memset (hdr + 1, MALLOCFLOOD, size);
1818 return hdr + 1;
1819} 1818}
1820 1819
1821static void * 1820static void *