Commit 50167291 authored by Michael Lee's avatar Michael Lee Committed by Facebook Github Bot

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
parent 3c0df746
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
#include <folly/ScopeGuard.h> #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[]) static void hs_init_weak(int* argc, char** argv[])
__attribute__((__weakref__("hs_init"))); __attribute__((__weakref__("hs_init")));
#endif #endif
...@@ -36,7 +36,7 @@ static void hs_init_weak(int* argc, char** argv[]) ...@@ -36,7 +36,7 @@ static void hs_init_weak(int* argc, char** argv[])
namespace folly { namespace folly {
SingletonVault::Type SingletonVault::defaultVaultType() { SingletonVault::Type SingletonVault::defaultVaultType() {
#if !defined(_WIN32) && !defined(__APPLE__) #if !defined(_WIN32) && !defined(__APPLE__) && !defined(__ANDROID__)
bool isPython = dlsym(RTLD_DEFAULT, "Py_Main"); bool isPython = dlsym(RTLD_DEFAULT, "Py_Main");
bool isHaskel = &::hs_init_weak || dlsym(RTLD_DEFAULT, "hs_init"); bool isHaskel = &::hs_init_weak || dlsym(RTLD_DEFAULT, "hs_init");
bool isJVM = dlsym(RTLD_DEFAULT, "JNI_GetCreatedJavaVMs"); bool isJVM = dlsym(RTLD_DEFAULT, "JNI_GetCreatedJavaVMs");
......
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