[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libmicrohttpd] 220/335: configure: added tests for supported enum attri
From: |
gnunet |
Subject: |
[libmicrohttpd] 220/335: configure: added tests for supported enum attributes |
Date: |
Sat, 27 Jul 2024 22:01:56 +0200 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to tag stf-m2
in repository libmicrohttpd.
commit c48a9a4112ebb2de2a9a42d0d85f044a662486ec
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Fri Jun 21 14:32:28 2024 +0200
configure: added tests for supported enum attributes
---
configure.ac | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 64 insertions(+)
diff --git a/configure.ac b/configure.ac
index 7a6534eb..bb27aac8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3928,6 +3928,70 @@ int main(void) {return test_intern_func();}
)
]
)
+CFLAGS="${CFLAGS_ac} ${user_CFLAGS} ${errattr_CFLAGS}"
+AC_CACHE_CHECK([whether $CC supports __attribute__((enum_extensibility
(closed)))],[mhd_cv_cc_attr_enum_extns_closed],
+ [
+ SAVE_ac_c_werror_flag="$ac_c_werror_flag"
+ ac_c_werror_flag="yes"
+ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
+enum __attribute__((enum_extensibility (closed))) Test_Enum
+{Val_A = 0, Val_B = 3};
+
+int main(void)
+{
+ enum Test_Enum var = Val_A;
+ return (var != Val_B) ? 0 : 3;
+}
+ ]])
+ ],
+
[mhd_cv_cc_attr_enum_extns_closed="yes"],[mhd_cv_cc_attr_enum_extns_closed="no"]
+ )
+ ac_c_werror_flag="$SAVE_ac_c_werror_flag"
+ AS_UNSET([SAVE_ac_c_werror_flag])
+ ]
+)
+AS_VAR_IF([mhd_cv_cc_attr_enum_extns_closed],["yes"],
+ [
+ AC_DEFINE([HAVE_ATTR_ENUM_EXTNS_CLOSED],[1],
+ [Define to '1' if your compiler supports
__attribute__((enum_extensibility (closed)))]
+ )
+ ]
+)
+AC_CACHE_CHECK([whether $CC supports
__attribute__((flag_enum))],[mhd_cv_cc_attr_flag_enum],
+ [
+ SAVE_ac_c_werror_flag="$ac_c_werror_flag"
+ ac_c_werror_flag="yes"
+ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
+#ifdef HAVE_ATTR_ENUM_EXTNS_CLOSED
+#define ATTR_EXTNS_CLOSED_IF_SUPPORTED __attribute__((enum_extensibility
(closed)))
+#else
+#define ATTR_EXTNS_CLOSED_IF_SUPPORTED /* empty */
+#endif
+enum ATTR_EXTNS_CLOSED_IF_SUPPORTED __attribute__((flag_enum)) Test_Enum
+{Flag_A = 1 << 0, Flag_B = 1 << 1, Flag_C = 1 << 2, Flag_D = 1 << 3};
+
+int main(void)
+{
+ enum Test_Enum var = Flag_A;
+ var |= Flag_C;
+ var = var | Flag_D | Flag_A;
+ return (var != Flag_B) ? 0 : 3;
+}
+ ]])
+ ],
+ [mhd_cv_cc_attr_flag_enum="yes"],[mhd_cv_cc_attr_flag_enum="no"]
+ )
+ ac_c_werror_flag="$SAVE_ac_c_werror_flag"
+ AS_UNSET([SAVE_ac_c_werror_flag])
+ ]
+)
+AS_VAR_IF([mhd_cv_cc_attr_flag_enum],["yes"],
+ [
+ AC_DEFINE([HAVE_ATTR_FLAG_ENUM],[1],
+ [Define to '1' if your compiler supports __attribute__((flag_enum))]
+ )
+ ]
+)
CFLAGS="${CFLAGS_ac} ${user_CFLAGS}"
# libcurl (required for testing)
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [libmicrohttpd] 189/335: GENERATED: use correct function attributes, (continued)
- [libmicrohttpd] 189/335: GENERATED: use correct function attributes, gnunet, 2024/07/27
- [libmicrohttpd] 205/335: configure: supported C23 'noreturn' keyword, gnunet, 2024/07/27
- [libmicrohttpd] 215/335: configure: added support for 'restrict', gnunet, 2024/07/27
- [libmicrohttpd] 226/335: -fix typo, gnunet, 2024/07/27
- [libmicrohttpd] 223/335: Initial draft M2 (WIP), gnunet, 2024/07/27
- [libmicrohttpd] 216/335: configure: added tests for 'unreachable' supported keywords, gnunet, 2024/07/27
- [libmicrohttpd] 217/335: configure: added checks for socketpair(), gnunet, 2024/07/27
- [libmicrohttpd] 209/335: this_API_is_TERRIBLE.txt: updated, gnunet, 2024/07/27
- [libmicrohttpd] 230/335: w32_lib_res.rc.in: fixed, gnunet, 2024/07/27
- [libmicrohttpd] 229/335: Partial revert of 7237eb207b6dd215c5b726ed4b2a1e337cc4dbcc, gnunet, 2024/07/27
- [libmicrohttpd] 220/335: configure: added tests for supported enum attributes,
gnunet <=
- [libmicrohttpd] 203/335: configure: check for more network/sockets headers, gnunet, 2024/07/27
- [libmicrohttpd] 232/335: -fix build error: SO_ERROR on some platforms, gnunet, 2024/07/27
- [libmicrohttpd] 221/335: GENERATED: more edits, gnunet, 2024/07/27
- [libmicrohttpd] 227/335: -fix typo, gnunet, 2024/07/27
- [libmicrohttpd] 228/335: -fix typo, gnunet, 2024/07/27
- [libmicrohttpd] 207/335: Renamed sys_socket_types.h -> sys_sockets_types.h, gnunet, 2024/07/27
- [libmicrohttpd] 234/335: Follow-up for 631d550d6ed81be0ebd5a06e107868e5153da430, gnunet, 2024/07/27
- [libmicrohttpd] 238/335: More portability, gnunet, 2024/07/27
- [libmicrohttpd] 212/335: configure: check for uintptr_t type, gnunet, 2024/07/27
- [libmicrohttpd] 214/335: configure: added check for various levels of compound literals support, gnunet, 2024/07/27