int sd_hwdb_seek(sd_hwdb *hwdb, const char *modalias);
int sd_hwdb_enumerate(sd_hwdb *hwdb, const char **key, const char **value);
-#define FOREACH_HWDB_PROPERTY(hwdb, modalias, key, value) \
- if (sd_hwdb_seek(hwdb, modalias) >= 0) \
- while (sd_hwdb_enumerate(hwdb, &(key), &(value)) > 0)
+/* the inverse condition avoids ambiguity of danling 'else' after the macro */
+#define SD_HWDB_FOREACH_PROPERTY(hwdb, modalias, key, value) \
+ if (sd_hwdb_seek(hwdb, modalias) < 0) { } \
+ else while (sd_hwdb_enumerate(hwdb, &(key), &(value)) > 0)
#endif