From 767585b70f3e8c70b9558f32dfc5670533a26a4b Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Tue, 25 Aug 2015 19:05:39 -0500 Subject: [svn-r27581] Fixed a bug in the FUNC_ENTER macros. API calls of the form H5xx_* were flagged as H5XX_, which is a non-public API form. Tested on: h5committest --- src/H5private.h | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/src/H5private.h b/src/H5private.h index 65726da..5e968a0 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -1721,9 +1721,24 @@ H5_DLL double H5_trace(const double *calltime, const char *func, const char *typ *------------------------------------------------------------------------- */ -/* `S' is the name of a function which is being tested to check if its */ -/* an API function */ -#define H5_IS_API(S) ('_'!=((const char *)S)[2] && '_'!=((const char *)S)[3] && (!((const char *)S)[4] || '_'!=((const char *)S)[4])) +/* `S' is the name of a function which is being tested to check if it's + * an API function. + * + * BADNESS: + * - Underscore at positions 2 or 3 (0-indexed string). Handles + * H5_ and H5X_. + * - Underscore at position 4 if position 3 is uppercase or a digit. + * Handles H5XY_. + */ +#define H5_IS_API(S) (\ + '_'!=((const char *)S)[2] /* underscore at position 2 */ \ + && '_'!=((const char *)S)[3] /* underscore at position 3 */ \ + && !( /* NOT */ \ + ((const char *)S)[4] /* pos 4 exists */ \ + && (HDisupper(S[3]) || HDisdigit(S[3])) /* pos 3 dig | uc */ \ + && '_'==((const char *)S)[4] /* pos 4 underscore */ \ + )\ +) /* `S' is the name of a function which is being tested to check if it's */ /* a public API function */ -- cgit v0.12