#define libbsd_link_warning(symbol, msg)
#endif
+#if defined(__APPLE__)
+#define libbsd_strong_alias(alias, symbol) \
+ __asm__(".globl _" #alias); \
+ __asm__(".set _" #alias ", _" #symbol); \
+ extern __typeof(symbol) alias
+#elif !defined(_MSC_VER)
+#define libbsd_strong_alias(alias, symbol) \
+ extern __typeof__(symbol) alias __attribute__((__alias__(#symbol)))
+#endif
+
#ifdef __ELF__
# if __has_attribute(symver)
/* The symver attribute is supported since gcc 10.x. */
# endif
#else
#define libbsd_symver_default(alias, symbol, version) \
- extern __typeof__(symbol) alias __attribute__((__alias__(#symbol)))
+ libbsd_strong_alias(alias, symbol)
#define libbsd_symver_variant(alias, symbol, version)
* in 0.5, make the implementation available in the old version as an alias
* for code linking against that version, and change the default to use the
* new version, so that new code depends on the implemented version. */
-#ifdef HAVE_TYPEOF
-extern __typeof__(setproctitle_impl)
-setproctitle_stub
- __attribute__((__alias__("setproctitle_impl")));
+#if defined(libbsd_strong_alias)
+libbsd_strong_alias(setproctitle_stub, setproctitle_impl);
#else
void
setproctitle_stub(const char *fmt, ...)