]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Sync scratch_buffer with gnulib
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Mon, 4 Sep 2017 19:44:12 +0000 (16:44 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Fri, 8 Sep 2017 13:51:34 +0000 (15:51 +0200)
This patch syncs the scratch_buffer grom gnulib commit 3866ef6 with
GLIBC code.

Checked on x86_64-linux-gnu and on a build using build-many-glibcs.py
for all major architectures.

* include/scratch_buffer.h (scratch_buffer): Use a C99 align method
instead of GCC extension.
* malloc/scratch_buffer_grow.c [!_LIBC]: Include libc-config.h.
* malloc/scratch_buffer_grow_preserve.c [!_LIBC]: Likewise.
* malloc/scratch_buffer_set_array_size.c [!_LIBC]: Likewise.

ChangeLog
include/scratch_buffer.h
malloc/scratch_buffer_grow.c
malloc/scratch_buffer_grow_preserve.c
malloc/scratch_buffer_set_array_size.c

index 5f9bc6244f0c9bc2575d2508ed73c90b0bec0767..c8d46e9954603c16f900bf8871f73a7a4bef3f5a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2017-09-08  Adhemerval Zanella  <adhemerval.zanella@linaro.org>
 
+       * include/scratch_buffer.h (scratch_buffer): Use a C99 align method
+       instead of GCC extension.
+       * malloc/scratch_buffer_grow.c [!_LIBC]: Include libc-config.h.
+       * malloc/scratch_buffer_grow_preserve.c [!_LIBC]: Likewise.
+       * malloc/scratch_buffer_set_array_size.c [!_LIBC]: Likewise.
+
        [BZ #866]
        [BZ #1062]
        * posix/Makefile (tests): Remove bug-glob1 and tst-glob_symlinks.
index dd17a4a7e13596aa3cf5dfb513e2adfd8a00f595..bb04662eb22e9653e3431a49eeda5ccbc24cf687 100644 (file)
@@ -66,8 +66,7 @@
 struct scratch_buffer {
   void *data;    /* Pointer to the beginning of the scratch area.  */
   size_t length; /* Allocated space at the data pointer, in bytes.  */
-  char __space[1024]
-    __attribute__ ((aligned (__alignof__ (max_align_t))));
+  max_align_t __space[(1023 + sizeof (max_align_t)) / sizeof (max_align_t)];
 };
 
 /* Initializes *BUFFER so that BUFFER->data points to BUFFER->__space
index 22bae506a1946eb4b8d2bd096d3d232204e021a3..d2df028654d2135b14c5c7e90e73ed3f70ae1b44 100644 (file)
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
+#ifndef _LIBC
+# include <libc-config.h>
+#endif
+
 #include <scratch_buffer.h>
 #include <errno.h>
 
@@ -49,4 +53,4 @@ __libc_scratch_buffer_grow (struct scratch_buffer *buffer)
   buffer->length = new_length;
   return true;
 }
-libc_hidden_def (__libc_scratch_buffer_grow);
+libc_hidden_def (__libc_scratch_buffer_grow)
index 18543ef85b7a48e1db980e833a4f5aea84469317..9268615311f59664c76c6c831f72e1fcef509844 100644 (file)
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
+#ifndef _LIBC
+# include <libc-config.h>
+#endif
+
 #include <scratch_buffer.h>
 #include <errno.h>
 #include <string.h>
@@ -60,4 +64,4 @@ __libc_scratch_buffer_grow_preserve (struct scratch_buffer *buffer)
   buffer->length = new_length;
   return true;
 }
-libc_hidden_def (__libc_scratch_buffer_grow_preserve);
+libc_hidden_def (__libc_scratch_buffer_grow_preserve)
index 8ab6d9d300d5c10d5b5e43ef2c0088302c612cf3..6fcc115340d73880c1dd673a99e9ad372cdeb115 100644 (file)
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
+#ifndef _LIBC
+# include <libc-config.h>
+#endif
+
 #include <scratch_buffer.h>
 #include <errno.h>
 #include <limits.h>
@@ -57,4 +61,4 @@ __libc_scratch_buffer_set_array_size (struct scratch_buffer *buffer,
   buffer->length = new_length;
   return true;
 }
-libc_hidden_def (__libc_scratch_buffer_set_array_size);
+libc_hidden_def (__libc_scratch_buffer_set_array_size)