famzah / popen-noshell

A much faster popen() and system() implementation for Linux
68 stars 13 forks source link

Fix build on Linux #3

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Attempting to build this fails (at least on recent Linux distro):

popen_noshell.c: In function ‘popen_noshell_vmfork’:
popen_noshell.c:254:34: error: ‘CLONE_VM’ undeclared (first use in this 
function)
popen_noshell.c:254:34: note: each undeclared identifier is reported only once 
for each function it appears in

This come from the fact than _GNU_SOURCE is set late in popen_noshell.c, and 
sched.h relies on stuff (__USE_GNU) defined in features.h for its checks, not 
on _GNU_SOURCE directly. Since features.h has most likely already been included 
by one of the other system headers, the include guards prevent this late 
_GNU_SOURCE from being useful.

Moving it to the top (before the includes) fixes it.

Original issue reported on code.google.com by nin...@gmail.com on 3 Oct 2012 at 12:53

GoogleCodeExporter commented 9 years ago
I'm really sorry for the late reply. It turned out that I wasn't getting any 
notifications for new issues here.

Fixed in r9.

Original comment by ivan.zah...@gmail.com on 24 May 2013 at 8:43