From: Christopher Dykes Date: Tue, 26 Jan 2016 16:59:32 +0000 (-0800) Subject: Use FOLLY_DEPRECATED rather than directly using GCC specific attributes. X-Git-Tag: deprecate-dynamic-initializer~140 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=68a47850f7cd222e3664e82fc9da2b3c0e3b3d28;p=folly.git Use FOLLY_DEPRECATED rather than directly using GCC specific attributes. Summary: Without this MSVC can't compile. Reviewed By: lbrandy Differential Revision: D2856598 fb-gh-sync-id: 0e146afe844b0ce5d3782528ed9c3de53f7c8b05 --- diff --git a/folly/Singleton.h b/folly/Singleton.h index 20a043d7..8f55a49a 100644 --- a/folly/Singleton.h +++ b/folly/Singleton.h @@ -503,18 +503,15 @@ class Singleton { // Generally your program life cycle should be fine with calling // get() repeatedly rather than saving the reference, and then not // call get() during process shutdown. - static T* get() __attribute__ ((__deprecated__("Replaced by try_get"))) { - return getEntry().get(); - } + FOLLY_DEPRECATED("Replaced by try_get") + static T* get() { return getEntry().get(); } // If, however, you do need to hold a reference to the specific // singleton, you can try to do so with a weak_ptr. Avoid this when // possible but the inability to lock the weak pointer can be a // signal that the vault has been destroyed. - static std::weak_ptr - get_weak() __attribute__ ((__deprecated__("Replaced by try_get"))) { - return getEntry().get_weak(); - } + FOLLY_DEPRECATED("Replaced by try_get") + static std::weak_ptr get_weak() { return getEntry().get_weak(); } // Preferred alternative to get_weak, it returns shared_ptr that can be // stored; a singleton won't be destroyed unless shared_ptr is destroyed.