From 39080bf5f086d61647b378858f993679867b2bdc Mon Sep 17 00:00:00 2001 From: =?utf8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Fri, 9 Sep 2016 12:26:04 +0200 Subject: [PATCH] [utils] Move MONO_DEPRECATED to mono-publib.h and make it imply MONO_API + MONO_RT_EXTERNAL_ONLY. Also make it work with MSVC. --- configure.ac | 14 -------------- mono/utils/mono-compiler.h | 6 ------ mono/utils/mono-publib.h | 9 +++++++++ 3 files changed, 9 insertions(+), 20 deletions(-) diff --git a/configure.ac b/configure.ac index 7700a3fa1e5..d79db4cadec 100644 --- a/configure.ac +++ b/configure.ac @@ -1162,20 +1162,6 @@ AC_COMPILE_IFELSE([ AC_MSG_RESULT(no) ]) -AC_MSG_CHECKING(for deprecated __attribute__) -AC_TRY_COMPILE([ - int doit (void) __attribute__ ((deprecated)); - int doit (void) { return 0; } -], [ - return 0; -], [ - have_deprecated=yes - AC_MSG_RESULT(yes) -], [ - have_deprecated=no - AC_MSG_RESULT(no) -]) - dnl dnl Boehm GC configuration dnl diff --git a/mono/utils/mono-compiler.h b/mono/utils/mono-compiler.h index d03ba8051aa..5c942e06fa2 100644 --- a/mono/utils/mono-compiler.h +++ b/mono/utils/mono-compiler.h @@ -275,12 +275,6 @@ typedef SSIZE_T ssize_t; #define MONO_LLVM_INTERNAL #endif -#if HAVE_DEPRECATED -#define MONO_DEPRECATED __attribute__ ((deprecated)) -#else -#define MONO_DEPRECATED -#endif - #ifdef __GNUC__ #define MONO_ALWAYS_INLINE __attribute__((always_inline)) #elif defined(_MSC_VER) diff --git a/mono/utils/mono-publib.h b/mono/utils/mono-publib.h index 89d4fb68b75..e2614388ce9 100644 --- a/mono/utils/mono-publib.h +++ b/mono/utils/mono-publib.h @@ -116,6 +116,15 @@ mono_set_allocator_vtable (MonoAllocatorVTable* vtable); #define MONO_RT_EXTERNAL_ONLY #endif /* MONO_INSIDE_RUNTIME */ +#ifdef __GNUC__ +#define _MONO_DEPRECATED __attribute__ ((deprecated)) +#elif defined (_MSC_VER) +#define _MONO_DEPRECATED __declspec (deprecated) +#else +#define _MONO_DEPRECATED +#endif + +#define MONO_DEPRECATED MONO_API MONO_RT_EXTERNAL_ONLY _MONO_DEPRECATED MONO_END_DECLS -- 2.25.1