Skip to content

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

Merged
winlinvip merged 3 commits intoossrs:developfrom
terrencetang2023:bugfix/glibc-pthread
Sep 22, 2023
Merged

Build: Check __GLIBC__ for OpenHarmony to fix build fail. v6.0.83#3777
winlinvip merged 3 commits intoossrs:developfrom
terrencetang2023:bugfix/glibc-pthread

Conversation

@terrencetang2023
Copy link
Copy Markdown
Contributor

@terrencetang2023 terrencetang2023 commented Aug 21, 2023

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

@winlinvip winlinvip added the TransByAI Translated by AI/GPT. label Aug 21, 2023
@winlinvip winlinvip changed the title Compile: Add a __GLIBC__ definition for the pthread_setname_np Compile: Add a __GLIBC__ definition for the pthread_setname_np. v6.0.83 Sep 22, 2023
@winlinvip winlinvip added the RefinedByAI Refined by AI/GPT. label Sep 22, 2023
@winlinvip winlinvip changed the title Compile: Add a __GLIBC__ definition for the pthread_setname_np. v6.0.83 Build: Check __GLIBC__ for OpenHarmony to fix build fail. v6.0.83 Sep 22, 2023
@winlinvip winlinvip merged commit 5b31225 into ossrs:develop Sep 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

RefinedByAI Refined by AI/GPT. TransByAI Translated by AI/GPT.

Development

Successfully merging this pull request may close these issues.

2 participants