about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRoland McGrath <roland@hack.frob.com>2012-08-15 11:26:02 -0700
committerRoland McGrath <roland@hack.frob.com>2012-08-15 11:26:02 -0700
commit9a0a54864bc015efbbbd15dcf365bcb2c147fb90 (patch)
tree843770e647d3e9227a5f491497d44c532e3ae846
parent67cc348d55b886eac7c3b3b028d22ec8e8c349a4 (diff)
downloadglibc-9a0a54864bc015efbbbd15dcf365bcb2c147fb90.tar.gz
glibc-9a0a54864bc015efbbbd15dcf365bcb2c147fb90.tar.xz
glibc-9a0a54864bc015efbbbd15dcf365bcb2c147fb90.zip
Clean up x86_64/multiarch/memmove.c include order.
-rw-r--r--ChangeLog6
-rw-r--r--sysdeps/x86_64/multiarch/memmove.c38
2 files changed, 24 insertions, 20 deletions
diff --git a/ChangeLog b/ChangeLog
index 7ab9bc355c..6b5f6c83e3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2012-08-15  Roland McGrath  <roland@hack.frob.com>
 
+	* sysdeps/x86_64/multiarch/memmove.c: Don't include <stddef.h>.
+	[!NOT_IN_libc]: Move #define and #undef of memmove to just before
+	and after including <string.h>.  Move declarations of
+	__memmove_sse2, __memmove_ssse3, and __memmove_ssse3_back
+	to before #include "string/memmove.c".
+
 	* include/dirent.h: Declare __getdirentries.
 
 	* sysdeps/posix/system.c (do_system): Cast SUB_REF () to void when not
diff --git a/sysdeps/x86_64/multiarch/memmove.c b/sysdeps/x86_64/multiarch/memmove.c
index 6e91025eb6..d6bdab4ccf 100644
--- a/sysdeps/x86_64/multiarch/memmove.c
+++ b/sysdeps/x86_64/multiarch/memmove.c
@@ -1,6 +1,5 @@
 /* Multiple versions of memmove.
-   Copyright (C) 2010, 2011
-   Free Software Foundation, Inc.
+   Copyright (C) 2010-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -17,31 +16,31 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <stddef.h>
-
 #ifndef NOT_IN_libc
-#include <shlib-compat.h>
-#include "init-arch.h"
-
-#define MEMMOVE __memmove_sse2
-#ifdef SHARED
-# undef libc_hidden_builtin_def
-# define libc_hidden_builtin_def(name) \
+# define MEMMOVE __memmove_sse2
+# ifdef SHARED
+#  undef libc_hidden_builtin_def
+#  define libc_hidden_builtin_def(name) \
   __hidden_ver1 (__memmove_sse2, __GI_memmove, __memmove_sse2);
-#endif
+# endif
 
 /* Redefine memmove so that the compiler won't complain about the type
    mismatch with the IFUNC selector in strong_alias, below.  */
-#undef memmove
-#define memmove __redirect_memmove
+# undef memmove
+# define memmove __redirect_memmove
+# include <string.h>
+# undef memmove
+
+extern __typeof (__redirect_memmove) __memmove_sse2 attribute_hidden;
+extern __typeof (__redirect_memmove) __memmove_ssse3 attribute_hidden;
+extern __typeof (__redirect_memmove) __memmove_ssse3_back attribute_hidden;
 #endif
 
 #include "string/memmove.c"
 
 #ifndef NOT_IN_libc
-extern __typeof (__redirect_memmove) __memmove_sse2 attribute_hidden;
-extern __typeof (__redirect_memmove) __memmove_ssse3 attribute_hidden;
-extern __typeof (__redirect_memmove) __memmove_ssse3_back attribute_hidden;
+# include <shlib-compat.h>
+# include "init-arch.h"
 
 /* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
    ifunc symbol properly.  */
@@ -52,10 +51,9 @@ libc_ifunc (__libc_memmove,
 	       ? __memmove_ssse3_back : __memmove_ssse3)
 	    : __memmove_sse2)
 
-#undef memmove
 strong_alias (__libc_memmove, memmove)
 
-#if SHLIB_COMPAT (libc, GLIBC_2_2_5, GLIBC_2_14)
+# if SHLIB_COMPAT (libc, GLIBC_2_2_5, GLIBC_2_14)
 compat_symbol (libc, memmove, memcpy, GLIBC_2_2_5);
-#endif
+# endif
 #endif