summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlbert Cheng <acheng@hdfgroup.org>2002-04-28 08:34:17 (GMT)
committerAlbert Cheng <acheng@hdfgroup.org>2002-04-28 08:34:17 (GMT)
commit73683e4380583563699330b8e32b1a34a476447a (patch)
tree546dc25c90c284a3630788ebef4693791810e028 /src
parenteb09629a45ce8b1fbc435c4f27f1cf4e297d6826 (diff)
downloadhdf5-73683e4380583563699330b8e32b1a34a476447a.zip
hdf5-73683e4380583563699330b8e32b1a34a476447a.tar.gz
hdf5-73683e4380583563699330b8e32b1a34a476447a.tar.bz2
[svn-r5278] Purpose:
Migrate from configure macros of XYZ_ABC to H5_XYZ_ABC Description: configure generates many macros definitions on the fly and were stored in src/H5config.h which is included by H5public.h. But other software that uses hdf5 may also run their own configure. There can be a clash in macro name space. We decided awhile ago to prepend all generated macros with "H5_" to avoid conflicts. The process has started and this commit completes it (at least attempt to). Solution: Many macros symbols (e.g. SIZEOF_xxx and HAVE_xxx were changed to H5_SIZEOF_xxx and H5_HAVE_xxx). Then H5private.h no longer includes H5config.h. This cuts H5config.h away from HDF5 source code. Pending issues: The module of fortran and pablo are to be resolved in a different commit. Platforms tested: eirene (parallel), arabica (solaris 7 --enable-fortran, --enable-cxx)
Diffstat (limited to 'src')
-rw-r--r--src/H5.c14
-rw-r--r--src/H5F.c2
-rw-r--r--src/H5Fpkg.h6
-rw-r--r--src/H5G.c4
-rw-r--r--src/H5detect.c56
-rw-r--r--src/H5private.h149
6 files changed, 111 insertions, 120 deletions
diff --git a/src/H5.c b/src/H5.c
index c2c76d2..1fefa4f 100644
--- a/src/H5.c
+++ b/src/H5.c
@@ -805,7 +805,7 @@ HDfprintf (FILE *stream, const char *fmt, ...)
} else if (sizeof(hsize_t)==sizeof(long)) {
HDstrcpy (modifier, "l");
} else {
- HDstrcpy (modifier, PRINTF_LL_WIDTH);
+ HDstrcpy (modifier, H5_PRINTF_LL_WIDTH);
}
break;
case 'Z':
@@ -814,7 +814,7 @@ HDfprintf (FILE *stream, const char *fmt, ...)
} else if (sizeof(size_t)==sizeof(long)) {
HDstrcpy (modifier, "l");
} else {
- HDstrcpy (modifier, PRINTF_LL_WIDTH);
+ HDstrcpy (modifier, H5_PRINTF_LL_WIDTH);
}
break;
default:
@@ -917,7 +917,7 @@ HDfprintf (FILE *stream, const char *fmt, ...)
* Some compilers complain when `long double' and
* `double' are the same thing.
*/
-#if SIZEOF_LONG_DOUBLE != SIZEOF_DOUBLE
+#if H5_SIZEOF_LONG_DOUBLE != H5_SIZEOF_DOUBLE
long double x = va_arg (ap, long double);
n = fprintf (stream, format_templ, x);
#else
@@ -938,12 +938,12 @@ HDfprintf (FILE *stream, const char *fmt, ...)
if (fwidth>0) {
sprintf(format_templ+HDstrlen(format_templ), "%d", fwidth);
}
- if (sizeof(x)==SIZEOF_INT) {
+ if (sizeof(x)==H5_SIZEOF_INT) {
HDstrcat(format_templ, "d");
- } else if (sizeof(x)==SIZEOF_LONG) {
+ } else if (sizeof(x)==H5_SIZEOF_LONG) {
HDstrcat(format_templ, "ld");
- } else if (sizeof(x)==SIZEOF_LONG_LONG) {
- HDstrcat(format_templ, PRINTF_LL_WIDTH);
+ } else if (sizeof(x)==H5_SIZEOF_LONG_LONG) {
+ HDstrcat(format_templ, H5_PRINTF_LL_WIDTH);
HDstrcat(format_templ, "d");
}
n = fprintf(stream, format_templ, x);
diff --git a/src/H5F.c b/src/H5F.c
index 9c1fd21..84175af 100644
--- a/src/H5F.c
+++ b/src/H5F.c
@@ -3516,7 +3516,7 @@ H5F_addr_pack(H5F_t UNUSED *f, haddr_t *addr_p/*out*/,
assert(addr_p);
*addr_p = objno[0];
-#if SIZEOF_LONG<SIZEOF_UINT64_T
+#if H5_SIZEOF_LONG<H5_SIZEOF_UINT64_T
*addr_p |= ((uint64_t)objno[1]) << (8*sizeof(long));
#endif
diff --git a/src/H5Fpkg.h b/src/H5Fpkg.h
index bb36ba6..458ac1e 100644
--- a/src/H5Fpkg.h
+++ b/src/H5Fpkg.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2000-2001 NCSA
+ * Copyright (C) 2000-2002 NCSA
* All rights reserved.
*
* Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu>
@@ -55,13 +55,13 @@
* Macros that check for overflows. These are somewhat dangerous to fiddle
* with.
*/
-#if (SIZEOF_SIZE_T >= SIZEOF_OFF_T)
+#if (H5_SIZEOF_SIZE_T >= H5_SIZEOF_OFF_T)
# define H5F_OVERFLOW_SIZET2OFFT(X) \
((size_t)(X)>=(size_t)((size_t)1<<(8*sizeof(off_t)-1)))
#else
# define H5F_OVERFLOW_SIZET2OFFT(X) 0
#endif
-#if (H5_SIZEOF_HSIZE_T >= SIZEOF_OFF_T)
+#if (H5_SIZEOF_HSIZE_T >= H5_SIZEOF_OFF_T)
# define H5F_OVERFLOW_HSIZET2OFFT(X) \
((hsize_t)(X)>=(hsize_t)((hsize_t)1<<(8*sizeof(off_t)-1)))
#else
diff --git a/src/H5G.c b/src/H5G.c
index bfbd9df..44fa8fc 100644
--- a/src/H5G.c
+++ b/src/H5G.c
@@ -1,5 +1,5 @@
/*-------------------------------------------------------------------------
- * Copyright (C) 1997-2001 National Center for Supercomputing Applications
+ * Copyright (C) 1997-2002 National Center for Supercomputing Applications
* All rights reserved.
*
*-------------------------------------------------------------------------
@@ -2125,7 +2125,7 @@ H5G_get_objinfo (H5G_entry_t *loc, const char *name, hbool_t follow_link,
} else {
/* Some other type of object */
statbuf->objno[0] = (unsigned long)(obj_ent.header);
-#if SIZEOF_UINT64_T>SIZEOF_LONG
+#if H5_SIZEOF_UINT64_T>H5_SIZEOF_LONG
statbuf->objno[1] = (unsigned long)(obj_ent.header >>
8*sizeof(long));
#else
diff --git a/src/H5detect.c b/src/H5detect.c
index 39aeafa..0c789b7 100644
--- a/src/H5detect.c
+++ b/src/H5detect.c
@@ -1,8 +1,8 @@
/*keep this here -RPM*/
static const char *FileHeader = "\n\
/*-------------------------------------------------------------------------\n\
- * Copyright (C) 1997-2001 National Center for Supercomputing Applications \n\
- * All rights reserved. \n\
+ * Copyright (C) 1997-2002 National Center for Supercomputing Applications \n\
+ * All rights reserved. \n\
* \n\
*-------------------------------------------------------------------------";
/*
@@ -1018,80 +1018,80 @@ main(void)
/*
* C9x integer types.
*/
-#if SIZEOF_INT8_T>0
+#if H5_SIZEOF_INT8_T>0
DETECT_I(int8_t, INT8, d[nd]); nd++;
#endif
-#if SIZEOF_UINT8_T>0
+#if H5_SIZEOF_UINT8_T>0
DETECT_I(uint8_t, UINT8, d[nd]); nd++;
#endif
-#if SIZEOF_INT_LEAST8_T>0
+#if H5_SIZEOF_INT_LEAST8_T>0
DETECT_I(int_least8_t, INT_LEAST8, d[nd]); nd++;
#endif
-#if SIZEOF_UINT_LEAST8_T>0
+#if H5_SIZEOF_UINT_LEAST8_T>0
DETECT_I(uint_least8_t, UINT_LEAST8, d[nd]); nd++;
#endif
-#if SIZEOF_INT_FAST8_T>0
+#if H5_SIZEOF_INT_FAST8_T>0
DETECT_I(int_fast8_t, INT_FAST8, d[nd]); nd++;
#endif
-#if SIZEOF_UINT_FAST8_T>0
+#if H5_SIZEOF_UINT_FAST8_T>0
DETECT_I(uint_fast8_t, UINT_FAST8, d[nd]); nd++;
#endif
-#if SIZEOF_INT16_T>0
+#if H5_SIZEOF_INT16_T>0
DETECT_I(int16_t, INT16, d[nd]); nd++;
#endif
-#if SIZEOF_UINT16_T>0
+#if H5_SIZEOF_UINT16_T>0
DETECT_I(uint16_t, UINT16, d[nd]); nd++;
#endif
-#if SIZEOF_INT_LEAST16_T>0
+#if H5_SIZEOF_INT_LEAST16_T>0
DETECT_I(int_least16_t, INT_LEAST16, d[nd]); nd++;
#endif
-#if SIZEOF_UINT_LEAST16_T>0
+#if H5_SIZEOF_UINT_LEAST16_T>0
DETECT_I(uint_least16_t, UINT_LEAST16, d[nd]); nd++;
#endif
-#if SIZEOF_INT_FAST16_T>0
+#if H5_SIZEOF_INT_FAST16_T>0
DETECT_I(int_fast16_t, INT_FAST16, d[nd]); nd++;
#endif
-#if SIZEOF_UINT_FAST16_T>0
+#if H5_SIZEOF_UINT_FAST16_T>0
DETECT_I(uint_fast16_t, UINT_FAST16, d[nd]); nd++;
#endif
-#if SIZEOF_INT32_T>0
+#if H5_SIZEOF_INT32_T>0
DETECT_I(int32_t, INT32, d[nd]); nd++;
#endif
-#if SIZEOF_UINT32_T>0
+#if H5_SIZEOF_UINT32_T>0
DETECT_I(uint32_t, UINT32, d[nd]); nd++;
#endif
-#if SIZEOF_INT_LEAST32_T>0
+#if H5_SIZEOF_INT_LEAST32_T>0
DETECT_I(int_least32_t, INT_LEAST32, d[nd]); nd++;
#endif
-#if SIZEOF_UINT_LEAST32_T>0
+#if H5_SIZEOF_UINT_LEAST32_T>0
DETECT_I(uint_least32_t, UINT_LEAST32, d[nd]); nd++;
#endif
-#if SIZEOF_INT_FAST32_T>0
+#if H5_SIZEOF_INT_FAST32_T>0
DETECT_I(int_fast32_t, INT_FAST32, d[nd]); nd++;
#endif
-#if SIZEOF_UINT_FAST32_T>0
+#if H5_SIZEOF_UINT_FAST32_T>0
DETECT_I(uint_fast32_t, UINT_FAST32, d[nd]); nd++;
#endif
-#if SIZEOF_INT64_T>0
+#if H5_SIZEOF_INT64_T>0
DETECT_I(int64_t, INT64, d[nd]); nd++;
#endif
-#if SIZEOF_UINT64_T>0
+#if H5_SIZEOF_UINT64_T>0
DETECT_I(uint64_t, UINT64, d[nd]); nd++;
#endif
-#if SIZEOF_INT_LEAST64_T>0
+#if H5_SIZEOF_INT_LEAST64_T>0
DETECT_I(int_least64_t, INT_LEAST64, d[nd]); nd++;
#endif
-#if SIZEOF_UINT_LEAST64_T>0
+#if H5_SIZEOF_UINT_LEAST64_T>0
DETECT_I(uint_least64_t, UINT_LEAST64, d[nd]); nd++;
#endif
-#if SIZEOF_INT_FAST64_T>0
+#if H5_SIZEOF_INT_FAST64_T>0
DETECT_I(int_fast64_t, INT_FAST64, d[nd]); nd++;
#endif
-#if SIZEOF_UINT_FAST64_T>0
+#if H5_SIZEOF_UINT_FAST64_T>0
DETECT_I(uint_fast64_t, UINT_FAST64, d[nd]); nd++;
#endif
-#if SIZEOF_LONG_LONG>0
+#if H5_SIZEOF_LONG_LONG>0
DETECT_I(long_long, LLONG, d[nd]); nd++;
DETECT_I(unsigned long_long, ULLONG, d[nd]); nd++;
#else
@@ -1107,7 +1107,7 @@ main(void)
DETECT_F(float, FLOAT, d[nd]); nd++;
DETECT_F(double, DOUBLE, d[nd]); nd++;
-#if SIZEOF_DOUBLE == SIZEOF_LONG_DOUBLE
+#if H5_SIZEOF_DOUBLE == H5_SIZEOF_LONG_DOUBLE
/*
* If sizeof(double)==sizeof(long double) then assume that `long double'
* isn't supported and use `double' instead. This suppresses warnings on
diff --git a/src/H5private.h b/src/H5private.h
index c5c96ab..33f4fc3 100644
--- a/src/H5private.h
+++ b/src/H5private.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 1998-2001 NCSA
+ * Copyright (C) 1998-2002 NCSA
* All rights reserved.
*
* Programmer: Robb Matzke <matzke@llnl.gov>
@@ -16,16 +16,6 @@
#include "H5public.h" /* Include Public Definitions */
-/*
- * Since H5config.h is a generated header file, it is messy to try
- * to put a #ifndef _H5config_H ... #endif guard in it.
- * HDF5 has set an internal rule that it is being included here.
- * Source files should NOT include H5config.h directly but include
- * it via H5private.h. The #ifndef _H5private_H guard above would
- * prevent repeated include.
- */
-#include "H5config.h" /* Include all configuration info */
-
/* include the pthread header */
#ifdef H5_HAVE_THREADSAFE
#include <pthread.h>
@@ -135,6 +125,7 @@
# include <io.h>
#endif
+
#ifdef WIN32
#define VC_EXTRALEAN /*Exclude rarely-used stuff from Windows headers */
@@ -275,16 +266,16 @@ MS doesn't recognize it yet (as of April 2001)
* supported by the compiler, usually 64 bits. It must be legal to qualify
* `long_long' with `unsigned'.
*/
-#if SIZEOF_LONG_LONG>0
+#if H5_SIZEOF_LONG_LONG>0
# define long_long long long
-#elif SIZEOF___INT64>0
+#elif H5_SIZEOF___INT64>0
# define long_long __int64 /*Win32*/
-# undef SIZEOF_LONG_LONG
-# define SIZEOF_LONG_LONG SIZEOF___INT64
+# undef H5_SIZEOF_LONG_LONG
+# define H5_SIZEOF_LONG_LONG H5_SIZEOF___INT64
#else
# define long_long long int
-# undef SIZEOF_LONG_LONG
-# define SIZEOF_LONG_LONG SIZEOF_LONG
+# undef H5_SIZEOF_LONG_LONG
+# define H5_SIZEOF_LONG_LONG H5_SIZEOF_LONG
#endif
/*
@@ -294,114 +285,114 @@ MS doesn't recognize it yet (as of April 2001)
* be exactly one byte wide because we use it for pointer calculations to
* void* memory.
*/
-#if SIZEOF_INT8_T==0
+#if H5_SIZEOF_INT8_T==0
typedef signed char int8_t;
-# undef SIZEOF_INT8_T
-# define SIZEOF_INT8_T SIZEOF_CHAR
-#elif SIZEOF_INT8_T==1
+# undef H5_SIZEOF_INT8_T
+# define H5_SIZEOF_INT8_T H5_SIZEOF_CHAR
+#elif H5_SIZEOF_INT8_T==1
#else
# error "the int8_t type must be 1 byte wide"
#endif
-#if SIZEOF_UINT8_T==0
+#if H5_SIZEOF_UINT8_T==0
typedef unsigned char uint8_t;
-# undef SIZEOF_UINT8_T
-# define SIZEOF_UINT8_T SIZEOF_CHAR
-#elif SIZEOF_UINT8_T==1
+# undef H5_SIZEOF_UINT8_T
+# define H5_SIZEOF_UINT8_T H5_SIZEOF_CHAR
+#elif H5_SIZEOF_UINT8_T==1
#else
# error "the uint8_t type must be 1 byte wide"
#endif
-#if SIZEOF_INT16_T>=2
-#elif SIZEOF_SHORT>=2
+#if H5_SIZEOF_INT16_T>=2
+#elif H5_SIZEOF_SHORT>=2
typedef short int16_t;
-# undef SIZEOF_INT16_T
-# define SIZEOF_INT16_T SIZEOF_SHORT
-#elif SIZEOF_INT>=2
+# undef H5_SIZEOF_INT16_T
+# define H5_SIZEOF_INT16_T H5_SIZEOF_SHORT
+#elif H5_SIZEOF_INT>=2
typedef int int16_t;
-# undef SIZEOF_INT16_T
-# define SIZEOF_INT16_T SIZEOF_INT
+# undef H5_SIZEOF_INT16_T
+# define H5_SIZEOF_INT16_T H5_SIZEOF_INT
#else
# error "nothing appropriate for int16_t"
#endif
-#if SIZEOF_UINT16_T>=2
-#elif SIZEOF_SHORT>=2
+#if H5_SIZEOF_UINT16_T>=2
+#elif H5_SIZEOF_SHORT>=2
typedef unsigned short uint16_t;
-# undef SIZEOF_UINT16_T
-# define SIZEOF_UINT16_T SIZEOF_SHORT
-#elif SIZEOF_INT>=2
+# undef H5_SIZEOF_UINT16_T
+# define H5_SIZEOF_UINT16_T H5_SIZEOF_SHORT
+#elif H5_SIZEOF_INT>=2
typedef unsigned uint16_t;
-# undef SIZEOF_UINT16_T
-# define SIZEOF_UINT16_T SIZEOF_INT
+# undef H5_SIZEOF_UINT16_T
+# define H5_SIZEOF_UINT16_T H5_SIZEOF_INT
#else
# error "nothing appropriate for uint16_t"
#endif
-#if SIZEOF_INT32_T>=4
-#elif SIZEOF_SHORT>=4
+#if H5_SIZEOF_INT32_T>=4
+#elif H5_SIZEOF_SHORT>=4
typedef short int32_t;
-# undef SIZEOF_INT32_T
-# define SIZEOF_INT32_T SIZEOF_SHORT
-#elif SIZEOF_INT>=4
+# undef H5_SIZEOF_INT32_T
+# define H5_SIZEOF_INT32_T H5_SIZEOF_SHORT
+#elif H5_SIZEOF_INT>=4
typedef int int32_t;
-# undef SIZEOF_INT32_T
-# define SIZEOF_INT32_T SIZEOF_INT
-#elif SIZEOF_LONG>=4
+# undef H5_SIZEOF_INT32_T
+# define H5_SIZEOF_INT32_T H5_SIZEOF_INT
+#elif H5_SIZEOF_LONG>=4
typedef long int32_t;
-# undef SIZEOF_INT32_T
-# define SIZEOF_INT32_T SIZEOF_LONG
+# undef H5_SIZEOF_INT32_T
+# define H5_SIZEOF_INT32_T H5_SIZEOF_LONG
#else
# error "nothing appropriate for int32_t"
#endif
-#if SIZEOF_UINT32_T>=4
-#elif SIZEOF_SHORT>=4
+#if H5_SIZEOF_UINT32_T>=4
+#elif H5_SIZEOF_SHORT>=4
typedef short uint32_t;
-# undef SIZEOF_UINT32_T
-# define SIZEOF_UINT32_T SIZEOF_SHORT
-#elif SIZEOF_INT>=4
+# undef H5_SIZEOF_UINT32_T
+# define H5_SIZEOF_UINT32_T H5_SIZEOF_SHORT
+#elif H5_SIZEOF_INT>=4
typedef unsigned int uint32_t;
-# undef SIZEOF_UINT32_T
-# define SIZEOF_UINT32_T SIZEOF_INT
-#elif SIZEOF_LONG>=4
+# undef H5_SIZEOF_UINT32_T
+# define H5_SIZEOF_UINT32_T H5_SIZEOF_INT
+#elif H5_SIZEOF_LONG>=4
typedef unsigned long uint32_t;
-# undef SIZEOF_UINT32_T
-# define SIZEOF_UINT32_T SIZEOF_LONG
+# undef H5_SIZEOF_UINT32_T
+# define H5_SIZEOF_UINT32_T H5_SIZEOF_LONG
#else
# error "nothing appropriate for uint32_t"
#endif
-#if SIZEOF_INT64_T>=8
-#elif SIZEOF_INT>=8
+#if H5_SIZEOF_INT64_T>=8
+#elif H5_SIZEOF_INT>=8
typedef int int64_t;
-# undef SIZEOF_INT64_T
-# define SIZEOF_INT64_T SIZEOF_INT
-#elif SIZEOF_LONG>=8
+# undef H5_SIZEOF_INT64_T
+# define H5_SIZEOF_INT64_T H5_SIZEOF_INT
+#elif H5_SIZEOF_LONG>=8
typedef long int64_t;
-# undef SIZEOF_INT64_T
-# define SIZEOF_INT64_T SIZEOF_LONG
-#elif SIZEOF_LONG_LONG>=8
+# undef H5_SIZEOF_INT64_T
+# define H5_SIZEOF_INT64_T H5_SIZEOF_LONG
+#elif H5_SIZEOF_LONG_LONG>=8
typedef long_long int64_t;
-# undef SIZEOF_INT64_T
-# define SIZEOF_INT64_T SIZEOF_LONG_LONG
+# undef H5_SIZEOF_INT64_T
+# define H5_SIZEOF_INT64_T H5_SIZEOF_LONG_LONG
#else
# error "nothing appropriate for int64_t"
#endif
-#if SIZEOF_UINT64_T>=8
-#elif SIZEOF_INT>=8
+#if H5_SIZEOF_UINT64_T>=8
+#elif H5_SIZEOF_INT>=8
typedef unsigned uint64_t;
-# undef SIZEOF_UINT64_T
-# define SIZEOF_UINT64_T SIZEOF_INT
-#elif SIZEOF_LONG>=8
+# undef H5_SIZEOF_UINT64_T
+# define H5_SIZEOF_UINT64_T H5_SIZEOF_INT
+#elif H5_SIZEOF_LONG>=8
typedef unsigned long uint64_t;
-# undef SIZEOF_UINT64_T
-# define SIZEOF_UINT64_T SIZEOF_LONG
-#elif SIZEOF_LONG_LONG>=8
+# undef H5_SIZEOF_UINT64_T
+# define H5_SIZEOF_UINT64_T H5_SIZEOF_LONG
+#elif H5_SIZEOF_LONG_LONG>=8
typedef unsigned long_long uint64_t;
-# undef SIZEOF_UINT64_T
-# define SIZEOF_UINT64_T SIZEOF_LONG_LONG
+# undef H5_SIZEOF_UINT64_T
+# define H5_SIZEOF_UINT64_T H5_SIZEOF_LONG_LONG
#else
# error "nothing appropriate for uint64_t"
#endif