5#ifndef FLUTTER_FML_NATIVE_LIBRARY_H_
6#define FLUTTER_FML_NATIVE_LIBRARY_H_
15#if defined(FML_OS_WIN)
34 bool close_handle_when_done);
40 auto* resolved_symbol = Resolve(symbol);
41 if (!resolved_symbol) {
44 return std::optional<T>(
reinterpret_cast<T
>(resolved_symbol));
48 auto* resolved_symbol =
reinterpret_cast<const uint8_t*
>(Resolve(symbol));
49 if (resolved_symbol ==
nullptr) {
50 FML_DLOG(INFO) <<
"Could not resolve symbol in library: " << symbol;
52 return resolved_symbol;
57 bool close_handle_ =
true;
static fml::RefPtr< NativeLibrary > CreateForCurrentProcess()
const std::optional< T > ResolveFunction(const char *symbol)
static fml::RefPtr< NativeLibrary > Create(const char *path)
static fml::RefPtr< NativeLibrary > CreateWithHandle(Handle handle, bool close_handle_when_done)
const uint8_t * ResolveSymbol(const char *symbol)
#define FML_DLOG(severity)
#define FML_DISALLOW_COPY_AND_ASSIGN(TypeName)
#define FML_FRIEND_REF_COUNTED_THREAD_SAFE(T)
#define FML_FRIEND_MAKE_REF_COUNTED(T)