Skip to content

Commit

Permalink
Merge pull request #14628 from devnexen:openbsd_build_fix
Browse files Browse the repository at this point in the history
  • Loading branch information
alalek committed May 25, 2019
2 parents 166ecae + a6144b8 commit 6c6dd16
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
10 changes: 5 additions & 5 deletions modules/videoio/src/backend_plugin.cpp
Expand Up @@ -21,15 +21,15 @@ using namespace std;

#if defined(_WIN32)
#include <windows.h>
#elif defined(__linux__) || defined(__APPLE__)
#elif defined(__linux__) || defined(__APPLE__) || defined(__OpenBSD__)
#include <dlfcn.h>
#endif

namespace cv { namespace impl {

#if defined(_WIN32)
typedef HMODULE LibHandle_t;
#elif defined(__linux__) || defined(__APPLE__)
#elif defined(__linux__) || defined(__APPLE__) || defined(__OpenBSD__)
typedef void* LibHandle_t;
#endif

Expand All @@ -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__)
#elif defined(__linux__) || defined(__APPLE__) || defined(__OpenBSD__)
return dlsym(h, symbolName);
#endif
}
Expand All @@ -54,7 +54,7 @@ LibHandle_t libraryLoad_(const char* filename)
{
#if defined(_WIN32)
return LoadLibraryA(filename);
#elif defined(__linux__) || defined(__APPLE__)
#elif defined(__linux__) || defined(__APPLE__) || defined(__OpenBSD__)
return dlopen(filename, RTLD_LAZY);
#endif
}
Expand All @@ -64,7 +64,7 @@ void libraryRelease_(LibHandle_t h)
{
#if defined(_WIN32)
FreeLibrary(h);
#elif defined(__linux__) || defined(__APPLE__)
#elif defined(__linux__) || defined(__APPLE__) || defined(__OpenBSD__)
dlclose(h);
#endif
}
Expand Down
4 changes: 4 additions & 0 deletions modules/videoio/src/cap_v4l.cpp
Expand Up @@ -238,6 +238,10 @@ make & enjoy!
#include <sys/videoio.h>
#endif

#ifdef __OpenBSD__
typedef uint32_t __u32;
#endif

// https://github.com/opencv/opencv/issues/13335
#ifndef V4L2_CID_ISO_SENSITIVITY
#define V4L2_CID_ISO_SENSITIVITY (V4L2_CID_CAMERA_CLASS_BASE+23)
Expand Down

0 comments on commit 6c6dd16

Please sign in to comment.