xref: /freebsd/contrib/netbsd-tests/lib/libpthread/h_common.h (revision b9f654b163bce26de79705e77b872427c9f2afa1)
1 #ifndef H_COMMON_H
2 #define H_COMMON_H
3 
4 #include <string.h>
5 
6 #define PTHREAD_REQUIRE(x) \
7     do { \
8         int _ret = (x); \
9         ATF_REQUIRE_MSG(_ret == 0, "%s: %s", #x, strerror(_ret)); \
10     } while (0)
11 
12 #define PTHREAD_REQUIRE_STATUS(x, v) \
13     do { \
14         int _ret = (x); \
15         ATF_REQUIRE_MSG(_ret == (v), "%s: %s", #x, strerror(_ret)); \
16     } while (0)
17 
18 #endif // H_COMMON_H
19