X-Git-Url: http://plrg.eecs.uci.edu/git/?p=folly.git;a=blobdiff_plain;f=folly%2FSingleton.cpp;h=7114d53de9df1ca16c630913636a4dc6436e1ddf;hp=4f24328e9b2a13f4ab1b03f018933a4afbf386a2;hb=7fc3f9174951941df7a7a32acf320185716c26a6;hpb=7d0d018f7661e1994c7f68c8b80483d80a96f9fd diff --git a/folly/Singleton.cpp b/folly/Singleton.cpp index 4f24328e..7114d53d 100644 --- a/folly/Singleton.cpp +++ b/folly/Singleton.cpp @@ -28,7 +28,7 @@ #include -#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"); @@ -60,7 +60,7 @@ namespace detail { << type.name() << ">\n"; std::abort(); } -} +} // namespace detail namespace { @@ -88,7 +88,7 @@ FatalHelper fatalHelper; FatalHelper __attribute__ ((__init_priority__ (101))) fatalHelper; #endif -} +} // namespace SingletonVault::~SingletonVault() { destroyInstances(); } @@ -266,4 +266,4 @@ void SingletonVault::scheduleDestroyInstances() { static SingletonVaultDestructor singletonVaultDestructor; } -} +} // namespace folly