diff mbox

[libiberty] Fix testsuite/test-demangle.c

Message ID alpine.LNX.2.00.1310262142480.1528@trevally.site
State New
Headers show

Commit Message

Gerald Pfeifer Oct. 26, 2013, 7:48 p.m. UTC
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.

Comments

Ian Lance Taylor Oct. 26, 2013, 10:26 p.m. UTC | #1
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
diff mbox

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
 {