xrt: Add XRT_CHECK_RESULT define

This commit is contained in:
Jakob Bornecrantz 2022-03-11 00:07:49 +00:00 committed by Jakob Bornecrantz
parent 2bb0c5cda5
commit 57d1394941

View file

@ -64,6 +64,18 @@
#endif
/*
* To make sure return values are checked.
*/
#if defined(__GNUC__) && (__GNUC__ >= 4)
#define XRT_CHECK_RESULT __attribute__((warn_unused_result))
#elif defined(_MSC_VER) && (_MSC_VER >= 1700)
#define XRT_CHECK_RESULT _Check_return_
#else
#define XRT_CHECK_RESULT
#endif
/*
* To stop inlining.
*/