Repository: godot
Issue: Cannot compile Android templates with Mono in the 3.2 branch on Windows (conflict with MonoGCHandle typedef)
Labels: bug,platform:windows,platform:android,topic:buildsystem,topic:dotnet

**Godot version:**
3.2 branch 9df3d06

**OS/device including version:**
Windows 10 64-bit
VS 2019 Native tools Command Prompt x64

**Issue description:**
Firstly I compiled the stable branch of 3.2 with mono enabled (following the instructions)
Also compiled mono for android (https://github.com/godotengine/godot-mono-builds)
Then in VS 2019 Tools I'm compiling templates: set env variables, running command scons p=android target=release module_mono_enabled=yes android_arch=armv7 mono_prefix="Path-To-Compiled-Monos\android-armeabi-v7a-release"
And on file Godot-Source-Path\modules\mono\csharp_script.cpp I have this issue:

```
[ 17%] Compiling ==> modules\mono\csharp_script.cpp
=====
"In file included from modules\\mono\\csharp_script.cpp:31:
In file included from modules\\mono/csharp_script.h:39:
modules\\mono/mono_gc_handle.h:38:7: error: definition of type 'MonoGCHandle' conflicts with typedef of the same name
class MonoGCHandle : public Reference {
C:\\Program Files\\Mono\\Mono-installs\\android-armeabi-v7a-release\\include\\mono-2.0\\mono/utils/mono-forward.h:13:16: note: 'MonoGCHandle' declared here
typedef void * MonoGCHandle;
               ^
In file included from modules\\mono\\csharp_script.cpp:58:
modules\\mono/signal_awaiter_utils.h:42:36: error: base specifier must name a class
class SignalAwaiterHandle : public MonoGCHandle {
                            ~~~~~~~^~~~~~~~~~~~
modules\\mono/signal_awaiter_utils.h:44:31: error: 'MonoGCHandle' (aka 'void *') is not a class, namespace, or enumeration
GDCLASS(SignalAwaiterHandle, MonoGCHandle);
                                     ^
modules\\mono/signal_awaiter_utils.h:44:31: error: 'MonoGCHandle' (aka 'void *') is not a class, namespace, or enumeration
modules\\mono/signal_awaiter_utils.h:44:31: error: 'MonoGCHandle' (aka 'void *') is not a class, namespace, or enumeration
modules\\mono/signal_awaiter_utils.h:44:2: error: use of undeclared identifier '_get_category'
        GDCLASS(SignalAwaiterHandle, MonoGCHandle);
        ^
.\\core/object.h:295:7: note: expanded from macro 'GDCLASS'
                if (_get_category != m_inherits::_get_category) {                                                                               \\
                    ^
In file included from modules\\mono\\csharp_script.cpp:58:
modules\\mono/signal_awaiter_utils.h:44:31: error: 'MonoGCHandle' (aka 'void *') is not a class, namespace, or enumeration
        GDCLASS(SignalAwaiterHandle, MonoGCHandle);
                                     ^
modules\\mono/signal_awaiter_utils.h:44:2: error: use of undeclared identifier '_get_category'
        GDCLASS(SignalAwaiterHandle, MonoGCHandle);
        ^
.\\core/object.h:298:16: note: expanded from macro 'GDCLASS'
                        category += _get_category();                                                                                                \\
                                    ^
In file included from modules\\mono\\csharp_script.cpp:58:
modules\\mono/signal_awaiter_utils.h:44:31: error: 'MonoGCHandle' (aka 'void *') is not a class, namespace, or enumeration
        GDCLASS(SignalAwaiterHandle, MonoGCHandle);
                                     ^
modules\\mono/signal_awaiter_utils.h:44:31: error: 'MonoGCHandle' (aka 'void *') is not a class, namespace, or enumeration
modules\\mono/signal_awaiter_utils.h:44:31: error: 'MonoGCHandle' (aka 'void *') is not a class, namespace, or enumeration
modules\\mono/signal_awaiter_utils.h:44:2: error: no member named '_get_valid_parents_static' in 'SignalAwaiterHandle'; did you mean 'get_valid_parents_static'?
        GDCLASS(SignalAwaiterHandle, MonoGCHandle);
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\\core/object.h:310:16: note: expanded from macro 'GDCLASS'
                if (m_class::_get_valid_parents_static != m_inherits::_get_valid_parents_static) {                                              \\
                    ~~~~~~~~~^
modules\\mono/signal_awaiter_utils.h:44:2: note: 'get_valid_parents_static' declared here
.\\core/object.h:308:14: note: expanded from macro 'GDCLASS'
        static void get_valid_parents_static(List<String> *p_parents) {                                                                     \\
                    ^
In file included from modules\\mono\\csharp_script.cpp:58:
modules\\mono/signal_awaiter_utils.h:44:2: error: no type named '_get_valid_parents_static' in 'SignalAwaiterHandle'
        GDCLASS(SignalAwaiterHandle, MonoGCHandle)
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\\core/object.h:311:13: note: expanded from macro 'GDCLASS'
                        m_class::_get_valid_parents_static(p_parents);                                                                              \\
                        ~~~~~~~~~^
In file included from modules\\mono\\csharp_script.cpp:58:
modules\\mono/signal_awaiter_utils.h:44:31: error: 'MonoGCHandle' (aka 'void *') is not a class, namespace, or enumeration
        GDCLASS(SignalAwaiterHandle, MonoGCHandle);
                                     ^
modules\\mono/signal_awaiter_utils.h:44:31: error: 'MonoGCHandle' (aka 'void *') is not a class, namespace, or enumeration
modules\\mono/signal_awaiter_utils.h:44:31: error: 'MonoGCHandle' (aka 'void *') is not a class, namespace, or enumeration
modules\\mono/signal_awaiter_utils.h:44:10: error: no member named '_get' in 'SignalAwaiterHandle'; did you mean '::SignalAwaiterHandle::_getv'?
        GDCLASS(SignalAwaiterHandle, MonoGCHandle);        ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\\core/object.h:339:68: note: expanded from macro 'GDCLASS'
                return (bool (Object::*)(const StringName &, Variant &) const) & m_class::_get;                                                 \\
                                                                                 ^~~~~~~~~
modules\\mono/signal_awaiter_utils.h:44:2: note: '::SignalAwaiterHandle::_getv' declared here
        GDCLASS(SignalAwaiterHandle, MonoGCHandle);
        ^
.\\core/object.h:341:15: note: expanded from macro 'GDCLASS'
        virtual bool _getv(const StringName &p_name, Variant &r_ret) const {                                                                \\
                     ^
In file included from modules\\mono\\csharp_script.cpp:58:
modules\\mono/signal_awaiter_utils.h:44:31: error: 'MonoGCHandle' (aka 'void *') is not a class, namespace, or enumeration
        GDCLASS(SignalAwaiterHandle, MonoGCHandle);
                                     ^
modules\\mono/signal_awaiter_utils.h:44:2: error: use of undeclared identifier '_get'; did you mean '_getv'?
        GDCLASS(SignalAwaiterHandle, MonoGCHandle);
        ^
.\\core/object.h:343:8: note: expanded from macro 'GDCLASS'
                        if (_get(p_name, r_ret))                                                                                                    \\
                            ^
modules\\mono/signal_awaiter_utils.h:44:2: note: '_getv' declared here
.\\core/object.h:341:15: note: expanded from macro 'GDCLASS'
        virtual bool _getv(const StringName &p_name, Variant &r_ret) const {                                                                \\
                     ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]\r\n20 errors generated.
"
=====
scons: *** [modules\mono\csharp_script.android.opt.armv7.neon.o] Error 1
scons: building terminated because of errors.
```

Hope I wrote enough and you will help with it. Thanks in advance :)

**Steps to reproduce:**

Compile 9df3d06 Godot 3.2
Compile Mono for Android from https://github.com/mono/mono (master branch)
Compile Android Templates with scons p=android target=release module_mono_enabled=yes android_arch=armv7 mono_prefix="Path-To-Compiled-Monos\android-armeabi-v7a-release"