<p>I have a method in an interface that I want to deprecate with portable C++.
When I Googled for this all I got was a Microsoft specific solution; <a href="https://learn.microsoft.com/en-us/cpp/preprocessor/deprecated-c-cpp?view=vs-2017" rel="noreferrer"><code>#pragma deprecated</code></a> and <a href="https://learn.microsoft.com/en-us/cpp/cpp/deprecated-cpp?view=vs-2017" rel="noreferrer"><code>__declspec(deprecated)</code></a>.</p>
<p>A second prize solution would be to <code>ifdef</code> a MSVC and a GCC solution.</p>

In GCC you can declare your function with the attribute deprecated like this:
```
```
void myfunc() __attribute__ ((deprecated));
```
```
This will trigger a compile-time warning when that function is used in a .c file.
You can find more info under "Diagnostic pragmas" at
http://gcc.gnu.org/onlinedocs/gcc/Pragmas.html