rtpproxy icon indicating copy to clipboard operation
rtpproxy copied to clipboard

error: implicit declaration of function 'sched_setscheduler'

Open Talbot3 opened this issue 4 years ago • 0 comments

hi, rtpproxy compile on macosx failed.

Env

gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/c++/4.2.1
Apple LLVM version 10.0.1 (clang-1001.0.46.4)
Target: x86_64-apple-darwin18.7.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
brew upgrade gcc
gcc 9.1.0 already installed

Log

make
/Applications/Xcode.app/Contents/Developer/usr/bin/make  all-am
gcc -DWITHOUT_SIPLOG -Wall -DRTPP_LOG_ADVANCED -DHAVE_CONFIG_H -I.    -Werror=implicit-function-declaration -Wall -g -O2 -MT rtpproxy-main.o -MD -MP -MF .deps/rtpproxy-main.Tpo -c -o rtpproxy-main.o `test -f 'main.c' || echo './'`main.c
main.c:807:13: error: implicit declaration of function 'sched_setscheduler' is invalid
      in C99 [-Werror,-Wimplicit-function-declaration]
        if (sched_setscheduler(0, cf.stable->sched_policy, &sparam) == -1) {
            ^
1 error generated.
make[1]: *** [rtpproxy-main.o] Error 1
make: *** [all] Error 2

Fix

macosx not support sched_setscheduler api. i just know little c language. could you replace this api on macosx

Talbot3 avatar Jul 29 '19 14:07 Talbot3