summaryrefslogtreecommitdiffstats
path: root/src/H5Tnative.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2005-07-23 01:55:12 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2005-07-23 01:55:12 (GMT)
commit34bd25f361f81efc396314528f1824fe63af494e (patch)
tree0fa0ec3c102abac15cd4f1012b99941fdf703009 /src/H5Tnative.c
parent138d4f52544af96770b4a5f151a7b64f2c4dc922 (diff)
downloadhdf5-34bd25f361f81efc396314528f1824fe63af494e.zip
hdf5-34bd25f361f81efc396314528f1824fe63af494e.tar.gz
hdf5-34bd25f361f81efc396314528f1824fe63af494e.tar.bz2
[svn-r11144] Purpose:
New port Description: Elena asked me to check in her NEC SX-6 work, so here it is! :-) Platforms tested: FreeBSD 4.11 (sleipnir) NEC SX-6 (by Elena)
Diffstat (limited to 'src/H5Tnative.c')
-rw-r--r--src/H5Tnative.c44
1 files changed, 39 insertions, 5 deletions
diff --git a/src/H5Tnative.c b/src/H5Tnative.c
index ecae777..986d440 100644
--- a/src/H5Tnative.c
+++ b/src/H5Tnative.c
@@ -695,7 +695,9 @@ H5T_get_native_float(size_t size, H5T_direction_t direction, size_t *struct_alig
enum match_type { /* The different kinds of floating point types we can match */
H5T_NATIVE_FLOAT_MATCH_FLOAT,
H5T_NATIVE_FLOAT_MATCH_DOUBLE,
+#if H5_SIZEOF_LONG_DOUBLE !=0
H5T_NATIVE_FLOAT_MATCH_LDOUBLE,
+#endif
H5T_NATIVE_FLOAT_MATCH_UNKNOWN
} match=H5T_NATIVE_FLOAT_MATCH_UNKNOWN;
H5T_t *ret_value; /* Return value */
@@ -708,21 +710,33 @@ H5T_get_native_float(size_t size, H5T_direction_t direction, size_t *struct_alig
if(size<=sizeof(float)) {
match=H5T_NATIVE_FLOAT_MATCH_FLOAT;
native_size = sizeof(float);
- } else if(size<=sizeof(double)) {
+ }
+ else if(size<=sizeof(double)) {
match=H5T_NATIVE_FLOAT_MATCH_DOUBLE;
native_size = sizeof(double);
- } else if(size<=sizeof(long double)) {
+ }
+#if H5_SIZEOF_LONG_DOUBLE !=0
+ else if(size<=sizeof(long double)) {
match=H5T_NATIVE_FLOAT_MATCH_LDOUBLE;
native_size = sizeof(long double);
- } else { /* If not match, return the biggest datatype */
+ }
+#endif
+ else { /* If not match, return the biggest datatype */
+#if H5_SIZEOF_LONG_DOUBLE !=0
match=H5T_NATIVE_FLOAT_MATCH_LDOUBLE;
native_size = sizeof(long double);
+#else
+ match=H5T_NATIVE_FLOAT_MATCH_DOUBLE;
+ native_size = sizeof(double);
+#endif
}
} else {
+#if H5_SIZEOF_LONG_DOUBLE !=0
if(size>=sizeof(long double)) {
match=H5T_NATIVE_FLOAT_MATCH_LDOUBLE;
native_size = sizeof(long double);
- } else if(size>=sizeof(double)) {
+ }
+ else if(size>=sizeof(double)) {
if(size==sizeof(double)) {
match=H5T_NATIVE_FLOAT_MATCH_DOUBLE;
native_size = sizeof(double);
@@ -744,6 +758,25 @@ H5T_get_native_float(size_t size, H5T_direction_t direction, size_t *struct_alig
match=H5T_NATIVE_FLOAT_MATCH_FLOAT;
native_size = sizeof(float);
}
+#else
+ if(size>=sizeof(double)) {
+ match=H5T_NATIVE_FLOAT_MATCH_DOUBLE;
+ native_size = sizeof(double);
+ }
+ else if(size>=sizeof(float)) {
+ if(size==sizeof(float)) {
+ match=H5T_NATIVE_FLOAT_MATCH_FLOAT;
+ native_size = sizeof(float);
+ } else {
+ match=H5T_NATIVE_FLOAT_MATCH_DOUBLE;
+ native_size = sizeof(double);
+ }
+ }
+ else {
+ match=H5T_NATIVE_FLOAT_MATCH_FLOAT;
+ native_size = sizeof(float);
+ }
+#endif
}
/* Set the appropriate native floating point information */
@@ -758,11 +791,12 @@ H5T_get_native_float(size_t size, H5T_direction_t direction, size_t *struct_alig
align = H5T_NATIVE_DOUBLE_COMP_ALIGN_g;
break;
+#if H5_SIZEOF_LONG_DOUBLE !=0
case H5T_NATIVE_FLOAT_MATCH_LDOUBLE:
tid = H5T_NATIVE_LDOUBLE;
align = H5T_NATIVE_LDOUBLE_COMP_ALIGN_g;
break;
-
+#endif
case H5T_NATIVE_FLOAT_MATCH_UNKNOWN:
default:
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "Unknown native floating-point match")