File hdf5-configure-long-double.patch of Package hdf5

Index: hdf5-1.8.11/configure
===================================================================
--- hdf5-1.8.11.orig/configure
+++ hdf5-1.8.11/configure
@@ -30201,7 +30201,7 @@ else
             /* Test if the last 2 bytes of mantissa are lost.  Mainly for FreeBSD on Intel
              * architecture(sleipnir) where it happens. */
             /*if(endian==0 && c2[0]==0 && c2[1]==0)*/ /*little endian*/
-            if(endian==0 && c2[0]==0) { /*little endian*/
+            if(endian==0 && size == 12 && c2[0]==0) { /*little endian*/
                 ret = 1;
                 goto done;
             }
@@ -30220,16 +30220,16 @@ else
              * instead of 0x0000403effffffffffffffff, 0x0000403efffffffffffffffe, ...,
              * 0x0000403efffffffffffff000 ...
              */
-            if(endian==0 && c2_cyg[0]==0 && c2_cyg[1]==0 && c2_cyg[2]==0 && c2_cyg[3]==0)
+            if(endian==0 && size == 12 && c2_cyg[0]==0 && c2_cyg[1]==0 && c2_cyg[2]==0 && c2_cyg[3]==0)
                 ret = 1;
 
+            if(c2_cyg)
+                free(c2_cyg);
     done:
             if(c1)
                 free(c1);
             if(c2)
                 free(c2);
-            if(c2_cyg)
-                free(c2_cyg);
             exit(ret);
         }
 
Index: hdf5-1.8.11/configure.ac
===================================================================
--- hdf5-1.8.11.orig/configure.ac
+++ hdf5-1.8.11/configure.ac
@@ -3665,7 +3665,7 @@ else
             /* Test if the last 2 bytes of mantissa are lost.  Mainly for FreeBSD on Intel
              * architecture(sleipnir) where it happens. */        
             /*if(endian==0 && c2[0]==0 && c2[1]==0)*/ /*little endian*/
-            if(endian==0 && c2[0]==0) { /*little endian*/
+            if(endian==0 && size == 12 && c2[0]==0) { /*little endian*/
                 ret = 1;
                 goto done;
             }
@@ -3684,16 +3684,16 @@ else
              * instead of 0x0000403effffffffffffffff, 0x0000403efffffffffffffffe, ..., 
              * 0x0000403efffffffffffff000 ...
              */    
-            if(endian==0 && c2_cyg[0]==0 && c2_cyg[1]==0 && c2_cyg[2]==0 && c2_cyg[3]==0)
+            if(endian==0 && size == 12 && c2_cyg[0]==0 && c2_cyg[1]==0 && c2_cyg[2]==0 && c2_cyg[3]==0)
                 ret = 1;
 
+            if(c2_cyg)
+                free(c2_cyg);
     done:
             if(c1)
                 free(c1);
             if(c2)
                 free(c2);
-            if(c2_cyg)
-                free(c2_cyg);
             exit(ret);
         }
         ], [hdf5_cv_ullong_to_ldouble_precision=yes], [hdf5_cv_ullong_to_ldouble_precision=no],)])