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)
@@ -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 ...) \
{ \
- .u.type = BLE_UUID_TYPE_128, \
+ .u = { \
+ .type = BLE_UUID_TYPE_128, \
+ }, \
.value = { uuid128 }, \
}
