ossrs / srs

SRS is a simple, high-efficiency, real-time video server supporting RTMP, WebRTC, HLS, HTTP-FLV, SRT, MPEG-DASH, and GB28181.
https://ossrs.io
MIT License
24.86k stars 5.29k forks source link

Build: Check __GLIBC__ for OpenHarmony to fix build fail. v6.0.83 #3777

Closed terrencetang2023 closed 9 months ago

terrencetang2023 commented 11 months ago

When I compile on OpenHarmony, I encounter an error at the pthread_setname_np function:

./src/app/srs_app_threads.cpp:53:10: error: functions that differ only in their return type cannot be overloaded
void pthread_setname_np(pthread_t trd, const char* name) {
/data/local/ohos-sdk/linux/native/llvm/bin/../../sysroot/usr/include/pthread.h:379:5: note: previous declaration is here
int pthread_setname_np(pthread_t, const char *);

Our libc is using musl-libc and has no defined GLIBC, so we wanted to add a judgment that GLIBC already defined.


TRANS_BY_GPT4