libCom: add EPICS_FUNCTION
Automatic macro which expands to the current function name. Useful in debug prints.
This commit is contained in:
@@ -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
|
||||
|
||||
/*
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
/*
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -406,6 +406,7 @@ MAIN ( epicsAtomicTest )
|
||||
{
|
||||
|
||||
testPlan ( 50 );
|
||||
testDiag("In %s", EPICS_FUNCTION);
|
||||
testClassify ();
|
||||
testBasic();
|
||||
#if defined(__rtems__)
|
||||
|
||||
Reference in New Issue
Block a user