From 512952aa0f55484fc81136170083e2b7abbe9aff Mon Sep 17 00:00:00 2001 From: Sebastian Kuzminsky Date: Sat, 14 May 2016 15:44:13 +0200 Subject: Change yosys to look for the #define constant "__unix__" instead of "__linux__", to select code appropriate for Unix-like systems. This has been tested with Clang 3.5 and GCC 4.6, 4.8, and 4.9 on Linux, and Clang 3.5 and GCC 4.9 on kFreeBSD. Gbp-Pq: Name kfreebsd-support.patch --- kernel/driver.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'kernel/driver.cc') diff --git a/kernel/driver.cc b/kernel/driver.cc index 17864110..8b328e5b 100644 --- a/kernel/driver.cc +++ b/kernel/driver.cc @@ -34,7 +34,7 @@ #include #include -#if defined (__linux__) || defined(__FreeBSD__) +#if defined (__unix__) || defined(__FreeBSD__) # include # include # include @@ -449,7 +449,7 @@ int main(int argc, char **argv) if (print_stats) log_hasher = new SHA1; -#if defined(__linux__) +#if defined(__unix__) // set stack size to >= 128 MB { struct rlimit rl; @@ -532,7 +532,7 @@ int main(int argc, char **argv) #else std::string meminfo; std::string stats_divider = ", "; -# if defined(__linux__) +# if defined(__unix__) std::ifstream statm; statm.open(stringf("/proc/%lld/statm", (long long)getpid())); if (statm.is_open()) { @@ -599,7 +599,7 @@ int main(int argc, char **argv) } } -#if defined(YOSYS_ENABLE_COVER) && (defined(__linux__) || defined(__FreeBSD__)) +#if defined(YOSYS_ENABLE_COVER) && (defined(__unix__) || defined(__FreeBSD__)) if (getenv("YOSYS_COVER_DIR") || getenv("YOSYS_COVER_FILE")) { string filename; -- cgit v1.2.3