diff options
author | Scott Wegner <swegner@hdfgroup.org> | 2008-09-17 14:04:35 (GMT) |
---|---|---|
committer | Scott Wegner <swegner@hdfgroup.org> | 2008-09-17 14:04:35 (GMT) |
commit | 036aa878b0c167e4c39a290a75b5dc241ac4f218 (patch) | |
tree | 1d1cc1def6d68befff2515ae2f7a59d540fd3093 /configure | |
parent | 95149cc0957dd05585388c8d8532d84269bf0075 (diff) | |
download | hdf5-036aa878b0c167e4c39a290a75b5dc241ac4f218.zip hdf5-036aa878b0c167e4c39a290a75b5dc241ac4f218.tar.gz hdf5-036aa878b0c167e4c39a290a75b5dc241ac4f218.tar.bz2 |
[svn-r15639] Purpose: Check for __func__ keyword during configure
Description:
In some of the new H5EA* code, many new C99 features are being used. Most of them are portable to all compilers, but the __func__ keyword in particular isn't supported in Visual Studio on Windows. Instead, Windows defines the __FUNCTION__ keyword, which can be used as a direct substitute.
We now check for the __func__ keyword during configure and define the feature flag H5_HAVE_C99_FUNC. There was previously a check for __FUNCTION__, and the feature flags H5_HAVE_FUNCTION. In H5EApkg.h, we check for the presents of each of these in order to see which to use. If neither are avaiable, fail.
Tested:
h5committest (kagiso, smirom, linew)
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 60 |
1 files changed, 59 insertions, 1 deletions
@@ -46356,6 +46356,64 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: checking for __func__ extension" >&5 +echo $ECHO_N "checking for __func__ extension... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#ifdef FC_DUMMY_MAIN +#ifndef FC_DUMMY_MAIN_EQ_F77 +# ifdef __cplusplus + extern "C" +# endif + int FC_DUMMY_MAIN() { return 1; } +#endif +#endif +int +main () +{ + const char *fname = __func__; + ; + 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 + +cat >>confdefs.h <<\_ACEOF +#define HAVE_C99_FUNC 1 +_ACEOF + + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: checking for __FUNCTION__ extension" >&5 echo $ECHO_N "checking for __FUNCTION__ extension... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF @@ -46376,7 +46434,7 @@ cat >>conftest.$ac_ext <<_ACEOF int main () { -(void)__FUNCTION__ + const char *fname = __FUNCTION__; ; return 0; } |