Skip to content

Commit

Permalink
Fix build issue in Mac OS X due missing scheduler
Browse files Browse the repository at this point in the history
  • Loading branch information
amadvance committed Nov 3, 2016
1 parent 840d2ba commit 2db195e
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
12 changes: 12 additions & 0 deletions advance/lib/config.hin
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,21 @@
/* Define to 1 if you have the <netinet/in.h> header file. */
#undef HAVE_NETINET_IN_H

/* Define to 1 if you have the `sched_getscheduler' function. */
#undef HAVE_SCHED_GETSCHEDULER

/* Define to 1 if you have the `sched_get_priority_max' function. */
#undef HAVE_SCHED_GET_PRIORITY_MAX

/* Define to 1 if you have the <sched.h> header file. */
#undef HAVE_SCHED_H

/* Define to 1 if you have the `sched_setscheduler' function. */
#undef HAVE_SCHED_SETSCHEDULER

/* Define to 1 if you have the `sched_yield' function. */
#undef HAVE_SCHED_YIELD

/* Define to 1 if you have the <slang.h> header file. */
#undef HAVE_SLANG_H

Expand Down
2 changes: 1 addition & 1 deletion advance/linux/os.c
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ int os_inner_init(const char* title)
#endif
#endif

#ifdef _POSIX_PRIORITY_SCHEDULING /* OSDEF Check for POSIX scheduling */
#if HAVE_SCHED_GETSCHEDULER && HAVE_SCHED_SETSCHEDULER && HAVE_SCHED_GET_PRIORITY_MAX && defined(_POSIX_PRIORITY_SCHEDULING) /* OSDEF Check for POSIX scheduling */
log_std(("os: scheduling available\n"));
#ifdef SCHED_FIFO
/* set the SCHED_FIFO scheduling policy with maximum priority */
Expand Down
2 changes: 1 addition & 1 deletion advance/linux/target.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ void target_done(void)

void target_yield(void)
{
#ifdef _POSIX_PRIORITY_SCHEDULING /* OSDEF Check for POSIX scheduling */
#if HAVE_SCHED_YIELD && defined(_POSIX_PRIORITY_SCHEDULING) /* OSDEF Check for POSIX scheduling */
sched_yield();
#endif
}
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ if test $ac_system = unix ; then
AC_CHECK_FUNCS([strcasecmp strerror])
AC_CHECK_FUNCS([uname sysconf backtrace backtrace_symbols])
AC_CHECK_FUNCS([flockfile funlockfile fread_unlocked fwrite_unlocked fgetc_unlocked feof_unlocked fseeko ftello])
AC_CHECK_FUNCS([iopl mprotect])
AC_CHECK_FUNCS([iopl mprotect sched_getscheduler sched_setscheduler sched_get_priority_max sched_yield])
AC_MSG_CHECKING([for port in/out])
AC_TRY_LINK([
#include <sys/io.h>
Expand Down

0 comments on commit 2db195e

Please sign in to comment.