From eedd4ab445713cc862cf33821aceb39470f6a220 Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Sun, 20 Aug 2017 18:15:48 +0200 Subject: api: don't use intermediate variables for deprecation warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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); ^~~~~~ --- docs/reference/api/ModemManager-sections.txt | 2 ++ 1 file changed, 2 insertions(+) (limited to 'docs/reference/api') diff --git a/docs/reference/api/ModemManager-sections.txt b/docs/reference/api/ModemManager-sections.txt index 1100be99..0a884b2f 100644 --- a/docs/reference/api/ModemManager-sections.txt +++ b/docs/reference/api/ModemManager-sections.txt @@ -106,4 +106,6 @@ MM_MODEM_BAND_EUTRAN_XLI MM_MODEM_BAND_EUTRAN_XLII MM_MODEM_BAND_EUTRAN_XLIII MM_MODEM_BAND_EUTRAN_XLIV + +MMModemBandDeprecated -- cgit v1.2.3-70-g09d2