gmacros: MSVC supports the noreturn function attribute

But it can't be used as a drop-in implementation of G_GNUC_NORETURN
because it can only be placed at the start of the function prototype.

Document this in a comment so that the next person doesn't spend
20 min figuring it out.
This commit is contained in:
Nirbheek Chauhan 2019-01-15 01:35:35 +05:30
parent 5751189fb8
commit 2a76dba03e

View File

@ -190,6 +190,10 @@
#define G_GNUC_SCANF( format_idx, arg_idx )
#define G_GNUC_STRFTIME( format_idx )
#define G_GNUC_FORMAT( arg_idx )
/* NOTE: MSVC has __declspec(noreturn) but unlike GCC __attribute__,
* __declspec can only be placed at the start of the function prototype
* and not at the end, so we can't use it without breaking API.
*/
#define G_GNUC_NORETURN
#define G_GNUC_CONST
#define G_GNUC_UNUSED