This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Add ...i386/bits/sigcontext.h
On Tuesday, June 21, 2011 09:09:41 PM Andreas Jaeger wrote:
> On Tuesday, June 21, 2011 06:44:08 PM Ulrich Drepper wrote:
> > On Mon, Jun 20, 2011 at 06:17, Andreas Jaeger <aj@novell.com> wrote:
> > > Compiling with current kernel headers on x86, I got a wrong definition
> > > of NULL coming from kernel headers.
> >
> > Let's avoid duplicating the header is possible. What does it take to
> > fix the include after the fact?
>
> We duplicated the header already for some other architectures.
>
> NULL was defined wrongly, so the following - untested - should do the
> trick: # include <asm/sigcontext.h>
> # define __need_NULL
> # include <stddef.h>
>
> I'll test this now and send a patch...
Yes, this does the job,
Andreas
2011-06-21 Andreas Jaeger <aj@suse.de>
* sysdeps/unix/sysv/linux/bits/sigcontext.h: Fix definition of
NULL after inclusion of kernel headers.
diff --git a/sysdeps/unix/sysv/linux/bits/sigcontext.h b/sysdeps/unix/sysv/linux/bits/sigcontext.h
index 67dcf94..e194ccc 100644
--- a/sysdeps/unix/sysv/linux/bits/sigcontext.h
+++ b/sysdeps/unix/sysv/linux/bits/sigcontext.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 1997, 1998, 2011 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
@@ -26,4 +26,9 @@
# define sigcontext_struct sigcontext
# include <asm/sigcontext.h>
+
+/* The Linux kernel headers redefine NULL wrongly, so cleanup
+ afterwards. */
+# define __need_NULL
+# include <stddef.h>
#endif
--
Andreas Jaeger, Program Manager openSUSE
aj@{novell.com,suse.com,opensuse.org} Twitter/Identica: jaegerandi
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg)
GPG fingerprint = 93A3 365E CE47 B889 DF7F FED1 389A 563C C272 A126