This is the mail archive of the libstdc++@sources.redhat.com mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: long double and GLIBCPP_CHECK_MATH_SUPPORT


2000-10-26  David Edelsohn  <edelsohn@gnu.org>

	* acinclude.m4 (GLIBCPP_CHECK_STDLIB_DECL_AND_LINKAGE_2): New macro.
	(GLIBCPP_CHECK_MATH_SUPPORT): Use it to test for strtold.

Index: acinclude.m4
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/acinclude.m4,v
retrieving revision 1.72
diff -c -p -r1.72 acinclude.m4
*** acinclude.m4	2000/10/26 14:56:03	1.72
--- acinclude.m4	2000/10/26 19:52:28
*************** AC_DEFUN(GLIBCPP_CHECK_MATH_DECL_AND_LIN
*** 394,399 ****
--- 394,428 ----
  
  
  dnl
+ dnl Check to see if the (stdlib function) argument passed is
+ dnl 1) declared when using the c++ compiler
+ dnl 2) has "C" linkage
+ dnl
+ dnl Define HAVE_STRTOLD if "strtold" is declared and links
+ dnl
+ dnl argument 1 is name of function to check
+ dnl
+ dnl ASSUMES argument is a math function with TWO parameters
+ dnl
+ dnl GLIBCPP_CHECK_STDLIB_DECL_AND_LINKAGE_2
+ AC_DEFUN(GLIBCPP_CHECK_STDLIB_DECL_AND_LINKAGE_2, [
+   AC_MSG_CHECKING([for $1 declaration])
+   AC_CACHE_VAL(glibcpp_cv_func_$1_use, [
+     AC_LANG_SAVE
+     AC_LANG_CPLUSPLUS
+     AC_TRY_COMPILE([#include <stdlib.h>], 
+                    [ $1(0, 0);], 
+                    [glibcpp_cv_func_$1_use=yes], [glibcpp_cv_func_$1_use=no])
+     AC_LANG_RESTORE
+   ])
+   AC_MSG_RESULT($glibcpp_cv_func_$1_use)
+   if test x$glibcpp_cv_func_$1_use = x"yes"; then
+     AC_CHECK_FUNCS($1)    
+   fi
+ ])
+ 
+ 
+ dnl
  dnl Because the builtins are picky picky picky about the arguments they take, 
  dnl do an explict linkage tests here.
  dnl Check to see if the (math function) argument passed is
*************** AC_DEFUN(GLIBCPP_CHECK_MATH_SUPPORT, [
*** 521,527 ****
    LIBS="$LIBS $libm"
  
    dnl Although not math functions, needed and for some reason checked here.
!   AC_CHECK_FUNCS(strtof strtold)
  
    dnl Check to see if certain C math functions exist.
    GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isinf)
--- 550,557 ----
    LIBS="$LIBS $libm"
  
    dnl Although not math functions, needed and for some reason checked here.
!   AC_CHECK_FUNCS(strtof)
!   GLIBCPP_CHECK_STDLIB_DECL_AND_LINKAGE_2(strtold)
  
    dnl Check to see if certain C math functions exist.
    GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isinf)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]