[vlc-commits] Use weak symbol only on ELF targets

Rémi Denis-Courmont git at videolan.org
Sat Sep 3 14:33:09 CEST 2011


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Sep  3 15:32:51 2011 +0300| [e21127bf3a7d512c651076727e0f23de2ea7f9ff] | committer: Rémi Denis-Courmont

Use weak symbol only on ELF targets

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e21127bf3a7d512c651076727e0f23de2ea7f9ff
---

 src/modules/bank.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/src/modules/bank.c b/src/modules/bank.c
index a67128e..61e5a35 100644
--- a/src/modules/bank.c
+++ b/src/modules/bank.c
@@ -71,11 +71,12 @@ static void module_StoreBank (module_t *module)
     modules.head = module;
 }
 
-#ifdef __GNUC__
+#ifdef __ELF__
+# ifdef __GNUC__
 __attribute__((weak))
-#else
-#pragma weak vlc_static_modules
-#endif
+# else
+#  pragma weak vlc_static_modules
+# endif
 extern vlc_plugin_cb vlc_static_modules[];
 
 static void module_InitStaticModules(void)
@@ -89,6 +90,9 @@ static void module_InitStaticModules(void)
             module_StoreBank (module);
     }
 }
+#else
+static void module_InitStaticModules(void) { }
+#endif
 
 /**
  * Init bank



More information about the vlc-commits mailing list