summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRobb Matzke <matzke@llnl.gov>1998-04-24 21:26:32 (GMT)
committerRobb Matzke <matzke@llnl.gov>1998-04-24 21:26:32 (GMT)
commit4dcf59ae4461eec74a180d77783d9064d2aa3a58 (patch)
tree3c720b6ce64b7e81e6e28f773755fe0fb97cfde9 /src
parent98b5a7f9c5a881c849cd536579bb121cf185e2db (diff)
downloadhdf5-4dcf59ae4461eec74a180d77783d9064d2aa3a58.zip
hdf5-4dcf59ae4461eec74a180d77783d9064d2aa3a58.tar.gz
hdf5-4dcf59ae4461eec74a180d77783d9064d2aa3a58.tar.bz2
[svn-r376] ./acconfig.h
./configure.in ./config/BlankForm ./src/H5.c Configure tries to figure out how to print `long long' types and then defines PRINTF_LL_WIDTH to be `ll' or `q' or something. It does this by running little sprintf() programs with various formats until it gets one that works. If this causes problems when cross compiling (like with parallel machines) then you may add the following to the appropriate config file: hdf5_cv_printf_ll=${hdf5_cv_printf_ll='ll'} or hdf5_cv_printf_ll=${hdf5_cv_printf_ll='q'} or hdf5_cv_printf_ll=${hdf5_cv_printf_ll='l'} ./config/intel-osf1 ./config/irix5.3 Updated these config files to match the others. This allows the `--enable-production' configure flag to work properly.
Diffstat (limited to 'src')
-rw-r--r--src/H5.c35
-rw-r--r--src/H5config.h.in3
2 files changed, 21 insertions, 17 deletions
diff --git a/src/H5.c b/src/H5.c
index 7267461..c9e755e 100644
--- a/src/H5.c
+++ b/src/H5.c
@@ -462,7 +462,7 @@ HDfprintf (FILE *stream, const char *fmt, ...)
int plussign;
int ldspace;
int prefix;
- int modifier;
+ char modifier[8];
int conv;
char *rest, template[128];
const char *s;
@@ -479,7 +479,7 @@ HDfprintf (FILE *stream, const char *fmt, ...)
plussign = 0;
prefix = 0;
ldspace = 0;
- modifier = 0;
+ modifier[0] = '\0';
if ('%'==fmt[0] && '%'==fmt[1]) {
putc ('%', stream);
@@ -539,13 +539,14 @@ HDfprintf (FILE *stream, const char *fmt, ...)
switch (*s) {
case 'H':
if (sizeof(hsize_t)==sizeof(long)) {
- modifier = 'l';
+ strcpy (modifier, "l");
} else if (sizeof(hsize_t)==sizeof(long long)) {
- modifier = 'q';
+ strcpy (modifier, PRINTF_LL_WIDTH);
}
break;
default:
- modifier = *s;
+ modifier[0] = *s;
+ modifier[1] = '\0';
break;
}
s++;
@@ -565,7 +566,7 @@ HDfprintf (FILE *stream, const char *fmt, ...)
sprintf (template+strlen (template), ".%d", prec);
}
if (modifier) {
- sprintf (template+strlen (template), "%c", modifier);
+ sprintf (template+strlen (template), "%s", modifier);
}
sprintf (template+strlen (template), "%c", conv);
@@ -574,16 +575,16 @@ HDfprintf (FILE *stream, const char *fmt, ...)
switch (conv) {
case 'd':
case 'i':
- if ('h'==modifier) {
+ if (!strcmp (modifier, "h")) {
short x = va_arg (ap, short);
n = fprintf (stream, template, x);
- } else if (!modifier) {
+ } else if (!*modifier) {
int x = va_arg (ap, int);
n = fprintf (stream, template, x);
- } else if ('l'==modifier) {
+ } else if (!strcmp (modifier, "l")) {
long x = va_arg (ap, long);
n = fprintf (stream, template, x);
- } else if ('q'==modifier) {
+ } else {
long long x = va_arg (ap, long long);
n = fprintf (stream, template, x);
}
@@ -593,16 +594,16 @@ HDfprintf (FILE *stream, const char *fmt, ...)
case 'u':
case 'x':
case 'X':
- if ('h'==modifier) {
+ if (!strcmp (modifier, "h")) {
unsigned short x = va_arg (ap, unsigned short);
n = fprintf (stream, template, x);
- } else if (!modifier) {
+ } else if (!*modifier) {
unsigned int x = va_arg (ap, unsigned int);
n = fprintf (stream, template, x);
- } else if ('l'==modifier) {
+ } else if (!strcmp (modifier, "l")) {
unsigned long x = va_arg (ap, unsigned long);
n = fprintf (stream, template, x);
- } else if ('q'==modifier) {
+ } else {
unsigned long long x = va_arg (ap, unsigned long long);
n = fprintf (stream, template, x);
}
@@ -613,13 +614,13 @@ HDfprintf (FILE *stream, const char *fmt, ...)
case 'E':
case 'g':
case 'G':
- if ('h'==modifier) {
+ if (!strcmp (modifier, "h")) {
float x = va_arg (ap, float);
n = fprintf (stream, template, x);
- } else if (!modifier || 'l'==modifier) {
+ } else if (!*modifier || !strcmp (modifier, "l")) {
double x = va_arg (ap, double);
n = fprintf (stream, template, x);
- } else if ('q'==modifier) {
+ } else {
long double x = va_arg (ap, long double);
n = fprintf (stream, template, x);
}
diff --git a/src/H5config.h.in b/src/H5config.h.in
index 9bb277a..fbe2c73 100644
--- a/src/H5config.h.in
+++ b/src/H5config.h.in
@@ -31,6 +31,9 @@
/* Define if it's safe to use `long long' for hsize_t and hssize_t */
#undef HAVE_LARGE_HSIZET
+/* The width parameter for printf formats for type `long long', us. `ll' */
+#undef PRINTF_LL_WIDTH
+
/* The number of bytes in a double. */
#undef SIZEOF_DOUBLE