Building for Android

Marc Glisse marc.glisse at inria.fr
Wed Jun 26 20:18:24 CEST 2013


(now with the patch...)

On Wed, 26 Jun 2013, Marc Glisse wrote:

> On Wed, 26 Jun 2013, Marc Glisse wrote:
>
>> I am not sure how GMP_DECIMAL_POINT works on android. I don't think they 
>> have nl_langinfo and, since they have a placeholder localeconv, gmp-impl.h 
>> should end up using it, but apparently it doesn't. Maybe the configure test 
>> doesn't link and thus decides that localeconv is absent? That would 
>> simplify things as my new macro becomes unnecessary.
>
> That would be the attached patch. Not sure about the testsuite part (am I 
> making the test useless or not?), but the library part seems rather obvious.

-- 
Marc Glisse
-------------- next part --------------
diff -r 53d1f20e8169 cxx/ismpf.cc
--- a/cxx/ismpf.cc	Wed Jun 19 17:25:56 2013 +0200
+++ b/cxx/ismpf.cc	Wed Jun 26 20:11:08 2013 +0200
@@ -45,7 +45,7 @@
   bool ok = false;
 
   // C decimal point, as expected by mpf_set_str
-  const char *lconv_point = localeconv()->decimal_point;
+  const char *lconv_point = GMP_DECIMAL_POINT;
 
   // C++ decimal point
 #if HAVE_STD__LOCALE
diff -r 53d1f20e8169 cxx/osmpf.cc
--- a/cxx/osmpf.cc	Wed Jun 19 17:25:56 2013 +0200
+++ b/cxx/osmpf.cc	Wed Jun 26 20:11:08 2013 +0200
@@ -47,7 +47,7 @@
   point[0] = use_facet< numpunct<char> >(o.getloc()).decimal_point();
   point[1] = '\0';
 #else
-  const char *point = localeconv()->decimal_point;
+  const char *point = GMP_DECIMAL_POINT;
 #endif
 
   GMP_ASPRINTF_T_INIT (d, &result);
diff -r 53d1f20e8169 tests/cxx/t-locale.cc
--- a/tests/cxx/t-locale.cc	Wed Jun 19 17:25:56 2013 +0200
+++ b/tests/cxx/t-locale.cc	Wed Jun 26 20:11:08 2013 +0200
@@ -105,7 +105,7 @@
                   cout << "  point " << point[i] << "\n";
                   cout << "  str   \"" << str << "\"\n";
                   cout << "  localeconv point \""
-                       << localeconv()->decimal_point << "\"\n";
+                       << GMP_DECIMAL_POINT << "\"\n";
                   abort ();
                 }
 
@@ -120,7 +120,7 @@
                   cout << "  got   " << got << "\n";
                   cout << "  want  " << want << "\n";
                   cout << "  localeconv point \""
-                       << localeconv()->decimal_point << "\"\n";
+                       << GMP_DECIMAL_POINT << "\"\n";
                   abort ();
                 }
             }


More information about the gmp-discuss mailing list