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:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user