aboutsummaryrefslogtreecommitdiffstats
path: root/src/attributes.h
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2022-04-21 17:53:38 -0400
committerDavid Robillard <d@drobilla.net>2022-04-21 17:53:38 -0400
commita16cd4b851d30a8b9389de6085b391e77f0a349e (patch)
treec2a078cb12a7b1206d8b3b1466ef05e93580c71f /src/attributes.h
parent64e784e77b45cdbcd4ce17187c9fa4259b0ddefb (diff)
downloadpugl-a16cd4b851d30a8b9389de6085b391e77f0a349e.tar.gz
pugl-a16cd4b851d30a8b9389de6085b391e77f0a349e.tar.bz2
pugl-a16cd4b851d30a8b9389de6085b391e77f0a349e.zip
Improve error handling
Diffstat (limited to 'src/attributes.h')
-rw-r--r--src/attributes.h7
1 files changed, 7 insertions, 0 deletions
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