Skip to content

Commit 17be7ff

Browse files
pillo79fabiobaltieri
authored andcommitted
device.h: fix inconsistent semicolon logic for DEVICE_DT_DEFINE
When CONFIG_LLEXT_EXPORT_DEVICES is not enabled, the DEVICE_DT_DEFINE macro ends with the contents of the Z_DEVICE_DEFINE macro, which always includes a terminating semicolon. When CONFIG_LLEXT_EXPORT_DEVICES is enabled, the macro ends with Z_DEVICE_EXPORT, which does _not_ include a terminating semicolon. This leads to a syntax error in places where the DEVICE_DT_DEFINE macro is used without it. Fix this by adjusting the added code when CONFIG_LLEXT_EXPORT_DEVICES is enabled to include a semicolon after the Z_DEVICE_EXPORT macro; also use the opportunity to remove a stray backslash. Signed-off-by: Luca Burelli <[email protected]>
1 parent 9ae2e23 commit 17be7ff

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/zephyr/device.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ typedef int16_t device_handle_t;
208208
level, prio, api, \
209209
&Z_DEVICE_STATE_NAME(Z_DEVICE_DT_DEV_ID(node_id)), \
210210
__VA_ARGS__) \
211-
IF_ENABLED(CONFIG_LLEXT_EXPORT_DEVICES, (; Z_DEVICE_EXPORT(node_id))) \
211+
IF_ENABLED(CONFIG_LLEXT_EXPORT_DEVICES, (Z_DEVICE_EXPORT(node_id);))
212212

213213
/**
214214
* @brief Like DEVICE_DT_DEFINE(), but uses an instance of a `DT_DRV_COMPAT`

0 commit comments

Comments
 (0)