From 9fd95b93f777b9ebab6a23d4fb20907a3baee37b Mon Sep 17 00:00:00 2001 From: David Carlier Date: Sun, 2 Jun 2019 20:25:42 +0100 Subject: [PATCH] FreeBSD build fix --- modules/videoio/src/backend_plugin.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/videoio/src/backend_plugin.cpp b/modules/videoio/src/backend_plugin.cpp index 12e934b8c3..a29e360784 100644 --- a/modules/videoio/src/backend_plugin.cpp +++ b/modules/videoio/src/backend_plugin.cpp @@ -21,7 +21,7 @@ using namespace std; #if defined(_WIN32) #include -#elif defined(__linux__) || defined(__APPLE__) || defined(__OpenBSD__) +#elif defined(__linux__) || defined(__APPLE__) || defined(__OpenBSD__) || defined(__FreeBSD__) #include #endif @@ -29,7 +29,7 @@ namespace cv { namespace impl { #if defined(_WIN32) typedef HMODULE LibHandle_t; -#elif defined(__linux__) || defined(__APPLE__) || defined(__OpenBSD__) +#elif defined(__linux__) || defined(__APPLE__) || defined(__OpenBSD__) || defined(__FreeBSD__) typedef void* LibHandle_t; #endif @@ -44,7 +44,7 @@ void* getSymbol_(LibHandle_t h, const char* symbolName) { #if defined(_WIN32) return (void*)GetProcAddress(h, symbolName); -#elif defined(__linux__) || defined(__APPLE__) || defined(__OpenBSD__) +#elif defined(__linux__) || defined(__APPLE__) || defined(__OpenBSD__) || defined(__FreeBSD__) return dlsym(h, symbolName); #endif } @@ -54,7 +54,7 @@ LibHandle_t libraryLoad_(const char* filename) { #if defined(_WIN32) return LoadLibraryA(filename); -#elif defined(__linux__) || defined(__APPLE__) || defined(__OpenBSD__) +#elif defined(__linux__) || defined(__APPLE__) || defined(__OpenBSD__) || defined(__FreeBSD__) return dlopen(filename, RTLD_LAZY); #endif } @@ -64,7 +64,7 @@ void libraryRelease_(LibHandle_t h) { #if defined(_WIN32) FreeLibrary(h); -#elif defined(__linux__) || defined(__APPLE__) || defined(__OpenBSD__) +#elif defined(__linux__) || defined(__APPLE__) || defined(__OpenBSD__) || defined(__FreeBSD__) dlclose(h); #endif }