[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libmicrohttpd2] 09/12: Added detection and used "externally_visible" fu
From: |
Admin |
Subject: |
[libmicrohttpd2] 09/12: Added detection and used "externally_visible" function attribute |
Date: |
Fri, 06 Jun 2025 16:01:17 +0200 |
This is an automated email from the git hooks/post-receive script.
karlson2k pushed a commit to branch master
in repository libmicrohttpd2.
commit 4fb283481e04e126d68ef82fcf89f39fd256a5e9
Author: Evgeny Grin (Karlson2k) <k2k@drgrin.dev>
AuthorDate: Fri Jun 6 00:32:43 2025 +0200
Added detection and used "externally_visible" function attribute
---
configure.ac | 21 +++++++++++++++++++++
src/incl_priv/mhd_sys_options.h | 10 +++++++++-
2 files changed, 30 insertions(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index 8ec3a17..e553f09 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4259,6 +4259,27 @@ int main(void) {return test_hidden_func();}
]
)
CFLAGS="${CFLAGS_ac} ${user_CFLAGS} ${errattr_CFLAGS}"
+AC_CACHE_CHECK([whether $CC supports __attribute__
((externally_visible))],[mhd_cv_cc_attr_extern_vis],
+ [
+ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
+int test_func(void) __attribute__ ((externally_visible));
+__attribute__ ((externally_visible)) int
+test_func(void) {return 0; }
+
+int main(void) { return test_func(); }
+ ]])
+ ],
+ [mhd_cv_cc_attr_extern_vis="yes"],[mhd_cv_cc_attr_extern_vis="no"]
+ )
+ ]
+)
+AS_VAR_IF([mhd_cv_cc_attr_extern_vis],["yes"],
+ [
+ AC_DEFINE([HAVE_ATTR_EXTERN_VISIBLE],[1],
+ [Define to '1' if your compiler supports
__attribute__((externally_visible))]
+ )
+ ]
+)
AC_CACHE_CHECK([whether $CC supports __attribute__
((warn_unused_result))],[mhd_cv_cc_attr_warn_unused_res],
[
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
diff --git a/src/incl_priv/mhd_sys_options.h b/src/incl_priv/mhd_sys_options.h
index 3dbc3fd..d25ea88 100644
--- a/src/incl_priv/mhd_sys_options.h
+++ b/src/incl_priv/mhd_sys_options.h
@@ -72,6 +72,13 @@
# define MHD_EXTERN_USED /* empty */
#endif
+#if defined(HAVE_ATTR_EXTERN_VISIBLE) \
+ && (defined(PIC) || defined(DLL_EXPORT) || defined(MHD_W32DLL))
+# define mhd_EXTERNALLY_ACCESSIBLE __attribute__ ((externally_visible))
+#else
+# define mhd_EXTERNALLY_ACCESSIBLE /* empty */
+#endif
+
#if defined(MHD_EXTERN_) && defined(BUILDING_MHD_LIB)
# undef MHD_EXTERN_
#endif /* MHD_EXTERN_ && BUILDING_MHD_LIB */
@@ -80,7 +87,8 @@
# ifdef BUILDING_MHD_LIB
/* Building MHD itself */
# define MHD_EXTERN_ \
- extern MHD_VISIBILITY_EXTERN MHD_EXPORTED MHD_EXTERN_USED
+ extern MHD_VISIBILITY_EXTERN MHD_EXPORTED \
+ mhd_EXTERNALLY_ACCESSIBLE MHD_EXTERN_USED
# else /* ! BUILDING_MHD_LIB */
/* Test or example code, using MHD as a library */
# define MHD_EXTERN_ extern
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [libmicrohttpd2] branch master updated (2e6777f -> cdd4c1f), Admin, 2025/06/06
- [libmicrohttpd2] 03/12: mhd_response_check_frozen_freeze(): fixed assert, Admin, 2025/06/06
- [libmicrohttpd2] 01/12: Added missing includes for "mhd_assert.h", sorted some includes, Admin, 2025/06/06
- [libmicrohttpd2] 04/12: Improved error reporting for the listen socket creation, Admin, 2025/06/06
- [libmicrohttpd2] 06/12: mhd_stream_finish_req_serving(): minor simplification, Admin, 2025/06/06
- [libmicrohttpd2] 05/12: perf_replies: muted compiler warning, Admin, 2025/06/06
- [libmicrohttpd2] 02/12: Unified debug macro checks, Admin, 2025/06/06
- [libmicrohttpd2] 09/12: Added detection and used "externally_visible" function attribute,
Admin <=
- [libmicrohttpd2] 07/12: mhd_atomic_counter: fixed formatting, fixed single thread version build, Admin, 2025/06/06
- [libmicrohttpd2] 08/12: configure: improved test for alignof() detection, Admin, 2025/06/06
- [libmicrohttpd2] 10/12: Implemented and used counters based on atomic variables, Admin, 2025/06/06
- [libmicrohttpd2] 12/12: get_all_net_updates_by_epoll(): reduced the size of the data passed to the kernel, Admin, 2025/06/06
- [libmicrohttpd2] 11/12: Made zeroing of memory pool optional, other memory pool improvements, Admin, 2025/06/06