Skip to content

Commit 5310451

Browse files
committed
Platform: Add MBED_PRETTY_FUNCTION macro.
This macro yields a string literal of the enclosing function name.
1 parent 3aa4bf4 commit 5310451

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

platform/mbed_toolchain.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,20 @@
330330
#endif
331331
#endif
332332

333+
/**
334+
* Macro expanding to a string literal of the enclosing function name.
335+
*
336+
* The string returned takes into account language specificity and yield human
337+
* readable content.
338+
*
339+
* As an example, if the macro is used within a C++ function then the string
340+
* literal containing the function name will contain the complete signature of
341+
* the function - including template parameters - and namespace qualifications.
342+
*/
343+
#ifndef MBED_PRETTY_FUNCTION
344+
#define MBED_PRETTY_FUNCTION __PRETTY_FUNCTION__
345+
#endif
346+
333347
#ifndef MBED_PRINTF
334348
#if defined(__GNUC__) || defined(__CC_ARM)
335349
#define MBED_PRINTF(format_idx, first_param_idx) __attribute__ ((__format__(__printf__, format_idx, first_param_idx)))

0 commit comments

Comments
 (0)