From 408c678f4d5f4051893fef94b86b4b10692de561 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sat, 10 Apr 2021 13:55:11 +0300 Subject: [PATCH 47/47] Move FC_C99_INITIALIZER_BRACES to tcc.m4 named as FC_INITIALIZERS_BRACES It exist for tcc support. See osdn #41947 Signed-off-by: Marko Lindqvist --- configure.ac | 2 +- m4/c99.m4 | 37 ------------------------------------- m4/tcc.m4 | 37 +++++++++++++++++++++++++++++++++++++ 3 files changed, 38 insertions(+), 38 deletions(-) diff --git a/configure.ac b/configure.ac index 9bcc6d2f4e..99db745f7a 100644 --- a/configure.ac +++ b/configure.ac @@ -687,7 +687,7 @@ fi FC_C99_INITIALIZERS FC_C99_STDINT_H -FC_C99_INITIALIZER_BRACES +FC_INITIALIZER_BRACES FC_C11_STATIC_ASSERT FC_C11_AT_QUICK_EXIT diff --git a/m4/c99.m4 b/m4/c99.m4 index 158ac730bb..163872a460 100644 --- a/m4/c99.m4 +++ b/m4/c99.m4 @@ -79,40 +79,3 @@ AC_CACHE_CHECK([whether preprocessor token concenation works], AC_MSG_ERROR([A preprocessor supporting token concenation is required]) fi ]) - -# Whether C99-style initializers of a struct can, or even must, be -# within braces. -# Sets macros INIT_BRACE_BEGIN and INIT_BRACE_END accordingly. -# -AC_DEFUN([FC_C99_INITIALIZER_BRACES], -[ -AC_CACHE_CHECK([can struct initializers be within braces], - [ac_cv_c99_initializer_braces], - [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], - [[ -struct outer -{ - int v1; - int v2; - union - { - int v3; - struct - { - int v4; - int v5; - } inner; - }; -}; - - struct outer init_me = { 1, 2, { .inner = { 3, 4 }}} -]])], - [ac_cv_c99_initializer_braces=yes], [ac_cv_c99_initializer_braces=no])]) - if test "x${ac_cv_c99_initializer_braces}" = "xyes" ; then - AC_DEFINE([INIT_BRACE_BEGIN], [{], [Beginning of C99 structure initializer]) - AC_DEFINE([INIT_BRACE_END], [}], [End of C99 structure initializer]) - else - AC_DEFINE([INIT_BRACE_BEGIN], [], [Beginning of C99 structure initializer]) - AC_DEFINE([INIT_BRACE_END], [], [End of C99 structure initializer]) - fi -]) diff --git a/m4/tcc.m4 b/m4/tcc.m4 index 3126f45568..5170e72c9f 100644 --- a/m4/tcc.m4 +++ b/m4/tcc.m4 @@ -23,3 +23,40 @@ AC_MSG_RESULT([unknown])])])]) AC_DEFINE([FREECIV_RETURN_VALUE_AFTER_EXIT], [1], [[Value must be returned even after exit()]]) fi ]) + +# Whether C99-style initializers of a struct can, or even must, be +# within braces. +# Sets macros INIT_BRACE_BEGIN and INIT_BRACE_END accordingly. +# +AC_DEFUN([FC_INITIALIZER_BRACES], +[ +AC_CACHE_CHECK([can struct initializers be within braces], + [ac_cv_c99_initializer_braces], + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], + [[ +struct outer +{ + int v1; + int v2; + union + { + int v3; + struct + { + int v4; + int v5; + } inner; + }; +}; + + struct outer init_me = { 1, 2, { .inner = { 3, 4 }}} +]])], + [ac_cv_c99_initializer_braces=yes], [ac_cv_c99_initializer_braces=no])]) + if test "x${ac_cv_c99_initializer_braces}" = "xyes" ; then + AC_DEFINE([INIT_BRACE_BEGIN], [{], [Beginning of C99 structure initializer]) + AC_DEFINE([INIT_BRACE_END], [}], [End of C99 structure initializer]) + else + AC_DEFINE([INIT_BRACE_BEGIN], [], [Beginning of C99 structure initializer]) + AC_DEFINE([INIT_BRACE_END], [], [End of C99 structure initializer]) + fi +]) -- 2.30.2