Commit d2bc1134 authored by Mingtao Yang's avatar Mingtao Yang Committed by Facebook Github Bot

Make OpenSSLVersionFinder static methods free functions

Summary:
getOpenSSLNumericVersion was not static, while getOpenSSLLongVersion() was.
Rather than change it to static, these functions should simply be free
functions.

Reviewed By: yfeldblum

Differential Revision: D7094066

fbshipit-source-id: 808a9d169100c9d94d466d9348418a4e8a50c751
parent 2f331d91
...@@ -21,8 +21,9 @@ ...@@ -21,8 +21,9 @@
// This is used to find the OpenSSL version at runtime. Just returning // This is used to find the OpenSSL version at runtime. Just returning
// OPENSSL_VERSION_NUMBER is insufficient as runtime version may be different // OPENSSL_VERSION_NUMBER is insufficient as runtime version may be different
// from the compile-time version // from the compile-time version
struct OpenSSLVersionFinder { namespace folly {
static std::string getOpenSSLLongVersion() { namespace ssl {
inline std::string getOpenSSLLongVersion() {
#ifdef OPENSSL_VERSION_TEXT #ifdef OPENSSL_VERSION_TEXT
return SSLeay_version(SSLEAY_VERSION); return SSLeay_version(SSLEAY_VERSION);
#elif defined(OPENSSL_VERSION_NUMBER) #elif defined(OPENSSL_VERSION_NUMBER)
...@@ -30,13 +31,14 @@ struct OpenSSLVersionFinder { ...@@ -30,13 +31,14 @@ struct OpenSSLVersionFinder {
#else #else
return ""; return "";
#endif #endif
} }
uint64_t getOpenSSLNumericVersion() { inline uint64_t getOpenSSLNumericVersion() {
#ifdef OPENSSL_VERSION_NUMBER #ifdef OPENSSL_VERSION_NUMBER
return SSLeay(); return SSLeay();
#else #else
return 0; return 0;
#endif #endif
} }
}; } // namespace ssl
} // namespace folly
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