drivers: i3c: fix warning with cpp builds
When compiling with C++ enabled (CONFIG_CPP), add an unused member to prevent an empty struct; this makes the struct size the same for both C and C++. Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
This commit is contained in:
parent
f9220146e6
commit
26c03005e7
1 changed files with 7 additions and 0 deletions
|
@ -1189,9 +1189,16 @@ struct i3c_driver_config {
|
|||
|
||||
/** I3C Primary Controller Dynamic Address */
|
||||
uint8_t primary_controller_da;
|
||||
#elif defined(CONFIG_CPP)
|
||||
/* Empty struct has size 0 in C, size 1 in C++. Force them to be the same. */
|
||||
uint8_t unused_cpp_size_compatibility;
|
||||
#endif
|
||||
};
|
||||
|
||||
#if defined(CONFIG_CPP)
|
||||
BUILD_ASSERT(sizeof(struct i3c_driver_config) >= 1);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* This structure is common to all I3C drivers and is expected to be the first
|
||||
* element in the driver's struct driver_data declaration.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue