From a16cd4b851d30a8b9389de6085b391e77f0a349e Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 21 Apr 2022 17:53:38 -0400 Subject: Improve error handling --- src/attributes.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/attributes.h') diff --git a/src/attributes.h b/src/attributes.h index 684ee27..578dd2c 100644 --- a/src/attributes.h +++ b/src/attributes.h @@ -13,4 +13,11 @@ # define PUGL_UNUSED(name) name #endif +// Unused result macro to warn when an important return status is ignored +#ifndef _MSC_VER +# define PUGL_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) +#else +# define PUGL_WARN_UNUSED_RESULT +#endif + #endif // PUGL_SRC_ATTRIBUTES_H -- cgit v1.2.1