diff options
author | monojenkins <jo.shields+jenkins@xamarin.com> | 2018-03-06 21:35:16 +0300 |
---|---|---|
committer | Ludovic Henry <luhenry@microsoft.com> | 2018-03-06 21:35:16 +0300 |
commit | f3ac8fdeb37a7e0a505c5005be6774158d88a648 (patch) | |
tree | de307f0cdc862d3f5c1b903a7b4545728c1290f0 | |
parent | 1f48672a900fca4b302b19ae20d0c28132343d9c (diff) |
Fix for gcc 4.4; nominal support for older. attribute(deprecated(message)) was introduced in gcc 4.5. attribute(deprecated) was introduced in gcc 4.0? pragma GCC diagnostic 4.2? https://github.com/mono/mono/issues/7408 (#7436)mono-5.10.0.160
-rw-r--r-- | mono/utils/mono-publib.h | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/mono/utils/mono-publib.h b/mono/utils/mono-publib.h index a2b174ca0c6..ccf71d191cb 100644 --- a/mono/utils/mono-publib.h +++ b/mono/utils/mono-publib.h @@ -120,19 +120,33 @@ mono_set_allocator_vtable (MonoAllocatorVTable* vtable); #endif #if defined (__clang__) || defined (__GNUC__) +// attribute(deprecated(message)) was introduced in gcc 4.5. +// attribute(deprecated)) was introduced in gcc 4.0. +// Compare: https://gcc.gnu.org/onlinedocs/gcc-3.4.6/gcc/Function-Attributes.html +// https://gcc.gnu.org/onlinedocs/gcc-4.4.0/gcc/Function-Attributes.html +// https://gcc.gnu.org/onlinedocs/gcc-4.5.0/gcc/Function-Attributes.html +#if defined (__clang__) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5) #define MONO_RT_EXTERNAL_ONLY \ __attribute__ ((__deprecated__ ("The mono runtime must not call this function."))) \ MONO_RT_CENTRINEL_SUPPRESS +#elif __GNUC__ >= 4 +#define MONO_RT_EXTERNAL_ONLY __attribute__ ((__deprecated__)) MONO_RT_CENTRINEL_SUPPRESS +#else +#define MONO_RT_EXTERNAL_ONLY MONO_RT_CENTRINEL_SUPPRESS +#endif +#if defined (__clang__) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2) +// Pragmas for controlling diagnostics appear to be from gcc 4.2. // This is used in place of configure gcc -Werror=deprecated-declarations: // 1. To be portable across build systems. // 2. configure is very sensitive to compiler flags; they break autoconf's probes. -// Though #2 can be mitigted by being late in configure. -#pragma GCC diagnostic error "-Wdeprecated-declarations" // Works with clang too. +// Though #2 can be mitigated by being late in configure. +#pragma GCC diagnostic error "-Wdeprecated-declarations" +#endif #else #define MONO_RT_EXTERNAL_ONLY MONO_RT_CENTRINEL_SUPPRESS -#endif /// clang or gcc +#endif // clang or gcc #else #define MONO_RT_EXTERNAL_ONLY |