diff --git a/configure.ac b/configure.ac index 7f0c3b98a..bd1260b2a 100644 --- a/configure.ac +++ b/configure.ac @@ -1752,19 +1752,6 @@ if test "$mercury_cv_int_least64_type" != unknown; then AC_DEFINE_UNQUOTED(MR_INT_LEAST64_TYPE, $mercury_cv_int_least64_type) MR_INT_LEAST64_TYPE=$mercury_cv_int_least64_type AC_SUBST(MR_INT_LEAST64_TYPE) - - if test "$mercury_cv_int_least64_type" = int; then - AC_DEFINE_UNQUOTED(MR_INT_LEAST64_LENGTH_MODIFIER, "") - elif test "$mercury_cv_int_least64_type" = long; then - AC_DEFINE_UNQUOTED(MR_INT_LEAST64_LENGTH_MODIFIER, "l") - elif test "$mercury_cv_int_least64_type" = "long long"; then - AC_DEFINE_UNQUOTED(MR_INT_LEAST64_LENGTH_MODIFIER, "ll") - elif test "$mercury_cv_int_least64_type" = "__int64"; then - AC_DEFINE_UNQUOTED(MR_INT_LEAST64_LENGTH_MODIFIER, "I64") - else - AC_MSG_ERROR(Cannot determine the length modifier for the MR_int_least64_t type.) - fi - AC_SUBST(MR_INT_LEAST64_LENGTH_MODIFIER) fi #-----------------------------------------------------------------------------# diff --git a/library/float.m b/library/float.m index 72dabff96..bd0bd383b 100644 --- a/library/float.m +++ b/library/float.m @@ -348,12 +348,9 @@ :- import_module exception. :- import_module int. -% -% Header files of mathematical significance. -% - :- pragma foreign_decl("C", " #include + #include #include #ifdef MR_HAVE_IEEEFP_H @@ -1166,7 +1163,7 @@ float_to_doc(F) = pretty_printer.float_to_doc(F). :- pragma foreign_proc("C", float32_bits_string(Flt::in) = (Str::uo), - [will_not_call_mercury, promise_pure, thread_safe], + [will_not_call_mercury, promise_pure, thread_safe, may_not_export_body], " union { float f; @@ -1181,7 +1178,7 @@ float_to_doc(F) = pretty_printer.float_to_doc(F). :- pragma foreign_proc("Java", float32_bits_string(Flt::in) = (Str::uo), - [will_not_call_mercury, promise_pure, thread_safe], + [will_not_call_mercury, promise_pure, thread_safe, may_not_export_body], " float f = (float) Flt; int i = Float.floatToIntBits(f); @@ -1190,7 +1187,7 @@ float_to_doc(F) = pretty_printer.float_to_doc(F). :- pragma foreign_proc("C#", float32_bits_string(Flt::in) = (Str::uo), - [will_not_call_mercury, promise_pure, thread_safe], + [will_not_call_mercury, promise_pure, thread_safe, may_not_export_body], " float f = (float) Flt; int i = System.BitConverter.ToInt32(System.BitConverter.GetBytes(f), 0); @@ -1199,7 +1196,7 @@ float_to_doc(F) = pretty_printer.float_to_doc(F). :- pragma foreign_proc("C", float64_bits_string(Flt::in) = (Str::uo), - [will_not_call_mercury, promise_pure, thread_safe], + [will_not_call_mercury, promise_pure, thread_safe, may_not_export_body], " #if defined(MR_INT_LEAST64_TYPE) @@ -1210,7 +1207,7 @@ float_to_doc(F) = pretty_printer.float_to_doc(F). char buf[64]; u.f = (double) Flt; - sprintf(buf, ""%"" MR_INT_LEAST64_LENGTH_MODIFIER ""d"", u.i); + sprintf(buf, ""%"" PRIdLEAST64, u.i); MR_make_aligned_string_copy(Str, buf); #else MR_fatal_error( @@ -1220,7 +1217,7 @@ float_to_doc(F) = pretty_printer.float_to_doc(F). :- pragma foreign_proc("Java", float64_bits_string(Flt::in) = (Str::uo), - [will_not_call_mercury, promise_pure, thread_safe], + [will_not_call_mercury, promise_pure, thread_safe, may_not_export_body], " double d = (double) Flt; long i = Double.doubleToLongBits(d); @@ -1229,7 +1226,7 @@ float_to_doc(F) = pretty_printer.float_to_doc(F). :- pragma foreign_proc("C#", float64_bits_string(Flt::in) = (Str::uo), - [will_not_call_mercury, promise_pure, thread_safe], + [will_not_call_mercury, promise_pure, thread_safe, may_not_export_body], " double d = (double) Flt; long i = System.BitConverter.DoubleToInt64Bits(d); diff --git a/runtime/mercury_conf.h.in b/runtime/mercury_conf.h.in index b847ffce1..168f9bcc5 100644 --- a/runtime/mercury_conf.h.in +++ b/runtime/mercury_conf.h.in @@ -67,11 +67,6 @@ #undef MR_INT_LEAST64_TYPE -// MR_INT_LEAST64_LENGTH_MODIFIER: the print() length modifier for -// a MR_int_least64_t. - -#undef MR_INT_LEAST64_LENGTH_MODIFIER - // MR_INT_LEAST32_TYPE: // This must be a C integral type (e.g. short, int, long) // without any explicit signedness. diff --git a/runtime/mercury_types.h b/runtime/mercury_types.h index 11085e550..85ae23c91 100644 --- a/runtime/mercury_types.h +++ b/runtime/mercury_types.h @@ -44,11 +44,13 @@ #endif // This section defines types similar to C9X's header. -// We do not use , or the or files -// that substitute for it on some systems because (a) some such files -// do not define the types we need, and (b) some such files include -// inline function definitions. The latter is a problem because we want to -// reserve some real machine registers for Mercury abstract machine registers. +// Historically, we did not use , or the or +// files that substitute for it on some systems because +// (a) some such files do not define the types we need, and +// (b) some such files include inline function definitions. +// While the former reason is very much out of date, +// the latter may still be a problem because we want to reserve some +// real machine registers for Mercury abstract machine registers. // To be effective, the definitions of these global register variables // must precede all function definitions, and we want to put their // definitions after mercury_types.h.