--- a/lib/ext2fs/tdb.c
+++ b/lib/ext2fs/tdb.c
@@ -110,7 +110,9 @@ static char *rep_strdup(const char *s)
 #endif
 #endif
 
+#if defined __STDC__ && defined __STDC_VERSION__ && __STDC_VERSION__ <= 201710L
 typedef int bool;
+#endif
 
 #include "tdb.h"
 
