ostream and long long

Andris Pavenis andris@hal.astr.lu.lv
Thu Jul 26 09:15:00 GMT 2001


On 26 Jul 2001, Gabriel Dos Reis wrote:

> Andris Pavenis <andris@hal.astr.lu.lv> writes:
>
> | On 26 Jul 2001, Gabriel Dos Reis wrote:
> |
> | > Andris Pavenis <andris@hal.astr.lu.lv> writes:
> | >
> | > | > If --enable-long-long, then the accompanying C99 mathematical
> | > | > functions should be availble for long long support.  They are not
> | > | > unreleated.
> | > | >
> | > |
> | > | Do we really need sqrtf(), sqrtl(), sinl() and similar functions to
> | > | support long long? I think the best would be to check for functions
> | > | we really need for --enable-long-long instead of disabling it
> | > | if at least one of functions added with c99 is missing
> | >
> | > We did similar things in the past.  Please check the archive for
> | > the numerous complains and discussions about configure time & checking
> | > separately for truly minimal subsets.
> | >
> |
> | I think it's not so complicate.
>
> Nobody said it is complicate -- it was even done in the past.
>
> Did you read the archive?

Perhaps begin of next week when I'll return home (I'm awaty now for
almost 2 weeks)

>
> |  (I think one will not feel any difference).
>
> Experience shows the contrary.  Again see the archive.
>

Here is rough draft of what I'm going to do for DJGPP (I patched file
directly before leaving, but didn't have time for carefull testing, so
also after returning ...)

Andris

--- acinclude.m4~1	Thu Jul 26 19:07:37 2001
+++ acinclude.m4	Thu Jul 26 19:07:33 2001
@@ -1306,6 +1306,7 @@

   # Check for the existence in <stdlib.h> of lldiv_t, et. al.
   ac_c99_stdlib=yes;
+  ac_supports_long_long=yes;
   AC_MSG_CHECKING([for lldiv_t declaration])
   AC_CACHE_VAL(ac_c99_lldiv_t, [
   AC_TRY_COMPILE([#include <stdlib.h>],
@@ -1320,12 +1321,12 @@
   AC_TRY_COMPILE([#include <stdlib.h>],
 	         [char* tmp; strtold("gnu", &tmp);],, [ac_c99_stdlib=no])
   AC_TRY_COMPILE([#include <stdlib.h>],
-	         [char* tmp; strtoll("gnu", &tmp, 10);],, [ac_c99_stdlib=no])
+	         [char* tmp; strtoll("gnu", &tmp, 10);],, [ac_c99_stdlib=no; ac_supports_long_long=no])
   AC_TRY_COMPILE([#include <stdlib.h>],
-	         [char* tmp; strtoull("gnu", &tmp, 10);],, [ac_c99_stdlib=no])
-  AC_TRY_COMPILE([#include <stdlib.h>], [llabs(10);],, [ac_c99_stdlib=no])
-  AC_TRY_COMPILE([#include <stdlib.h>], [lldiv(10,1);],, [ac_c99_stdlib=no])
-  AC_TRY_COMPILE([#include <stdlib.h>], [atoll("10");],, [ac_c99_stdlib=no])
+	         [char* tmp; strtoull("gnu", &tmp, 10);],, [ac_c99_stdlib=no; ac_supports_long_long=yes])
+  AC_TRY_COMPILE([#include <stdlib.h>], [llabs(10);],, [ac_c99_stdlib=no; ac_supports_long_long=yes])
+  AC_TRY_COMPILE([#include <stdlib.h>], [lldiv(10,1);],, [ac_c99_stdlib=no; ac_supports_long_long=yes])
+  AC_TRY_COMPILE([#include <stdlib.h>], [atoll("10");],, [ac_c99_stdlib=no; ac_supports_long_long=yes])
   AC_TRY_COMPILE([#include <stdlib.h>], [_Exit(0);],, [ac_c99_stdlib=no])
   if test x"$ac_c99_lldiv_t" = x"no"; then
     ac_c99_stdlib=no;
@@ -1391,7 +1392,7 @@
   # iostreams require strtoll, strtoull to compile. If the
   # GLIBCPP_ENABLE_C99 tests found these, and if C99 support is enabled,
   # go ahead and allow long long to be used.
-  if test x"$enable_c99" = x"no"; then
+  if ! test x"$ac_supports_long_long" = x"yes"; then
     enable_long_long=no;
   fi




More information about the Gcc-bugs mailing list