gnunet-svn
[Top][All Lists]
Advanced

[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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]