libCom: add EPICS_FUNCTION

Automatic macro which expands to the current function name.
Useful in debug prints.
This commit is contained in:
Michael Davidsaver
2017-04-28 19:03:51 -04:00
parent 564ef01951
commit 12fc7ed07c
5 changed files with 19 additions and 0 deletions

View File

@@ -26,6 +26,9 @@
#define EPICS_ALWAYS_INLINE __inline__
#endif
/* Expands to a 'const char*' which describes the name of the current function scope */
#define EPICS_FUNCTION __PRETTY_FUNCTION__
#ifdef __cplusplus
/*

View File

@@ -29,6 +29,9 @@
#else
# define EPICS_ALWAYS_INLINE __inline__
#endif
/* Expands to a 'const char*' which describes the name of the current function scope */
#define EPICS_FUNCTION __PRETTY_FUNCTION__
#ifdef __cplusplus

View File

@@ -26,6 +26,9 @@
#define EPICS_ALWAYS_INLINE __inline
#endif
/* Expands to a 'const char*' which describes the name of the current function scope */
#define EPICS_FUNCTION __FUNCTION__
#ifdef __cplusplus
/*

View File

@@ -62,4 +62,13 @@
# define EPICS_UNUSED
#endif
#ifndef EPICS_FUNCTION
#if (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901)) || (defined(__cplusplus) && __cplusplus>=201103L)
# define EPICS_FUNCTION __func__
#else
/* Expands to a 'const char*' which describes the name of the current function scope */
# define EPICS_FUNCTION ("<unknown function>")
#endif
#endif
#endif /* ifndef compilerDependencies_h */

View File

@@ -406,6 +406,7 @@ MAIN ( epicsAtomicTest )
{
testPlan ( 50 );
testDiag("In %s", EPICS_FUNCTION);
testClassify ();
testBasic();
#if defined(__rtems__)