From 3a007f939ac6584dc5d8fefae01acb65b4ab76e0 Mon Sep 17 00:00:00 2001 From: Nicolas Trangez Date: Wed, 4 Jul 2012 14:49:00 +0200 Subject: [PATCH] Build: Include unistd.h where required Some modules require an include of unistd.h (e.g. for getcwd and isatty definitions). These changes were required to build successfully on a Fedora 17 system, using GCC 4.7.0 & glibc-headers 2.15. --- ispc.cpp | 2 ++ lex.ll | 2 ++ main.cpp | 2 ++ 3 files changed, 6 insertions(+) diff --git a/ispc.cpp b/ispc.cpp index 5be419ab..ae090f20 100644 --- a/ispc.cpp +++ b/ispc.cpp @@ -44,6 +44,8 @@ #include #include #define strcasecmp stricmp +#else +#include #endif #include #include diff --git a/lex.ll b/lex.ll index 9bf768e4..6cd1daaf 100644 --- a/lex.ll +++ b/lex.ll @@ -58,6 +58,8 @@ extern void RegisterDependency(const std::string &fileName); #ifdef ISPC_IS_WINDOWS inline int isatty(int) { return 0; } +#else +#include #endif // ISPC_IS_WINDOWS static int allTokens[] = { diff --git a/main.cpp b/main.cpp index 23825e2d..ca51d6cb 100644 --- a/main.cpp +++ b/main.cpp @@ -43,6 +43,8 @@ #include #ifdef ISPC_IS_WINDOWS #include +#else + #include #endif // ISPC_IS_WINDOWS #include #include