# error cannot define platform specific thread local storage
#endif
-#if defined(__APPLE__) && (TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE)
+#if FOLLY_MOBILE
#undef FOLLY_TLS
#endif
#endif
// iOS doesn't define _mm_cvtsi64_si128 and friends
-#if (FOLLY_SSE >= 2) && !TARGET_OS_IPHONE
+#if (FOLLY_SSE >= 2) && !FOLLY_MOBILE
#define RW_SPINLOCK_USE_SSE_INSTRUCTIONS_
#else
#undef RW_SPINLOCK_USE_SSE_INSTRUCTIONS_
[for c++11 atomic support without GNU Atomic library],
[folly_cv_lib_libatomic],
[AC_LINK_IFELSE(
- [AC_LANG_PROGRAM[
+ [AC_LANG_SOURCE[
#include <atomic>
int main() {
struct Test { int val; };
AC_CHECK_HEADERS([libunwind.h],, [use_follytestmain=no])
fi
+AC_ARG_ENABLE([mobile],
+ AS_HELP_STRING([--enable-mobile],
+ [enables using main function from folly for tests]),
+ [mobile=${enableval}], [mobile=no])
+AS_IF([test "x${mobile}" = "xyes"], [
+ AC_DEFINE([MOBILE], [1],
+ [Define to 1 for compiler guards for mobile targets.])
+])
+
# Include directory that contains "folly" so #include <folly/Foo.h> works
AM_CPPFLAGS='-I$(top_srcdir)/..'
AM_CPPFLAGS="$AM_CPPFLAGS $BOOST_CPPFLAGS"
*/
#include <folly/detail/MemoryIdler.h>
+
#include <folly/Logging.h>
#include <folly/Malloc.h>
+#include <folly/Portability.h>
#include <folly/ScopeGuard.h>
#include <folly/detail/CacheLocality.h>
#include <limits.h>
#include <pthread.h>
#include <stdio.h>
#include <string.h>
-#include <unistd.h>
#include <sys/mman.h>
+#include <unistd.h>
#include <utility>
-
namespace folly { namespace detail {
AtomicStruct<std::chrono::steady_clock::duration>
// Stack madvise isn't Linux or glibc specific, but the system calls
// and arithmetic (and bug compatibility) are not portable. The set of
// platforms could be increased if it was useful.
-#if (FOLLY_X64 || FOLLY_PPC64 ) && defined(_GNU_SOURCE) && defined(__linux__)
+#if (FOLLY_X64 || FOLLY_PPC64) && defined(_GNU_SOURCE) && \
+ defined(__linux__) && !FOLLY_MOBILE
static FOLLY_TLS uintptr_t tls_stackLimit;
static FOLLY_TLS size_t tls_stackSize;
#include <glog/logging.h>
-#include <folly/Foreach.h>
#include <folly/Exception.h>
+#include <folly/Foreach.h>
#include <folly/Malloc.h>
#include <folly/MicroSpinLock.h>
+#include <folly/Portability.h>
#include <folly/detail/StaticSingletonManager.h>
//
// XXX: Ideally we would instead determine if emutls is in use at runtime as it
// is possible to configure glibc on Linux to use emutls regardless.
-#if !__APPLE__ && !__ANDROID__
+#if !FOLLY_MOBILE && !defined(__APPLE__)
#define FOLLY_TLD_USE_FOLLY_TLS 1
#else
#undef FOLLY_TLD_USE_FOLLY_TLS
#include <folly/futures/detail/Core.h>
#include <folly/futures/Timekeeper.h>
-#if defined(__ANDROID__) || defined(__APPLE__)
+#if FOLLY_MOBILE || defined(__APPLE__)
#define FOLLY_FUTURE_USING_FIBER 0
#else
#define FOLLY_FUTURE_USING_FIBER 1