nimble/host: Make BLE_UUIDxx_INIT macros C++ compatible

Allows to use `ble_uuid.h` with C++ by changing the BLE_UUIDy_INIT macros.
Build environment:

ninja 1.9.0
cmake 3.16
xtensa-esp32-elf-gcc.exe (crosstool-NG esp-2021r2-patch3) 8.4.0 (based on GCC 8.4.0)
This commit is contained in:
Daniel Kampert
2022-11-07 12:24:43 +05:30
committed by Rahul Tank
parent d7aa88a1f9
commit 63b114e944
+10 -4
View File
@@ -82,19 +82,25 @@ typedef union {
#define BLE_UUID16_INIT(uuid16) \
{ \
.u.type = BLE_UUID_TYPE_16, \
.u = { \
.type = BLE_UUID_TYPE_16, \
}, \
.value = (uuid16), \
}
#define BLE_UUID32_INIT(uuid32) \
{ \
.u.type = BLE_UUID_TYPE_32, \
.u = { \
.type = BLE_UUID_TYPE_32, \
}, \
.value = (uuid32), \
}
#define BLE_UUID128_INIT(uuid128...) \
#define BLE_UUID128_INIT(uuid128 ...) \
{ \
.u.type = BLE_UUID_TYPE_128, \
.u = { \
.type = BLE_UUID_TYPE_128, \
}, \
.value = { uuid128 }, \
}