bluekitchen / btstack

Dual-mode Bluetooth stack, with small memory footprint.
http://bluekitchen-gmbh.com
Other
1.74k stars 614 forks source link

Reordered hci.c definition guards #642

Closed tyler-marr closed 2 weeks ago

tyler-marr commented 2 weeks ago

When building under certain combinations of btstack_config.h settings, some of the functions in hci.c are either:

AKA: -Werror=unused-function

I've reordered some of the guards around function declarations and definitions to match where they are called.

For example le_handle_extended_advertisement_report's declaration is behind ENABLE_LE_EXTENDED_ADVERTISING, ENABLE_LE_PERIPHERAL and ENABLE_BLE. But its definition and usage are both behind ENABLE_LE_EXTENDED_ADVERTISING, ENABLE_LE_CENTRAL and ENABLE_BLE. So I've moved the declaration to match the definition and usage.

mringwal commented 2 weeks ago

Hi Tyler. Thanks for the fix. Your editor did remove all whitespace, which is a good thing in general, but doesn't make reviewing a PR easier :) - I've made similar changes on develop in commit 91097d8. Please let me know if that doesn't works for you (it's almost identical to this PR).

tyler-marr commented 2 weeks ago

Hi Matthias. Thanks for the patch, that has fixed most of them, but the definition of hci_handle_connection_failed still needs to be wrapped in #if defined(ENABLE_CLASSIC) || defined(ENABLE_LE_CENTRAL).

I'll ready another PR with just that (and no whitespace changes this time :laughing:).

mringwal commented 2 weeks ago

Thanks for reporting, I'll fix it later - you don't need to provide a PR for this.

mringwal commented 2 weeks ago

See f0f9554

If you find more build 'inconsistencies' feel free to open a new issue.