From: Andreas Zwinkau Date: Fri, 18 Feb 2011 10:02:51 +0000 (+0000) Subject: Support -pthread argument on Linux X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=70060fe5b238cb448d92f3460e3e1ced30b9afdb;p=cparser Support -pthread argument on Linux Other platforms require different arguments or different behavior. [r28402] --- diff --git a/main.c b/main.c index 9e6e551..1c63e0b 100644 --- a/main.c +++ b/main.c @@ -934,6 +934,13 @@ int main(int argc, char **argv) GET_ARG_AFTER(opt, "-isystem"); add_flag(&cppflags_obst, "-isystem"); add_flag(&cppflags_obst, "%s", opt); +#if defined(linux) || defined(__linux) || defined(__linux__) || defined(__CYGWIN__) + } else if (streq(option, "pthread")) { + /* set flags for the preprocessor */ + add_flag(&cppflags_obst, "-D_REENTRANT"); + /* set flags for the linker */ + add_flag(&ldflags_obst, "-lpthread"); +#endif } else if (streq(option, "nostdinc") || streq(option, "trigraphs")) { /* pass these through to the preprocessor */