Commit b74b77720494d3103ba0e2e6eb0fd077d33221cf

Guillem Jover 2023-03-28T03:25:35

build: Do not use strong aliases on macOS These are not supported, and when trying to link the library we get the following error message: error: aliases are not supported on darwin

diff --git a/src/local-link.h b/src/local-link.h
index 7560c4f..5f92455 100644
--- a/src/local-link.h
+++ b/src/local-link.h
@@ -1,5 +1,5 @@
 /*
- * Copyright © 2015, 2019 Guillem Jover <guillem@hadrons.org>
+ * Copyright © 2015, 2019, 2021, 2023 Guillem Jover <guillem@hadrons.org>
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -36,10 +36,12 @@
  * is too cumbersome, as it does not work when static linking, and when
  * dynamic linking it does not make the aliases visible within the DLL itself.
  *
+ * On macOS we cannot use proper strong aliases.
+ *
  * Instead we use normal function wrapper in those cases, which are way more
  * maintainable.
  */
-#ifndef _MSC_VER
+#if !defined(_MSC_VER) && !defined(__APPLE__)
 #define libmd_alias(alias, symbol) \
 	extern __typeof(symbol) alias __attribute__((__alias__(#symbol)))
 #endif