]> www.ginac.de Git - cln.git/commitdiff
64-bit mingw port: Fix undefined references to cl_I_constructor_from_[U]L.
authorBruno Haible <bruno@clisp.org>
Sun, 27 Oct 2019 18:47:07 +0000 (19:47 +0100)
committerBruno Haible <bruno@clisp.org>
Sun, 27 Oct 2019 18:47:07 +0000 (19:47 +0100)
src/integer/conv/cl_I_from_L.cc
src/integer/conv/cl_I_from_UL.cc

index efc6887137cef8e600277aa97ff70cd95783b913..bf1af070b65bf883110a59ff671b940d930ae4cf 100644 (file)
@@ -11,7 +11,7 @@
 
 #include "cln/number.h"
 
-#if (cl_value_len < 32)
+#if (cl_value_len < 32) || (long_bitsize==32)
 
 #include "base/digitseq/cl_DS.h"
 
@@ -19,6 +19,7 @@ namespace cln {
 
 cl_private_thing cl_I_constructor_from_L (sint32 wert)
 {
+#if (cl_value_len < 32)
        var uint32 test = wert & minus_bit(cl_value_len-1);
        // test enthält die Bits, die nicht in den Fixnum-Wert >= 0 reinpassen.
        if ((test == 0) || (test == (uint32)minus_bit(cl_value_len-1)))
@@ -109,6 +110,10 @@ cl_private_thing cl_I_constructor_from_L (sint32 wert)
        }
        #endif
        NOTREACHED
+#else // cl_value_len >= 32
+       // All bits fit in a fixnum value.
+       return (cl_private_thing)(cl_combine(cl_FN_tag,wert));
+#endif
 }
 
 }  // namespace cln
index 16715704a1da868f7df96d765e3fbaec0bc2bdf1..be95e46a7b5d55797e8b2d0861eb5f6147daeab6 100644 (file)
@@ -11,7 +11,7 @@
 
 #include "cln/number.h"
 
-#if (cl_value_len <= 32)
+#if (cl_value_len <= 32) || (long_bitsize==32)
 
 #include "base/digitseq/cl_DS.h"
 
@@ -19,6 +19,7 @@ namespace cln {
 
 cl_private_thing cl_I_constructor_from_UL (uint32 wert)
 {
+#if (cl_value_len <= 32)
        if ((wert & minus_bit(cl_value_len-1)) == 0)
           // Bits, die nicht in den Fixnum-Wert >= 0 reinpassen.
                return (cl_private_thing)(cl_combine(cl_FN_tag,wert));
@@ -89,6 +90,10 @@ cl_private_thing cl_I_constructor_from_UL (uint32 wert)
        #endif
        #undef IF_LENGTH
        #undef UL_maxlength
+#else // cl_value_len > 32
+       // All bits fit in a fixnum value >= 0.
+       return (cl_private_thing)(cl_combine(cl_FN_tag,wert));
+#endif
 }
 
 }  // namespace cln