summaryrefslogtreecommitdiffstats
path: root/src/H5private.h
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2004-12-29 14:32:06 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2004-12-29 14:32:06 (GMT)
commit37232bd4f0f8199f956c823cdff72ece2ca9aa16 (patch)
tree38e37f7208355500b7f223e90bf014424c63300b /src/H5private.h
parent20146575aaeead9e05af73977dee863de63bf50f (diff)
downloadhdf5-37232bd4f0f8199f956c823cdff72ece2ca9aa16.zip
hdf5-37232bd4f0f8199f956c823cdff72ece2ca9aa16.tar.gz
hdf5-37232bd4f0f8199f956c823cdff72ece2ca9aa16.tar.bz2
[svn-r9729] Purpose:
Bug Fix/Code Cleanup/Doc Cleanup/Optimization/Branch Sync :-) Description: Generally speaking, this is the "signed->unsigned" change to selections. However, in the process of merging code back, things got stickier and stickier until I ended up doing a big "sync the two branches up" operation. So... I brought back all the "infrastructure" fixes from the development branch to the release branch (which I think were actually making some improvement in performance) as well as fixed several bugs which had been fixed in one branch, but not the other. I've also tagged the repository before making this checkin with the label "before_signed_unsigned_changes". Platforms tested: FreeBSD 4.10 (sleipnir) w/parallel & fphdf5 FreeBSD 4.10 (sleipnir) w/threadsafe FreeBSD 4.10 (sleipnir) w/backward compatibility Solaris 2.7 (arabica) w/"purify options" Solaris 2.8 (sol) w/FORTRAN & C++ AIX 5.x (copper) w/parallel & FORTRAN IRIX64 6.5 (modi4) w/FORTRAN Linux 2.4 (heping) w/FORTRAN & C++ Misc. update:
Diffstat (limited to 'src/H5private.h')
-rw-r--r--src/H5private.h74
1 files changed, 43 insertions, 31 deletions
diff --git a/src/H5private.h b/src/H5private.h
index d8f7f15..526717c 100644
--- a/src/H5private.h
+++ b/src/H5private.h
@@ -289,7 +289,7 @@
# define FALSE 0
#endif
#ifndef TRUE
-# define TRUE (!FALSE)
+# define TRUE 1
#endif
/*
@@ -844,9 +844,9 @@ H5_DLL int64_t HDstrtoll (const char *s, const char **rest, int base);
#define HDuname(S) uname(S)
#define HDungetc(C,F) ungetc(C,F)
#ifdef WIN32
-#define HDunlink(S) _unlink(S)
+#define HDunlink(S) _unlink(S)
#else
-#define HDunlink(S) unlink(S)
+#define HDunlink(S) unlink(S)
#endif
#define HDutime(S,T) utime(S,T)
#define HDva_arg(A,T) va_arg(A,T)
@@ -1125,6 +1125,25 @@ extern hbool_t H5_MPEinit_g; /* Has the MPE Library been initialized? */
assert(func_name)
#endif /* H5_HAVE_FUNCTION */
+/* Macros for defining interface initialization routines */
+#ifdef H5_INTERFACE_INIT_FUNC
+static int H5_interface_initialize_g = 0;
+static herr_t H5_INTERFACE_INIT_FUNC(void);
+#define H5_INTERFACE_INIT(err) \
+ /* Initialize this interface or bust */ \
+ if (!H5_interface_initialize_g) { \
+ H5_interface_initialize_g = 1; \
+ if (H5_INTERFACE_INIT_FUNC()<0) { \
+ H5_interface_initialize_g = 0; \
+ HGOTO_ERROR (H5E_FUNC, H5E_CANTINIT, err, \
+ "interface initialization failed") \
+ } \
+ }
+#else /* H5_INTERFACE_INIT_FUNC */
+#define H5_INTERFACE_INIT(err)
+#endif /* H5_INTERFACE_INIT_FUNC */
+
+
#define FUNC_ENTER_COMMON_NOFUNC(func_name,asrt) \
PABLO_SAVE (ID_ ## func_name) \
\
@@ -1165,7 +1184,7 @@ extern hbool_t H5_MPEinit_g; /* Has the MPE Library been initialized? */
FUNC_ENTER_API_VARS(func_name) \
FUNC_ENTER_COMMON(func_name,H5_IS_API(#func_name)); \
FUNC_ENTER_API_THREADSAFE; \
- FUNC_ENTER_API_COMMON(func_name,INTERFACE_INIT,err); \
+ FUNC_ENTER_API_COMMON(func_name,err); \
/* Clear thread error stack entering public functions */ \
H5E_clear(); \
{
@@ -1178,7 +1197,7 @@ extern hbool_t H5_MPEinit_g; /* Has the MPE Library been initialized? */
FUNC_ENTER_API_VARS(func_name) \
FUNC_ENTER_COMMON(func_name,H5_IS_API(#func_name)); \
FUNC_ENTER_API_THREADSAFE; \
- FUNC_ENTER_API_COMMON(func_name,INTERFACE_INIT,err); \
+ FUNC_ENTER_API_COMMON(func_name,err); \
{
/*
@@ -1198,7 +1217,13 @@ extern hbool_t H5_MPEinit_g; /* Has the MPE Library been initialized? */
/* Use this macro for all "normal" non-API functions */
#define FUNC_ENTER_NOAPI(func_name,err) { \
FUNC_ENTER_COMMON(func_name,!H5_IS_API(#func_name)); \
- FUNC_ENTER_NOAPI_INIT(func_name,INTERFACE_INIT,err) \
+ FUNC_ENTER_NOAPI_INIT(func_name,err) \
+ {
+
+/* Use this macro for all non-API functions which don't issue errors */
+#define FUNC_ENTER_NOAPI_NOFUNC(func_name) { \
+ FUNC_ENTER_COMMON_NOFUNC(func_name,!H5_IS_API(#func_name)); \
+ FUNC_ENTER_NOAPI_INIT(func_name,err) \
{
/*
@@ -1235,12 +1260,16 @@ extern hbool_t H5_MPEinit_g; /* Has the MPE Library been initialized? */
* Use this macro for non-API functions which fall into these categories:
* - functions which shouldn't push their name on the function stack
* (so far, just the H5FS routines themselves)
+ *
+ * This macro is used for functions which fit the above categories _and_
+ * also don't use the 'FUNC' variable (i.e. don't push errors on the error stack)
+ *
*/
-#define FUNC_ENTER_NOAPI_NOFS(func_name) { \
- FUNC_ENTER_COMMON(func_name,!H5_IS_API(#func_name)); \
+#define FUNC_ENTER_NOAPI_NOFUNC_NOFS(func_name) { \
+ FUNC_ENTER_COMMON_NOFUNC(func_name,!H5_IS_API(#func_name)); \
{
-#define FUNC_ENTER_API_COMMON(func_name,interface_init_func,err) \
+#define FUNC_ENTER_API_COMMON(func_name,err) \
/* Initialize the library */ \
if (!(H5_INIT_GLOBAL)) { \
H5_INIT_GLOBAL = TRUE; \
@@ -1249,33 +1278,17 @@ extern hbool_t H5_MPEinit_g; /* Has the MPE Library been initialized? */
"library initialization failed") \
} \
\
- /* Initialize this interface or bust */ \
- if (!interface_initialize_g) { \
- interface_initialize_g = 1; \
- if (interface_init_func && \
- ((herr_t(*)(void))interface_init_func)()<0) { \
- interface_initialize_g = 0; \
- HGOTO_ERROR (H5E_FUNC, H5E_CANTINIT, err, \
- "interface initialization failed"); \
- } \
- } \
+ /* Initialize the interface, if appropriate */ \
+ H5_INTERFACE_INIT(err) \
\
/* Push the name of this function on the function stack */ \
H5_PUSH_FUNC(func_name); \
\
BEGIN_MPE_LOG(func_name)
-#define FUNC_ENTER_NOAPI_INIT(func_name,interface_init_func,err) \
- /* Initialize this interface or bust */ \
- if (!interface_initialize_g) { \
- interface_initialize_g = 1; \
- if (interface_init_func && \
- ((herr_t(*)(void))interface_init_func)()<0) { \
- interface_initialize_g = 0; \
- HGOTO_ERROR (H5E_FUNC, H5E_CANTINIT, err, \
- "interface initialization failed"); \
- } \
- } \
+#define FUNC_ENTER_NOAPI_INIT(func_name,err) \
+ /* Initialize the interface, if appropriate */ \
+ H5_INTERFACE_INIT(err) \
\
/* Push the name of this function on the function stack */ \
H5_PUSH_FUNC(func_name);
@@ -1362,7 +1375,6 @@ H5_DLL int H5I_term_interface(void);
H5_DLL int H5P_term_interface(void);
H5_DLL int H5R_term_interface(void);
H5_DLL int H5S_term_interface(void);
-H5_DLL int H5TN_term_interface(void);
H5_DLL int H5T_term_interface(void);
H5_DLL int H5Z_term_interface(void);