1 /**
2  * \file
3  * \brief This file is for deprecated macro constants
4  *
5  *  Used to mark macro constants as deprecate.
6  *  Uses a macro 'DEPRECTAED' to give warnings during compilation (GCC >= 4.8)
7  *
8  *  \remark To use, add defines and put a DEPRECATED statement between the macro name and the value
9  *
10  *  \note This file is manually maintained
11  */
12 
13 #ifndef _<DEVICE>_<MODULE>_COMPONENT_DEPRECATED_H_
14 #define _<DEVICE>_<MODULE>_COMPONENT_DEPRECATED_H_
15 
16 #ifndef DEPRECATED
17 #define _DEP_STRING(X) #X
18 
19 /** \hideinitializer
20  * \brief Macro deprecation mark
21  *
22  * Putting this in a macro definition will emit deprecation warning when given
23  * macro is used (GCC 4.8)
24  *
25  *  \code{.c}
26  *  #define OLD_MACRO DEPRECATED(OLD_MACRO, "deprecated <or any other text>") <value>
27  *  \endcode
28  *
29  *  \warning Using these macros in #if statements will not work
30  */
31 #if defined(__GNUC__) && __GNUC__*100 + __GNUC_MINOR__ >= 408
32 #define DEPRECATED(macro, message) _Pragma (_DEP_STRING(GCC warning message))
33 #else
34 #define DEPRECATED(macro, message)
35 #endif
36 #endif
37 
38 /* deprecated defines added below here */
39 #define <MODULE>_OLD_MACRO DEPRECATED(<MODULE>_OLD_MACRO, "deprecated") <value>
40 
41 #endif
42