On Mon Sep 16 10:36:18 2024 +0000, Jacek Caban wrote:
It's also supported on mingw targets when `-fms-extensions` is used. I think that using `__has_declspec_attribute` would be more portable and precise. Unfortunately, it's not supported on the actual MSVC, but maybe it's worth having something like:
#ifndef __has_declspec_attribute # #ifdef _MSC_VER # define __has_declspec_attribute(x) 1 # else # define __has_declspec_attribute(x) 0 # endif #endif
Several of the DECLSPEC definitions also have additional conditions like _MSC_VER >= x, how would we handle these? Something like:
``` # if __has_declspec_attribute(noreturn) && (!defined(_MSC_VER) || (_MSC_VER >= 1200)) && !defined(MIDL_PASS) ```
Only looks worse.