[pure-lang-svn] SF.net SVN: pure-lang:[717] pure/trunk
Status: Beta
Brought to you by:
agraef
From: <ag...@us...> - 2008-09-05 11:13:27
|
Revision: 717 http://pure-lang.svn.sourceforge.net/pure-lang/?rev=717&view=rev Author: agraef Date: 2008-09-05 11:13:38 +0000 (Fri, 05 Sep 2008) Log Message: ----------- Add configure checks for POSIX/ISOC99 complex types. Modified Paths: -------------- pure/trunk/ChangeLog pure/trunk/config.h.in pure/trunk/configure pure/trunk/configure.ac pure/trunk/runtime.cc Modified: pure/trunk/ChangeLog =================================================================== --- pure/trunk/ChangeLog 2008-09-05 11:08:32 UTC (rev 716) +++ pure/trunk/ChangeLog 2008-09-05 11:13:38 UTC (rev 717) @@ -1,5 +1,8 @@ 2008-09-05 Albert Graef <Dr....@t-...> + * configure.ac, runtime.cc (pure_sys_vars): Add configure checks + for POSIX/ISOC99 complex types. (Requires reconfigure.) + * runtime.cc (pure_force): Fix a rather obscure segfault in the thunk implementation. See also test/test023.pure. Modified: pure/trunk/config.h.in =================================================================== --- pure/trunk/config.h.in 2008-09-05 11:08:32 UTC (rev 716) +++ pure/trunk/config.h.in 2008-09-05 11:13:38 UTC (rev 717) @@ -78,6 +78,12 @@ /* Define to 1 if you have the `usleep' function. */ #undef HAVE_USLEEP +/* Define to 1 if the system has the type `_Complex double'. */ +#undef HAVE__COMPLEX_DOUBLE + +/* Define to 1 if the system has the type `_Complex float'. */ +#undef HAVE__COMPLEX_FLOAT + /* Define to the name of the host system. */ #undef HOST Modified: pure/trunk/configure =================================================================== --- pure/trunk/configure 2008-09-05 11:08:32 UTC (rev 716) +++ pure/trunk/configure 2008-09-05 11:13:38 UTC (rev 717) @@ -5472,6 +5472,129 @@ fi done +{ echo "$as_me:$LINENO: checking for _Complex float" >&5 +echo $ECHO_N "checking for _Complex float... $ECHO_C" >&6; } +if test "${ac_cv_type__Complex_float+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +typedef _Complex float ac__type_new_; +int +main () +{ +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_type__Complex_float=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type__Complex_float=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_type__Complex_float" >&5 +echo "${ECHO_T}$ac_cv_type__Complex_float" >&6; } +if test $ac_cv_type__Complex_float = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE__COMPLEX_FLOAT 1 +_ACEOF + + +fi +{ echo "$as_me:$LINENO: checking for _Complex double" >&5 +echo $ECHO_N "checking for _Complex double... $ECHO_C" >&6; } +if test "${ac_cv_type__Complex_double+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +typedef _Complex double ac__type_new_; +int +main () +{ +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_type__Complex_double=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type__Complex_double=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_type__Complex_double" >&5 +echo "${ECHO_T}$ac_cv_type__Complex_double" >&6; } +if test $ac_cv_type__Complex_double = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE__COMPLEX_DOUBLE 1 +_ACEOF + + +fi + ac_config_files="$ac_config_files Makefile" cat >confcache <<\_ACEOF Modified: pure/trunk/configure.ac =================================================================== --- pure/trunk/configure.ac 2008-09-05 11:08:32 UTC (rev 716) +++ pure/trunk/configure.ac 2008-09-05 11:13:38 UTC (rev 717) @@ -91,6 +91,8 @@ AC_FUNC_ALLOCA dnl Platform-dependent time functions. AC_CHECK_FUNCS(ftime gettimeofday nanosleep usleep) +dnl Check to see whether we have POSIX/ISOC99 complex numbers. +AC_CHECK_TYPES([_Complex float, _Complex double]) AC_CONFIG_FILES([Makefile]) AC_OUTPUT Modified: pure/trunk/runtime.cc =================================================================== --- pure/trunk/runtime.cc 2008-09-05 11:08:32 UTC (rev 716) +++ pure/trunk/runtime.cc 2008-09-05 11:13:38 UTC (rev 717) @@ -3263,8 +3263,12 @@ cdf(interp, "SIZEOF_LONG_LONG", pure_int(sizeof(long long))); cdf(interp, "SIZEOF_FLOAT", pure_int(sizeof(float))); cdf(interp, "SIZEOF_DOUBLE", pure_int(sizeof(double))); +#ifdef HAVE__COMPLEX_FLOAT cdf(interp, "SIZEOF_COMPLEX_FLOAT", pure_int(sizeof(_Complex float))); +#endif +#ifdef HAVE__COMPLEX_DOUBLE cdf(interp, "SIZEOF_COMPLEX_DOUBLE", pure_int(sizeof(_Complex double))); +#endif cdf(interp, "SIZEOF_POINTER", pure_int(sizeof(void*))); // clock cdf(interp, "CLOCKS_PER_SEC", pure_int(CLOCKS_PER_SEC)); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |