From 0e2b90930eeb9a29a6651c89dfd19d1dfe44cbce Mon Sep 17 00:00:00 2001 From: Elizabeth Smith Date: Thu, 10 Jul 2014 15:52:22 -0700 Subject: [PATCH] Small changes for cygwin build Summary: Folly is almost "out of the box" working with cygwin This has the proper ifdefs to include cygwin in two areas and a workaround for a cygwin bug when including headers Test Plan: fbconfig -r folly && fbmake runtests Reviewed By: delong.j@fb.com FB internal diff: D1413303 --- folly/String.cpp | 2 +- folly/Synchronized.h | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/folly/String.cpp b/folly/String.cpp index f6fc8def..091cd67d 100644 --- a/folly/String.cpp +++ b/folly/String.cpp @@ -308,7 +308,7 @@ fbstring errnoStr(int err) { // https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man3/strerror_r.3.html // http://www.kernel.org/doc/man-pages/online/pages/man3/strerror.3.html -#if defined(__APPLE__) || defined(__FreeBSD__) || \ +#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__CYGWIN__) ||\ ((_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) && !_GNU_SOURCE) // Using XSI-compatible strerror_r int r = strerror_r(err, buf, sizeof(buf)); diff --git a/folly/Synchronized.h b/folly/Synchronized.h index 83ca833d..0e692789 100644 --- a/folly/Synchronized.h +++ b/folly/Synchronized.h @@ -49,7 +49,8 @@ struct HasLockUnlock { enum { value = IsOneOf