diff --git a/glib/gnulib/frexpl.c b/glib/gnulib/frexpl.c index 5736dc848..cd6a81c77 100644 --- a/glib/gnulib/frexpl.c +++ b/glib/gnulib/frexpl.c @@ -14,6 +14,8 @@ long double rpl_frexpl (long double x, int *expptr) return x; else if (isinf (x)) return x; +#ifndef _MSC_VER #undef frexpl +#endif return frexpl (x, expptr); } diff --git a/glib/gnulib/gl_cv_func_frexpl_works/meson.build b/glib/gnulib/gl_cv_func_frexpl_works/meson.build index c37b741db..303ec63d7 100644 --- a/glib/gnulib/gl_cv_func_frexpl_works/meson.build +++ b/glib/gnulib/gl_cv_func_frexpl_works/meson.build @@ -29,7 +29,11 @@ extern #ifdef __cplusplus "C" #endif + +#if !defined (_MSC_VER) || defined (TEST_FREXPL_DECL) long double frexpl (long double, int *); +#endif + int main() { int result = 0; @@ -128,3 +132,11 @@ else gl_cv_func_frexpl_broken_beyond_repair = false endif endif + +frexpl_test_decl = ''' +#define TEST_FREXPL_DECL 1 +''' + frexpl_test + +build_result = cc.compiles(frexpl_test_decl, + name : 'frexpl prototype can be re-listed') +gl_cv_func_frexpl_decl = build_result diff --git a/glib/gnulib/gl_cv_func_ldexpl_works/meson.build b/glib/gnulib/gl_cv_func_ldexpl_works/meson.build index dc83675ed..ae176cb8e 100644 --- a/glib/gnulib/gl_cv_func_ldexpl_works/meson.build +++ b/glib/gnulib/gl_cv_func_ldexpl_works/meson.build @@ -9,7 +9,11 @@ extern #ifdef __cplusplus "C" #endif + +#if !defined (_MSC_VER) || defined (TEST_LDEXPL_DECL) long double ldexpl (long double, int); +#endif + int main() { int result = 0; @@ -43,3 +47,11 @@ else gl_cv_func_ldexpl_works = true endif endif + +ldexpl_test_decl = ''' +#define TEST_LDEXPL_DECL 1 +''' + ldexpl_test + +build_result = cc.compiles(ldexpl_test_decl, + name : 'ldexpl prototype can be re-listed') +gl_cv_func_ldexpl_decl = build_result diff --git a/glib/gnulib/meson.build b/glib/gnulib/meson.build index 60499d9b7..2d369a6ef 100644 --- a/glib/gnulib/meson.build +++ b/glib/gnulib/meson.build @@ -282,6 +282,7 @@ endif math_h_config.set ('REPLACE_FREXP', gl_cv_func_frexp_works ? 0 : 1) math_h_config.set ('REPLACE_FREXPL', gl_cv_func_frexpl_works ? 0 : 1) +math_h_config.set ('HAVE_DECL_FREXPL', gl_cv_func_frexpl_decl ? 0 : 1) math_h_config.set ('REPLACE_ITOLD', 0) math_h_config.set ('REPLACE_HUGE_VAL', 0) @@ -293,6 +294,7 @@ else gl_cv_func_ldexpl_works = false endif math_h_config.set ('REPLACE_LDEXPL', gl_cv_func_ldexpl_works ? 0 : 1) +math_h_config.set ('HAVE_DECL_LDEXPL', gl_cv_func_ldexpl_decl ? 0 : 1) math_h = configure_file (input: 'gnulib_math.h.in', output: 'gnulib_math.h',