0e50f1f
According to POSIX memmove and memcpy can actually be macros or whatever
0e50f1f
(IIRC). We'd better not play with those in code that uses libc's headers
0e50f1f
and is to be linked with libc.
0e50f1f
0e50f1f
2008-08-08  Lubomir Rintel  <lkundrak@fedoraproject.org>
0e50f1f
0e50f1f
	* include/grub/misc.h: Surround memmove and memcpy prototypes with
0e50f1f
	#ifndef GRUB_UTIL
0e50f1f
	* kern/misc.c: Surround memmove, memcpy and memset prototypes with
0e50f1f
	#ifndef GRUB_UTIL
0e50f1f
0e50f1f
Index: kern/misc.c
0e50f1f
===================================================================
0e50f1f
--- kern/misc.c	(revision 1797)
0e50f1f
+++ kern/misc.c	(working copy)
0e50f1f
@@ -44,11 +44,15 @@
0e50f1f
   
0e50f1f
   return dest;
0e50f1f
 }
0e50f1f
+#ifdef GRUB_UTIL
0e50f1f
+#include <string.h>
0e50f1f
+#else
0e50f1f
 void *memmove (void *dest, const void *src, grub_size_t n)
0e50f1f
   __attribute__ ((alias ("grub_memmove")));
0e50f1f
 /* GCC emits references to memcpy() for struct copies etc.  */
0e50f1f
 void *memcpy (void *dest, const void *src, grub_size_t n)
0e50f1f
   __attribute__ ((alias ("grub_memmove")));
0e50f1f
+#endif
0e50f1f
 
0e50f1f
 char *
0e50f1f
 grub_strcpy (char *dest, const char *src)
0e50f1f
@@ -514,8 +518,10 @@
0e50f1f
 
0e50f1f
   return s;
0e50f1f
 }
0e50f1f
+#ifndef GRUB_UTIL
0e50f1f
 void *memset (void *s, int c, grub_size_t n)
0e50f1f
   __attribute__ ((alias ("grub_memset")));
0e50f1f
+#endif
0e50f1f
 
0e50f1f
 grub_size_t
0e50f1f
 grub_strlen (const char *s)
0e50f1f
Index: include/grub/misc.h
0e50f1f
===================================================================
0e50f1f
--- include/grub/misc.h	(revision 1797)
0e50f1f
+++ include/grub/misc.h	(working copy)
0e50f1f
@@ -39,8 +39,12 @@
0e50f1f
 char *EXPORT_FUNC(grub_strncat) (char *dest, const char *src, int c);
0e50f1f
 
0e50f1f
 /* Prototypes for aliases.  */
0e50f1f
+#ifdef GRUB_UTIL
0e50f1f
+#include <string.h>
0e50f1f
+#else
0e50f1f
 void *EXPORT_FUNC(memmove) (void *dest, const void *src, grub_size_t n);
0e50f1f
 void *EXPORT_FUNC(memcpy) (void *dest, const void *src, grub_size_t n);
0e50f1f
+#endif
0e50f1f
 
0e50f1f
 int EXPORT_FUNC(grub_memcmp) (const void *s1, const void *s2, grub_size_t n);
0e50f1f
 int EXPORT_FUNC(grub_strcmp) (const char *s1, const char *s2);