Commit 0e2b9093 authored by Elizabeth Smith's avatar Elizabeth Smith Committed by Tudor Bosman

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
parent a303e3e4
...@@ -308,7 +308,7 @@ fbstring errnoStr(int err) { ...@@ -308,7 +308,7 @@ fbstring errnoStr(int err) {
// https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man3/strerror_r.3.html // 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 // 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) ((_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) && !_GNU_SOURCE)
// Using XSI-compatible strerror_r // Using XSI-compatible strerror_r
int r = strerror_r(err, buf, sizeof(buf)); int r = strerror_r(err, buf, sizeof(buf));
......
...@@ -49,7 +49,8 @@ struct HasLockUnlock { ...@@ -49,7 +49,8 @@ struct HasLockUnlock {
enum { value = IsOneOf<T, enum { value = IsOneOf<T,
std::mutex, std::recursive_mutex, std::mutex, std::recursive_mutex,
boost::mutex, boost::recursive_mutex, boost::shared_mutex boost::mutex, boost::recursive_mutex, boost::shared_mutex
#ifndef __APPLE__ // OSX doesn't have timed mutexes // OSX and Cygwin don't have timed mutexes
#if !defined(__APPLE__) && !defined(__CYGWIN__)
,std::timed_mutex, std::recursive_timed_mutex, ,std::timed_mutex, std::recursive_timed_mutex,
boost::timed_mutex, boost::recursive_timed_mutex boost::timed_mutex, boost::recursive_timed_mutex
#endif #endif
...@@ -97,7 +98,8 @@ acquireReadWrite(T& mutex) { ...@@ -97,7 +98,8 @@ acquireReadWrite(T& mutex) {
mutex.lock(); mutex.lock();
} }
#ifndef __APPLE__ // OSX doesn't have timed mutexes // OSX and Cygwin don't have timed mutexes
#if !defined(__APPLE__) && !defined(__CYGWIN__)
/** /**
* Acquires a mutex for reading and writing with timeout by calling * Acquires a mutex for reading and writing with timeout by calling
* .try_lock_for(). This applies to two of the std mutex classes as * .try_lock_for(). This applies to two of the std mutex classes as
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment