api: don't use intermediate variables for deprecation warnings

Using an intermediate constant variable breaks compilation with C
compilers, as these variables cannot be used as initializers.

Instead, define a deprecated type and cast all deprecated symbols to
that type. We lose the information about what the new replacement
symbol is, but we don't break compilation.

E.g.:
    test.c: In function ‘main’:
    test.c:8:5: warning: ‘MMModemBandDeprecated’ is deprecated [-Wdeprecated-declarations]
         printf ("band: %d\n", MM_MODEM_BAND_U2100);
         ^~~~~~
This commit is contained in:
Aleksander Morgado
2017-09-07 10:54:49 +02:00
parent a29610f25d
commit eedd4ab445
2 changed files with 42 additions and 108 deletions
@@ -106,4 +106,6 @@ MM_MODEM_BAND_EUTRAN_XLI
MM_MODEM_BAND_EUTRAN_XLII
MM_MODEM_BAND_EUTRAN_XLIII
MM_MODEM_BAND_EUTRAN_XLIV
<SUBSECTION Private>
MMModemBandDeprecated
</SECTION>