Have check_wuffs_version return a status code

This commit is contained in:
Nigel Tao committed 2018-08-05 22:29:54 +10:00
1 parent 845ffbeb86
commit fd43e777bc
21 files changed
+628 -466

No files matched your search

@@ -23,6 +23,9 @@ extern "C" {
#define WUFFS_BASE__IGNORE_POTENTIALLY_UNUSED_VARIABLE(x) (void)(x)
static inline void wuffs_base__ignore_check_wuffs_version_status(
wuffs_base__status z) {}
// WUFFS_BASE__MAGIC is a magic number to check that initializers are called.
// It's not foolproof, given C doesn't automatically zero memory before use,
// but it should catch 99.99% of cases.
@@ -59,6 +59,13 @@ extern "C" {
#define WUFFS_BASE__MAYBE_STATIC
#endif
// Clang also defines "__GNUC__".
#if defined(__GNUC__)
#define WUFFS_BASE__WARN_UNUSED_RESULT __attribute__((warn_unused_result))
#else
#define WUFFS_BASE__WARN_UNUSED_RESULT
#endif
// wuffs_base__empty_struct is used when a Wuffs function returns an empty
// struct. In C, if a function f returns void, you can't say "x = f()", but in
// Wuffs, if a function g returns empty, you can say "y = g()".