While this header is standard in C99, it does not exist in C89/C90.
Microsoft Visual Studio added this header only in version 2013.
Still common common compilers Visual Studio 2010 and 2012 (and all earlier)
do not support it.
Here we do not really have a benefit as compared to just using 'int'
instead of 'bool', so this dependency can easily be avoided to support
Visual Studio 2010 (see also https://github.com/libcheck/check/issues/125).
}
-bool check_list_contains(List * lp, void *val)
+int check_list_contains(List * lp, void *val)
{
for(check_list_front(lp); !check_list_at_end(lp); check_list_advance(lp))
{
if(check_list_val(lp) == val)
{
- return true;
+ return 1;
}
}
- return false;
+ return 0;
}
#ifndef CHECK_LIST_H
#define CHECK_LIST_H
-#include <stdbool.h>
-
typedef struct List List;
/* Create an empty list */
void check_list_apply(List * lp, void (*fp) (void *));
/* Return true if the list contains the value, false otherwise */
-bool check_list_contains(List * lp, void *val);
+int check_list_contains(List * lp, void *val);
#endif /* CHECK_LIST_H */