w64-mingw32-gcc does not support it, but w64-mingw32-clang does.
From: Alex Henrie alexhenrie24@gmail.com
w64-mingw32-gcc does not support it, but w64-mingw32-clang does. --- include/guiddef.h | 2 +- include/winnt.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/guiddef.h b/include/guiddef.h index 6f7e26df0c6..db6c66da131 100644 --- a/include/guiddef.h +++ b/include/guiddef.h @@ -90,7 +90,7 @@ extern "C++" { #undef DEFINE_GUID
#ifndef DECLSPEC_HIDDEN -# if defined(__GNUC__) && !defined(__MINGW32__) && !defined(__CYGWIN__) +# if defined(__GNUC__) && (!defined(__MINGW32__) || defined(__clang__)) && !defined(__CYGWIN__) # define DECLSPEC_HIDDEN __attribute__((visibility ("hidden"))) # else # define DECLSPEC_HIDDEN diff --git a/include/winnt.h b/include/winnt.h index c0967ac4459..f0f3354b8d8 100644 --- a/include/winnt.h +++ b/include/winnt.h @@ -181,7 +181,7 @@ extern "C" { #endif
#ifndef DECLSPEC_HIDDEN -# if defined(_MSC_VER) || defined(__MINGW32__) || defined(__CYGWIN__) || defined(__sun) +# if defined(_MSC_VER) || (defined(__MINGW32__) && !defined(__clang__)) || defined(__CYGWIN__) || defined(__sun) # define DECLSPEC_HIDDEN # elif defined(__GNUC__) && ((__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3))) # define DECLSPEC_HIDDEN __attribute__((visibility ("hidden")))
Jacek Caban (@jacek) commented about include/winnt.h:
#endif
#ifndef DECLSPEC_HIDDEN -# if defined(_MSC_VER) || defined(__MINGW32__) || defined(__CYGWIN__) || defined(__sun) +# if defined(_MSC_VER) || (defined(__MINGW32__) && !defined(__clang__)) || defined(__CYGWIN__) || defined(__sun)
FWIW, it's not really useful for building Wine itself. I think that it's used only in "export all" case on PE targets and we don't use that. We could probably still expose that in headers for winelib. For that, something like "|| __has_attribute(visibility)" should be a bit more flexible.
FWIW, it's not really useful for building Wine itself. I think that it's used only in "export all" case on PE targets and we don't use that. We could probably still expose that in headers for winelib. For that, something like "|| __has_attribute(visibility)" should be a bit more flexible.
Given that it doesn't exist on Windows, I don't think it needs to be available for Winelib.
In fact, I'd say that if we no longer need DECLSPEC_HIDDEN in Wine itself, it should eventually be removed.
This merge request was closed by Alex Henrie.