@@ -143,12 +143,17 @@ typedef int mbed_error_status_t;
143
143
* Since this macro is a wrapper for mbed_warning API callers should process the return value from this macro which is the return value from calling mbed_error API.
144
144
*
145
145
*/
146
- #ifdef MBED_CONF_ERROR_FILENAME_CAPTURE_ENABLED
147
- #define MBED_WARNING1 ( error_status , error_msg , error_value ) mbed_warning( error_status, (const char *)error_msg , (uint32_t)error_value, (const char *)MBED_FILENAME, __LINE__ )
148
- #define MBED_WARNING ( error_status , error_msg ) mbed_warning( error_status, (const char *)error_msg , (uint32_t)0 , (const char *)MBED_FILENAME, __LINE__ )
146
+ #ifdef NDEBUG
147
+ #define MBED_WARNING1 ( error_status , error_msg , error_value ) mbed_warning( error_status, (const char *)NULL , (uint32_t)error_value, NULL, 0 )
148
+ #define MBED_WARNING ( error_status , error_msg ) mbed_warning( error_status, (const char *)NULL , (uint32_t)0, NULL, 0 )
149
149
#else
150
- #define MBED_WARNING1 ( error_status , error_msg , error_value ) mbed_warning( error_status, (const char *)error_msg, (uint32_t)error_value, NULL, 0 )
151
- #define MBED_WARNING ( error_status , error_msg ) mbed_warning( error_status, (const char *)error_msg, (uint32_t)0, NULL, 0 )
150
+ #if defined(MBED_CONF_ERROR_FILENAME_CAPTURE_ENABLED )
151
+ #define MBED_WARNING1 ( error_status , error_msg , error_value ) mbed_warning( error_status, (const char *)error_msg, (uint32_t)error_value, (const char *)MBED_FILENAME, __LINE__ )
152
+ #define MBED_WARNING ( error_status , error_msg ) mbed_warning( error_status, (const char *)error_msg, (uint32_t)0 , (const char *)MBED_FILENAME, __LINE__ )
153
+ #else
154
+ #define MBED_WARNING1 ( error_status , error_msg , error_value ) mbed_warning( error_status, (const char *)error_msg, (uint32_t)error_value, NULL, 0 )
155
+ #define MBED_WARNING ( error_status , error_msg ) mbed_warning( error_status, (const char *)error_msg, (uint32_t)0, NULL, 0 )
156
+ #endif
152
157
#endif
153
158
154
159
/**
@@ -170,13 +175,18 @@ typedef int mbed_error_status_t;
170
175
* Since this macro is a wrapper for mbed_error API callers should process the return value from this macro which is the return value from calling mbed_error API.
171
176
*
172
177
*/
173
- #ifdef MBED_CONF_ERROR_FILENAME_CAPTURE_ENABLED
174
- #define MBED_ERROR1 ( error_status , error_msg , error_value ) mbed_error( error_status, (const char *)error_msg , (uint32_t)error_value, (const char *)MBED_FILENAME, __LINE__ )
175
- #define MBED_ERROR ( error_status , error_msg ) mbed_error( error_status, (const char *)error_msg , (uint32_t)0 , (const char *)MBED_FILENAME, __LINE__ )
178
+ #ifdef NDEBUG
179
+ #define MBED_ERROR1 ( error_status , error_msg , error_value ) mbed_error( error_status, (const char *)NULL , (uint32_t)error_value, NULL, 0 )
180
+ #define MBED_ERROR ( error_status , error_msg ) mbed_error( error_status, (const char *)NULL , (uint32_t)0 , NULL, 0 )
176
181
#else
177
- #define MBED_ERROR1 ( error_status , error_msg , error_value ) mbed_error( error_status, (const char *)error_msg, (uint32_t)error_value, NULL, 0 )
178
- #define MBED_ERROR ( error_status , error_msg ) mbed_error( error_status, (const char *)error_msg, (uint32_t)0 , NULL, 0 )
179
- #endif
182
+ #if defined(MBED_CONF_ERROR_FILENAME_CAPTURE_ENABLED )
183
+ #define MBED_ERROR1 ( error_status , error_msg , error_value ) mbed_error( error_status, (const char *)error_msg, (uint32_t)error_value, (const char *)MBED_FILENAME, __LINE__ )
184
+ #define MBED_ERROR ( error_status , error_msg ) mbed_error( error_status, (const char *)error_msg, (uint32_t)0 , (const char *)MBED_FILENAME, __LINE__ )
185
+ #else
186
+ #define MBED_ERROR1 ( error_status , error_msg , error_value ) mbed_error( error_status, (const char *)error_msg, (uint32_t)error_value, NULL, 0 )
187
+ #define MBED_ERROR ( error_status , error_msg ) mbed_error( error_status, (const char *)error_msg, (uint32_t)0 , NULL, 0 )
188
+ #endif
189
+ #endif
180
190
181
191
//Error Type definition
182
192
/** mbed_error_type_t definition
0 commit comments