From: Michael Lee <mzlee@fb.com>
Date: Wed, 22 Mar 2017 17:41:23 +0000 (-0700)
Subject: Android should also use a relaxed Singleton
X-Git-Tag: v2017.03.27.00~15
X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=50167291952314cf802be7ffc06f55fea2f33320;p=folly.git

Android should also use a relaxed Singleton

Summary: On Android, we should also use a relaxed singleton

Reviewed By: andriigrynenko

Differential Revision: D4754227

fbshipit-source-id: 157844e618d216b768bbb07f36c380ba2f4c9ab8
---

diff --git a/folly/Singleton.cpp b/folly/Singleton.cpp
index 4f24328e..7d3eeac6 100644
--- a/folly/Singleton.cpp
+++ b/folly/Singleton.cpp
@@ -28,7 +28,7 @@
 
 #include <folly/ScopeGuard.h>
 
-#if !defined(_WIN32) && !defined(__APPLE__)
+#if !defined(_WIN32) && !defined(__APPLE__) && !defined(__ANDROID__)
 static void hs_init_weak(int* argc, char** argv[])
     __attribute__((__weakref__("hs_init")));
 #endif
@@ -36,7 +36,7 @@ static void hs_init_weak(int* argc, char** argv[])
 namespace folly {
 
 SingletonVault::Type SingletonVault::defaultVaultType() {
-#if !defined(_WIN32) && !defined(__APPLE__)
+#if !defined(_WIN32) && !defined(__APPLE__) && !defined(__ANDROID__)
   bool isPython = dlsym(RTLD_DEFAULT, "Py_Main");
   bool isHaskel = &::hs_init_weak || dlsym(RTLD_DEFAULT, "hs_init");
   bool isJVM = dlsym(RTLD_DEFAULT, "JNI_GetCreatedJavaVMs");