Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bluetooth: CTS: Fix includes to avoid build error with some libCs #81415

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

aescolar
Copy link
Member

@aescolar aescolar commented Nov 14, 2024

Remove unnecessary include in header and source file which causes conflicting type definitions with some libCs.

gmtime_r() is an extension to the C library, and therefore one needs to explicitly ask for its prototype to have it exposed. This is done by defining _POSIX_C_SOURCE so let's do so.

These two changes fix build errors with some libCs. Tested with pico, newlib, minimal and the host glibc with CONFIG_BT_CTS_HELPER_API set to n and y

Related to #81412
Fixes #81416

@aescolar aescolar added the bug The issue is a bug, or the PR is fixing a bug label Nov 15, 2024
Remove unnecessary include in header and source file.

gmtime_r() is an extension to the C library, and therefore one
needs to explicitly ask for its prototype to have it exposed.
This is done by defining _POSIX_C_SOURCE so let's do so.

These two changes fix build errors with some libCs.
Tested with pico, newlib, minimal and the host glibc.

Signed-off-by: Alberto Escolar Piedras <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Bluetooth Host area: Bluetooth bug The issue is a bug, or the PR is fixing a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BT CTS fails to build with some libCs
5 participants