Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build on OpenBSD #79

Merged
merged 5 commits into from
Feb 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions cmake/libusrsctp.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ elseif (APPLE)
HAVE_SA_LEN
HAVE_SCONN_LEN
)
elseif (CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
klemensn marked this conversation as resolved.
Show resolved Hide resolved
target_compile_definitions(libusrsctp
PRIVATE
__Userspace_os_OpenBSD
)
else()
target_compile_definitions(libusrsctp
PRIVATE
Expand Down
5 changes: 5 additions & 0 deletions cmake/libwebrtcbuild.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@ else()
INTERFACE
WEBRTC_FREEBSD
)
elseif (CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
target_compile_definitions(libwebrtcbuild
INTERFACE
WEBRTC_OPENBSD
)
endif()
endif()

Expand Down
2 changes: 1 addition & 1 deletion src/rtc_base/byte_order.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@

#elif defined(WEBRTC_LINUX)
#include <endian.h>
#elif defined(WEBRTC_FREEBSD)
#elif defined(WEBRTC_FREEBSD) || defined(WEBRTC_OPENBSD)
#include <sys/endian.h>
#else
#error "Missing byte order functions for this arch."
Expand Down
4 changes: 3 additions & 1 deletion src/rtc_base/platform_thread_types.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ typedef HRESULT(WINAPI* RTC_SetThreadDescription)(HANDLE hThread,
PCWSTR lpThreadDescription);
#endif

#if defined(WEBRTC_FREEBSD)
#if defined(WEBRTC_FREEBSD) || defined(WEBRTC_OPENBSD)
#include <pthread_np.h>
#endif

Expand Down Expand Up @@ -115,6 +115,8 @@ void SetCurrentThreadName(const char* name) {
prctl(PR_SET_NAME, reinterpret_cast<unsigned long>(name)); // NOLINT
#elif defined(WEBRTC_FREEBSD)
pthread_setname_np(pthread_self(), name);
#elif defined(WEBRTC_OPENBSD)
pthread_set_name_np(pthread_self(), name);
#elif defined(WEBRTC_MAC) || defined(WEBRTC_IOS)
pthread_setname_np(name);
#endif
Expand Down
6 changes: 6 additions & 0 deletions src/rtc_base/platform_thread_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,13 @@ typedef DWORD PlatformThreadRef;
typedef zx_handle_t PlatformThreadId;
typedef zx_handle_t PlatformThreadRef;
#elif defined(WEBRTC_POSIX)
#if defined(WEBRTC_MAC) || defined(WEBRTC_IOS)
typedef mach_port_t PlatformThreadId;
#elif defined(WEBRTC_LINUX)
typedef pid_t PlatformThreadId;
#else
typedef intptr_t PlatformThreadId;
#endif
typedef pthread_t PlatformThreadRef;
#endif

Expand Down