Alexandre Julliard : include: Define DECLSPEC_HIDDEN in guiddef.h if necessary.
Alexandre Julliard
julliard at winehq.org
Wed Oct 13 15:59:26 CDT 2021
Module: wine
Branch: master
Commit: 5d18d4df846a43177e4a6d975f6a6fc4789ab801
URL: https://source.winehq.org/git/wine.git/?a=commit;h=5d18d4df846a43177e4a6d975f6a6fc4789ab801
Author: Alexandre Julliard <julliard at winehq.org>
Date: Wed Oct 13 10:58:44 2021 +0200
include: Define DECLSPEC_HIDDEN in guiddef.h if necessary.
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
include/guiddef.h | 8 ++++++++
include/winnt.h | 14 ++++++++------
2 files changed, 16 insertions(+), 6 deletions(-)
diff --git a/include/guiddef.h b/include/guiddef.h
index a25b3a71077..d09ea98e468 100644
--- a/include/guiddef.h
+++ b/include/guiddef.h
@@ -86,6 +86,14 @@ extern "C++" {
#undef DEFINE_GUID
+#ifndef DECLSPEC_HIDDEN
+# if defined(__GNUC__) && !defined(__MINGW32__) && !defined(__CYGWIN__)
+# define DECLSPEC_HIDDEN __attribute__((visibility ("hidden")))
+# else
+# define DECLSPEC_HIDDEN
+# endif
+#endif
+
#ifdef INITGUID
#ifdef __cplusplus
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
diff --git a/include/winnt.h b/include/winnt.h
index 87051289445..53d9af8bf96 100644
--- a/include/winnt.h
+++ b/include/winnt.h
@@ -177,12 +177,14 @@ extern "C" {
# define DECLSPEC_EXPORT
#endif
-#if defined(_MSC_VER) || defined(__MINGW32__) || defined(__CYGWIN__) || defined(__sun)
-# define DECLSPEC_HIDDEN
-#elif defined(__GNUC__) && ((__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)))
-# define DECLSPEC_HIDDEN __attribute__((visibility ("hidden")))
-#else
-# define DECLSPEC_HIDDEN
+#ifndef DECLSPEC_HIDDEN
+# if defined(_MSC_VER) || defined(__MINGW32__) || defined(__CYGWIN__) || defined(__sun)
+# define DECLSPEC_HIDDEN
+# elif defined(__GNUC__) && ((__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)))
+# define DECLSPEC_HIDDEN __attribute__((visibility ("hidden")))
+# else
+# define DECLSPEC_HIDDEN
+# endif
#endif
#ifndef __has_attribute
More information about the wine-cvs
mailing list