Skip to content

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
@aescolar aescolar force-pushed the fix_bt_peripheral_sample branch from 577bdda to be37dd6 Compare November 15, 2024 08:01
jhedberg
jhedberg previously approved these changes Nov 15, 2024
Thalley
Thalley previously approved these changes Nov 15, 2024
@aescolar aescolar dismissed stale reviews from Thalley and jhedberg via 6da69c8 November 18, 2024 16:38
@aescolar aescolar force-pushed the fix_bt_peripheral_sample branch from be37dd6 to 6da69c8 Compare November 18, 2024 16:38
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]>
@aescolar aescolar force-pushed the fix_bt_peripheral_sample branch from 6da69c8 to 74c0105 Compare November 18, 2024 16:38
@aescolar
Copy link
Member Author

1st push is @alwa-nordic requested change
2nd push is just a rebase

@nashif nashif merged commit a785548 into zephyrproject-rtos:main Nov 19, 2024
26 checks passed
@aescolar aescolar deleted the fix_bt_peripheral_sample branch November 19, 2024 08:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: Bluetooth Host Bluetooth Host (excluding BR/EDR) 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

6 participants