Patchwork [libiberty] Fix testsuite/test-demangle.c

login
register
mail settings
Submitter Gerald Pfeifer
Date Oct. 26, 2013, 7:48 p.m.
Message ID <alpine.LNX.2.00.1310262142480.1528@trevally.site>
Download mbox | patch
Permalink /patch/286303/
State New
Headers show

Comments

Gerald Pfeifer - Oct. 26, 2013, 7:48 p.m.
This is similar to my fix for testsuite/test-expandargv.c last week.

I'm still not sure why this does not trigger on GNU/Linux distributions,
or earlier version of FreeBSD.  On FreeBSD 10 one does need to #include 
<unistd.h> to get getpagesize which is used by the test.

With this, the test now compiles on my i386-unknown-freebsd10.0 tester;
without it, it doesn't.

Okay?

Gerald

2013-10-26  Gerald Pfeifer  <gerald@pfeifer.com>

        * testsuite/test-demangle.c: Include unistd.h.
Ian Taylor - Oct. 26, 2013, 10:26 p.m.
On Sat, Oct 26, 2013 at 12:48 PM, Gerald Pfeifer <gerald@pfeifer.com> wrote:
>
> 2013-10-26  Gerald Pfeifer  <gerald@pfeifer.com>
>
>         * testsuite/test-demangle.c: Include unistd.h.

This is OK.

Thanks.

Ian

Patch

Index: libiberty/testsuite/test-demangle.c
===================================================================
--- libiberty/testsuite/test-demangle.c	(revision 204095)
+++ libiberty/testsuite/test-demangle.c	(working copy)
@@ -32,6 +32,9 @@ 
 #if HAVE_STDLIB_H
 # include <stdlib.h>
 #endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
 
 struct line
 {