Merge pull request #405 from tekktonic/master

Fix on OpenBSD
This commit is contained in:
mjbudd77 2021-09-30 19:01:52 -04:00 committed by GitHub
commit 35cbbbacf9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 3 deletions

View File

@ -132,7 +132,13 @@ else(WIN32)
set( OPENGL_LDFLAGS "-framework OpenGL" ) set( OPENGL_LDFLAGS "-framework OpenGL" )
else() else()
set( OPENGL_LDFLAGS ${OPENGL_LIBRARIES} ) set( OPENGL_LDFLAGS ${OPENGL_LIBRARIES} )
set( SYS_LIBS -lrt -lpthread -ldl) # OpenBSD refuses to implement the POSIX realtime interface and
# refuses to provide a stub library for -ldl
if(${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD")
set( SYS_LIBS -lpthread)
else()
set( SYS_LIBS -lrt -lpthread -ldl)
endif()
endif() endif()
endif(WIN32) endif(WIN32)

View File

@ -4086,7 +4086,7 @@ int consoleWin_t::getSchedParam( int &policy, int &priority )
{ {
int ret = 0; int ret = 0;
#if defined(__linux__) || defined(__unix__) #if defined(__linux__) || defined(__unix__) && !defined(__OpenBSD__)
struct sched_param p; struct sched_param p;
policy = sched_getscheduler( getpid() ); policy = sched_getscheduler( getpid() );
@ -4122,7 +4122,7 @@ int consoleWin_t::getSchedParam( int &policy, int &priority )
int consoleWin_t::setSchedParam( int policy, int priority ) int consoleWin_t::setSchedParam( int policy, int priority )
{ {
int ret = 0; int ret = 0;
#if defined(__linux__) || defined(__unix__) #if defined(__linux__) || defined(__unix__) && !defined(__OpenBSD__)
struct sched_param p; struct sched_param p;
int minPrio, maxPrio; int minPrio, maxPrio;