Make MONO_API_DATA clearer. (#32459)
authormonojenkins <jo.shields+jenkins@xamarin.com>
Wed, 19 Feb 2020 01:59:50 +0000 (20:59 -0500)
committerGitHub <noreply@github.com>
Wed, 19 Feb 2020 01:59:50 +0000 (02:59 +0100)
commit5d8f92435ebfeab67b41aba0bce12e1e8af3187e
treeaf730c00d0d616fb84f0f39516919c20d71ff77c
parent4365af16fcf99708df04315b19eadee6e533e4bd
Make MONO_API_DATA clearer. (#32459)

Make MONO_API_DATA clearer, its old form -- MONO_API extern.
extern "C" { } should be added around it not within it, for clarity.
I've always found extern "C" without braces unclear, esp. for data.

i.e.

```
 extern "C" {
1   extern void function(); // redundant but clear
                            // same as void function();
2   extern int data; // not redundant, and clear
}
```

vs.
```
3   extern "C" void function(); // I guess clear.
4   extern "C" int data; // unclear -- is it extern or extern "C" or both?
```

This PR in particular turns 4 into 2.
2 is clearly a declaration, not a definition.
4 is unclear as to if it is a declaration or definition.

I was looking into https://github.com/mono/mono/issues/18827.

This does not actually change anything but makes things clearer.

This is similar/related in spirit to https://github.com/mono/mono/pull/18891.
It should not make a difference.
In this case, `#if __cplusplus` remains, but the meaning of it is clearer.
It becomes *only* about the common `extern "C" { }` and not even the less clear `extern "C"`.
src/mono/mono/metadata/opcodes.h
src/mono/mono/mini/mini-runtime.h
src/mono/mono/utils/mono-logger-internals.h
src/mono/mono/utils/mono-publib.h