Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KRLq5-0007U4-FA for mharc-grub-devel@gnu.org; Fri, 08 Aug 2008 02:52:41 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KRLq3-0007Tr-B9 for grub-devel@gnu.org; Fri, 08 Aug 2008 02:52:39 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KRLq1-0007Tf-GE for grub-devel@gnu.org; Fri, 08 Aug 2008 02:52:38 -0400 Received: from [199.232.76.173] (port=53683 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KRLq1-0007Tc-AM for grub-devel@gnu.org; Fri, 08 Aug 2008 02:52:37 -0400 Received: from mx20.gnu.org ([199.232.41.8]:25569) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KRLq1-00041z-2f for grub-devel@gnu.org; Fri, 08 Aug 2008 02:52:37 -0400 Received: from norkia.v3.sk ([92.240.234.41] helo=norkia.kexik.net) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KRLpz-00077e-Mm for grub-devel@gnu.org; Fri, 08 Aug 2008 02:52:36 -0400 Received: from mail.netbsd.sk (localhost.localdomain [127.0.0.1]) by norkia.kexik.net (Postfix) with ESMTP id C676270001 for ; Fri, 8 Aug 2008 08:52:32 +0200 (CEST) Received: from 89.103.133.237 (SquirrelMail authenticated user lkundrak@v3.sk) by mail.netbsd.sk with HTTP; Fri, 8 Aug 2008 02:52:32 -0400 (EDT) Message-ID: <35247.89.103.133.237.1218178352.squirrel@mail.netbsd.sk> In-Reply-To: <39131.89.103.133.237.1218141734.squirrel@mail.netbsd.sk> References: <39131.89.103.133.237.1218141734.squirrel@mail.netbsd.sk> Date: Fri, 8 Aug 2008 02:52:32 -0400 (EDT) From: lkundrak@v3.sk To: "The development of GRUB 2" User-Agent: SquirrelMail/1.4.8-4.0.1.el5.centos.2 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 X-Priority: 3 (Normal) Importance: Normal Content-Transfer-Encoding: quoted-printable X-detected-kernel: by mx20.gnu.org: Linux 2.6 (newer, 3) X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) Subject: Re: [PATCH] Do not mess with libc's prototypes X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Aug 2008 06:52:39 -0000 Due to some more breakage, here's some more patch: According to POSIX memmove and memcpy can actually be macros or whatever (IIRC). We'd better not play with those in code that uses libc's headers and is to be linked with libc. 2008-08-08 Lubomir Rintel * include/grub/misc.h: Surround memmove and memcpy prototypes wit= h #ifndef GRUB_UTIL * kern/misc.c: Surround memmove, memcpy and memset prototypes wit= h #ifndef GRUB_UTIL Index: kern/misc.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kern/misc.c (revision 1797) +++ kern/misc.c (working copy) @@ -44,11 +44,15 @@ return dest; } +#ifdef GRUB_UTIL +#include +#else void *memmove (void *dest, const void *src, grub_size_t n) __attribute__ ((alias ("grub_memmove"))); /* GCC emits references to memcpy() for struct copies etc. */ void *memcpy (void *dest, const void *src, grub_size_t n) __attribute__ ((alias ("grub_memmove"))); +#endif char * grub_strcpy (char *dest, const char *src) @@ -514,8 +518,10 @@ return s; } +#ifndef GRUB_UTIL void *memset (void *s, int c, grub_size_t n) __attribute__ ((alias ("grub_memset"))); +#endif grub_size_t grub_strlen (const char *s) Index: include/grub/misc.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- include/grub/misc.h (revision 1797) +++ include/grub/misc.h (working copy) @@ -39,8 +39,12 @@ char *EXPORT_FUNC(grub_strncat) (char *dest, const char *src, int c); /* Prototypes for aliases. */ +#ifdef GRUB_UTIL +#include +#else void *EXPORT_FUNC(memmove) (void *dest, const void *src, grub_size_t n); void *EXPORT_FUNC(memcpy) (void *dest, const void *src, grub_size_t n); +#endif int EXPORT_FUNC(grub_memcmp) (const void *s1, const void *s2, grub_size_= t n); int EXPORT_FUNC(grub_strcmp) (const char *s1, const char *s2);