summaryrefslogtreecommitdiffstats
path: root/src/H5private.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5private.h')
-rw-r--r--src/H5private.h90
1 files changed, 41 insertions, 49 deletions
diff --git a/src/H5private.h b/src/H5private.h
index ed17d4c..13570db 100644
--- a/src/H5private.h
+++ b/src/H5private.h
@@ -1747,15 +1747,6 @@ H5_DLL int HDvasprintf(char **bufp, const char *fmt, va_list _ap);
#define H5_COLON_SEPC ':'
-/* Use FUNC to safely handle variations of C99 __func__ keyword handling */
-#ifdef H5_HAVE_C99_FUNC
-#define FUNC __func__
-#elif defined(H5_HAVE_FUNCTION)
-#define FUNC __FUNCTION__
-#else
-#error "We need __func__ or __FUNCTION__ to test function names!"
-#endif
-
/*
* These macros check whether debugging has been requested for a certain
* package at run-time. Code for debugging is conditionally compiled by
@@ -1836,51 +1827,52 @@ extern char H5libhdf5_settings[]; /* embedded library information */
#define H5TRACE0(R, T) \
RTYPE = R; \
- CALLTIME = H5_trace(NULL, FUNC, T)
+ CALLTIME = H5_trace(NULL, __func__, T)
#define H5TRACE1(R, T, A0) \
RTYPE = R; \
- CALLTIME = H5_trace(NULL, FUNC, T, #A0, A0)
+ CALLTIME = H5_trace(NULL, __func__, T, #A0, A0)
#define H5TRACE2(R, T, A0, A1) \
RTYPE = R; \
- CALLTIME = H5_trace(NULL, FUNC, T, #A0, A0, #A1, A1)
+ CALLTIME = H5_trace(NULL, __func__, T, #A0, A0, #A1, A1)
#define H5TRACE3(R, T, A0, A1, A2) \
RTYPE = R; \
- CALLTIME = H5_trace(NULL, FUNC, T, #A0, A0, #A1, A1, #A2, A2)
+ CALLTIME = H5_trace(NULL, __func__, T, #A0, A0, #A1, A1, #A2, A2)
#define H5TRACE4(R, T, A0, A1, A2, A3) \
RTYPE = R; \
- CALLTIME = H5_trace(NULL, FUNC, T, #A0, A0, #A1, A1, #A2, A2, #A3, A3)
+ CALLTIME = H5_trace(NULL, __func__, T, #A0, A0, #A1, A1, #A2, A2, #A3, A3)
#define H5TRACE5(R, T, A0, A1, A2, A3, A4) \
RTYPE = R; \
- CALLTIME = H5_trace(NULL, FUNC, T, #A0, A0, #A1, A1, #A2, A2, #A3, A3, #A4, A4)
+ CALLTIME = H5_trace(NULL, __func__, T, #A0, A0, #A1, A1, #A2, A2, #A3, A3, #A4, A4)
#define H5TRACE6(R, T, A0, A1, A2, A3, A4, A5) \
RTYPE = R; \
- CALLTIME = H5_trace(NULL, FUNC, T, #A0, A0, #A1, A1, #A2, A2, #A3, A3, #A4, A4, #A5, A5)
+ CALLTIME = H5_trace(NULL, __func__, T, #A0, A0, #A1, A1, #A2, A2, #A3, A3, #A4, A4, #A5, A5)
#define H5TRACE7(R, T, A0, A1, A2, A3, A4, A5, A6) \
RTYPE = R; \
- CALLTIME = H5_trace(NULL, FUNC, T, #A0, A0, #A1, A1, #A2, A2, #A3, A3, #A4, A4, #A5, A5, #A6, A6)
+ CALLTIME = H5_trace(NULL, __func__, T, #A0, A0, #A1, A1, #A2, A2, #A3, A3, #A4, A4, #A5, A5, #A6, A6)
#define H5TRACE8(R, T, A0, A1, A2, A3, A4, A5, A6, A7) \
- RTYPE = R; \
- CALLTIME = H5_trace(NULL, FUNC, T, #A0, A0, #A1, A1, #A2, A2, #A3, A3, #A4, A4, #A5, A5, #A6, A6, #A7, A7)
+ RTYPE = R; \
+ CALLTIME = \
+ H5_trace(NULL, __func__, T, #A0, A0, #A1, A1, #A2, A2, #A3, A3, #A4, A4, #A5, A5, #A6, A6, #A7, A7)
#define H5TRACE9(R, T, A0, A1, A2, A3, A4, A5, A6, A7, A8) \
RTYPE = R; \
- CALLTIME = H5_trace(NULL, FUNC, T, #A0, A0, #A1, A1, #A2, A2, #A3, A3, #A4, A4, #A5, A5, #A6, A6, #A7, \
- A7, #A8, A8)
+ CALLTIME = H5_trace(NULL, __func__, T, #A0, A0, #A1, A1, #A2, A2, #A3, A3, #A4, A4, #A5, A5, #A6, A6, \
+ #A7, A7, #A8, A8)
#define H5TRACE10(R, T, A0, A1, A2, A3, A4, A5, A6, A7, A8, A9) \
RTYPE = R; \
- CALLTIME = H5_trace(NULL, FUNC, T, #A0, A0, #A1, A1, #A2, A2, #A3, A3, #A4, A4, #A5, A5, #A6, A6, #A7, \
- A7, #A8, A8, #A9, A9)
+ CALLTIME = H5_trace(NULL, __func__, T, #A0, A0, #A1, A1, #A2, A2, #A3, A3, #A4, A4, #A5, A5, #A6, A6, \
+ #A7, A7, #A8, A8, #A9, A9)
#define H5TRACE11(R, T, A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10) \
RTYPE = R; \
- CALLTIME = H5_trace(NULL, FUNC, T, #A0, A0, #A1, A1, #A2, A2, #A3, A3, #A4, A4, #A5, A5, #A6, A6, #A7, \
- A7, #A8, A8, #A9, A9, #A10, A10)
+ CALLTIME = H5_trace(NULL, __func__, T, #A0, A0, #A1, A1, #A2, A2, #A3, A3, #A4, A4, #A5, A5, #A6, A6, \
+ #A7, A7, #A8, A8, #A9, A9, #A10, A10)
#define H5TRACE12(R, T, A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11) \
RTYPE = R; \
- CALLTIME = H5_trace(NULL, FUNC, T, #A0, A0, #A1, A1, #A2, A2, #A3, A3, #A4, A4, #A5, A5, #A6, A6, #A7, \
- A7, #A8, A8, #A9, A9, #A10, A10, #A11, A11)
+ CALLTIME = H5_trace(NULL, __func__, T, #A0, A0, #A1, A1, #A2, A2, #A3, A3, #A4, A4, #A5, A5, #A6, A6, \
+ #A7, A7, #A8, A8, #A9, A9, #A10, A10, #A11, A11)
#define H5TRACE_RETURN(V) \
if (RTYPE) { \
- H5_trace(&CALLTIME, FUNC, RTYPE, NULL, V); \
+ H5_trace(&CALLTIME, __func__, RTYPE, NULL, V); \
RTYPE = NULL; \
}
#else
@@ -2136,7 +2128,7 @@ H5_DLL herr_t H5CX_pop(hbool_t update_dxpl_props);
#define FUNC_ENTER_API_COMMON \
FUNC_ENTER_API_VARS \
- FUNC_ENTER_COMMON(H5_IS_API(FUNC)); \
+ FUNC_ENTER_COMMON(H5_IS_API(__func__)); \
FUNC_ENTER_API_THREADSAFE;
#define FUNC_ENTER_API_INIT(err) \
@@ -2211,7 +2203,7 @@ H5_DLL herr_t H5CX_pop(hbool_t update_dxpl_props);
{ \
{ \
FUNC_ENTER_API_VARS \
- FUNC_ENTER_COMMON_NOERR(H5_IS_API(FUNC)); \
+ FUNC_ENTER_COMMON_NOERR(H5_IS_API(__func__)); \
FUNC_ENTER_API_THREADSAFE; \
BEGIN_MPE_LOG \
{
@@ -2228,7 +2220,7 @@ H5_DLL herr_t H5CX_pop(hbool_t update_dxpl_props);
{ \
{ \
{ \
- FUNC_ENTER_COMMON(H5_IS_API(FUNC)); \
+ FUNC_ENTER_COMMON(H5_IS_API(__func__)); \
FUNC_ENTER_API_THREADSAFE; \
FUNC_ENTER_API_INIT(err); \
{
@@ -2247,7 +2239,7 @@ H5_DLL herr_t H5CX_pop(hbool_t update_dxpl_props);
{ \
{ \
{ \
- FUNC_ENTER_COMMON_NOERR(H5_IS_API(FUNC)); \
+ FUNC_ENTER_COMMON_NOERR(H5_IS_API(__func__)); \
{
/* Note: this macro only works when there's _no_ interface initialization routine for the module */
@@ -2261,14 +2253,14 @@ H5_DLL herr_t H5CX_pop(hbool_t update_dxpl_props);
/* Use this macro for all "normal" non-API functions */
#define FUNC_ENTER_NOAPI(err) \
{ \
- FUNC_ENTER_COMMON(!H5_IS_API(FUNC)); \
+ FUNC_ENTER_COMMON(!H5_IS_API(__func__)); \
FUNC_ENTER_NOAPI_INIT(err) \
if (H5_PKG_INIT_VAR || !H5_TERM_GLOBAL) {
/* Use this macro for all non-API functions, which propagate errors, but don't issue them */
#define FUNC_ENTER_NOAPI_NOERR \
{ \
- FUNC_ENTER_COMMON_NOERR(!H5_IS_API(FUNC)); \
+ FUNC_ENTER_COMMON_NOERR(!H5_IS_API(__func__)); \
FUNC_ENTER_NOAPI_INIT(-) \
if (H5_PKG_INIT_VAR || !H5_TERM_GLOBAL) {
@@ -2282,7 +2274,7 @@ H5_DLL herr_t H5CX_pop(hbool_t update_dxpl_props);
*/
#define FUNC_ENTER_NOAPI_NOINIT \
{ \
- FUNC_ENTER_COMMON(!H5_IS_API(FUNC)); \
+ FUNC_ENTER_COMMON(!H5_IS_API(__func__)); \
H5_PUSH_FUNC \
if (H5_PKG_INIT_VAR || !H5_TERM_GLOBAL) {
@@ -2297,7 +2289,7 @@ H5_DLL herr_t H5CX_pop(hbool_t update_dxpl_props);
*/
#define FUNC_ENTER_NOAPI_NOINIT_NOERR \
{ \
- FUNC_ENTER_COMMON_NOERR(!H5_IS_API(FUNC)); \
+ FUNC_ENTER_COMMON_NOERR(!H5_IS_API(__func__)); \
H5_PUSH_FUNC \
if (H5_PKG_INIT_VAR || !H5_TERM_GLOBAL) {
@@ -2309,7 +2301,7 @@ H5_DLL herr_t H5CX_pop(hbool_t update_dxpl_props);
*/
#define FUNC_ENTER_NOAPI_NOFS \
{ \
- FUNC_ENTER_COMMON(!H5_IS_API(FUNC)); \
+ FUNC_ENTER_COMMON(!H5_IS_API(__func__)); \
\
/* Initialize the package, if appropriate */ \
H5_PACKAGE_INIT(H5_MY_PKG_INIT, err) \
@@ -2326,7 +2318,7 @@ H5_DLL herr_t H5CX_pop(hbool_t update_dxpl_props);
*/
#define FUNC_ENTER_NOAPI_NOERR_NOFS \
{ \
- FUNC_ENTER_COMMON_NOERR(!H5_IS_API(FUNC)); \
+ FUNC_ENTER_COMMON_NOERR(!H5_IS_API(__func__)); \
if (H5_PKG_INIT_VAR || !H5_TERM_GLOBAL) {
/*
@@ -2338,7 +2330,7 @@ H5_DLL herr_t H5CX_pop(hbool_t update_dxpl_props);
*/
#define FUNC_ENTER_NOAPI_NAMECHECK_ONLY \
{ \
- FUNC_ENTER_COMMON_NOERR(!H5_IS_API(FUNC));
+ FUNC_ENTER_COMMON_NOERR(!H5_IS_API(__func__));
/* Use the following two macros as replacements for the FUNC_ENTER_NOAPI
* and FUNC_ENTER_NOAPI_NOINIT macros when the function needs to set
@@ -2347,7 +2339,7 @@ H5_DLL herr_t H5CX_pop(hbool_t update_dxpl_props);
{ \
haddr_t prev_tag = HADDR_UNDEF; \
\
- FUNC_ENTER_COMMON(!H5_IS_API(FUNC)); \
+ FUNC_ENTER_COMMON(!H5_IS_API(__func__)); \
H5AC_tag(tag, &prev_tag); \
FUNC_ENTER_NOAPI_INIT(err) \
if (H5_PKG_INIT_VAR || !H5_TERM_GLOBAL) {
@@ -2356,7 +2348,7 @@ H5_DLL herr_t H5CX_pop(hbool_t update_dxpl_props);
{ \
haddr_t prev_tag = HADDR_UNDEF; \
\
- FUNC_ENTER_COMMON(!H5_IS_API(FUNC)); \
+ FUNC_ENTER_COMMON(!H5_IS_API(__func__)); \
H5AC_tag(tag, &prev_tag); \
H5_PUSH_FUNC \
if (H5_PKG_INIT_VAR || !H5_TERM_GLOBAL) {
@@ -2364,14 +2356,14 @@ H5_DLL herr_t H5CX_pop(hbool_t update_dxpl_props);
/* Use this macro for all "normal" package-level functions */
#define FUNC_ENTER_PACKAGE \
{ \
- FUNC_ENTER_COMMON(H5_IS_PKG(FUNC)); \
+ FUNC_ENTER_COMMON(H5_IS_PKG(__func__)); \
H5_PUSH_FUNC \
if (H5_PKG_INIT_VAR || !H5_TERM_GLOBAL) {
/* Use this macro for package-level functions which propgate errors, but don't issue them */
#define FUNC_ENTER_PACKAGE_NOERR \
{ \
- FUNC_ENTER_COMMON_NOERR(H5_IS_PKG(FUNC)); \
+ FUNC_ENTER_COMMON_NOERR(H5_IS_PKG(__func__)); \
H5_PUSH_FUNC \
if (H5_PKG_INIT_VAR || !H5_TERM_GLOBAL) {
@@ -2381,7 +2373,7 @@ H5_DLL herr_t H5CX_pop(hbool_t update_dxpl_props);
{ \
haddr_t prev_tag = HADDR_UNDEF; \
\
- FUNC_ENTER_COMMON(H5_IS_PKG(FUNC)); \
+ FUNC_ENTER_COMMON(H5_IS_PKG(__func__)); \
H5AC_tag(tag, &prev_tag); \
H5_PUSH_FUNC \
if (H5_PKG_INIT_VAR || !H5_TERM_GLOBAL) {
@@ -2389,14 +2381,14 @@ H5_DLL herr_t H5CX_pop(hbool_t update_dxpl_props);
/* Use this macro for all "normal" staticly-scoped functions */
#define FUNC_ENTER_STATIC \
{ \
- FUNC_ENTER_COMMON(H5_IS_PKG(FUNC)); \
+ FUNC_ENTER_COMMON(H5_IS_PKG(__func__)); \
H5_PUSH_FUNC \
if (H5_PKG_INIT_VAR || !H5_TERM_GLOBAL) {
/* Use this macro for staticly-scoped functions which propgate errors, but don't issue them */
#define FUNC_ENTER_STATIC_NOERR \
{ \
- FUNC_ENTER_COMMON_NOERR(H5_IS_PKG(FUNC)); \
+ FUNC_ENTER_COMMON_NOERR(H5_IS_PKG(__func__)); \
H5_PUSH_FUNC \
if (H5_PKG_INIT_VAR || !H5_TERM_GLOBAL) {
@@ -2404,7 +2396,7 @@ H5_DLL herr_t H5CX_pop(hbool_t update_dxpl_props);
/* And that shouldn't push their name on the function stack */
#define FUNC_ENTER_STATIC_NOERR_NOFS \
{ \
- FUNC_ENTER_COMMON_NOERR(H5_IS_PKG(FUNC)); \
+ FUNC_ENTER_COMMON_NOERR(H5_IS_PKG(__func__)); \
if (H5_PKG_INIT_VAR || !H5_TERM_GLOBAL) {
/*
@@ -2416,7 +2408,7 @@ H5_DLL herr_t H5CX_pop(hbool_t update_dxpl_props);
*/
#define FUNC_ENTER_STATIC_NAMECHECK_ONLY \
{ \
- FUNC_ENTER_COMMON_NOERR(H5_IS_PKG(FUNC));
+ FUNC_ENTER_COMMON_NOERR(H5_IS_PKG(__func__));
/* Use the following macro as replacement for the FUNC_ENTER_STATIC
* macro when the function needs to set up a metadata tag. */
@@ -2424,7 +2416,7 @@ H5_DLL herr_t H5CX_pop(hbool_t update_dxpl_props);
{ \
haddr_t prev_tag = HADDR_UNDEF; \
\
- FUNC_ENTER_COMMON(H5_IS_PKG(FUNC)); \
+ FUNC_ENTER_COMMON(H5_IS_PKG(__func__)); \
H5AC_tag(tag, &prev_tag); \
H5_PUSH_FUNC \
if (H5_PKG_INIT_VAR || !H5_TERM_GLOBAL) {