Move some implementation from header to cpp 97/308497/1
authorYonggoo Kang <ygace.kang@samsung.com>
Tue, 26 Mar 2024 11:11:57 +0000 (20:11 +0900)
committerYonggoo Kang <ygace.kang@samsung.com>
Tue, 26 Mar 2024 11:12:08 +0000 (20:12 +0900)
- Patch for the comment on the change-id 308437

Change-Id: I670332d39aa606f270792cc35b16da153a480fb8

srcs/server/dl-loader.cpp
srcs/server/dl-loader.h

index fe789358c6131226e7e6d4007c9866d8cb701cb1..11d279f60e1c39dda6a1f7152b3112b171be3c0f 100644 (file)
@@ -18,7 +18,9 @@
  * @brief       Implementation of Dynamic Library Loader
  */
 
+#include <dlfcn.h>
 #include <dl-loader.h>
+#include <webauthn-log.h>
 
 namespace WA {
 
@@ -39,4 +41,13 @@ DLLoader::~DLLoader()
         dlclose(m_libraryHandle);
 }
 
+void *DLLoader::ResolveFunction(const std::string &name) noexcept
+{
+    LogDebug("Resolving symbol: " << name << " from " << m_libraryPath);
+    void *sym = dlsym(m_libraryHandle, name.c_str());
+    if (!sym)
+        LogError("Unable to resolve symbol: " << name << " from " << m_libraryPath << ": " << dlerror());
+    return sym;
+}
+
 } // namespace WebAuthn
\ No newline at end of file
index 0d4cc2c5cc7e183eb965ec4bb811e924630229ae..b801fc597071092b0508298c85cbd74d3241dee1 100644 (file)
 
 #pragma once
 
-#include <dlfcn.h>
 #include <string>
 #include <exception.h>
-#include <webauthn-log.h>
 
 namespace WA {
 
@@ -33,14 +31,7 @@ public:
     explicit DLLoader(std::string path);
     virtual ~DLLoader();
 
-    virtual void *ResolveFunction(const std::string &name) noexcept
-    {
-        LogDebug("Resolving symbol: " << name << " from " << m_libraryPath);
-        void *sym = dlsym(m_libraryHandle, name.c_str());
-        if (!sym)
-            LogError("Unable to resolve symbol: " << name << " from " << m_libraryPath << ": " << dlerror());
-        return sym;
-    }
+    virtual void *ResolveFunction(const std::string &name) noexcept;
 
     template<typename ReturnValue, typename... Args>
     ReturnValue Invoke(const std::string &name, Args... args)