Fix: Make VISIBLE expand to nothing for Clang.

The `VISIBLE` macro is designed to selectively inhibit the effects of GCC's
whole program and link-time optimisations. This is necessary when a C function
is only referenced from a context outside the compiler's visibility, e.g. an
assembly file. As far as I can determine, Clang's link-time optimisations
already account for this possibility and do not need to have this information
manually indicated to them (see, for example, Linux's compiler support headers).

In any event, `__attribute__((visibility("default")))` is not equivalent to
`__attribute__((externally_visible))`, but is instead for controlling symbol
visibility in a library-like setting. This commit removes this incorrect
expansion.
This commit is contained in:
Matthew Fernandez
2016-06-29 16:58:47 +10:00
parent 7a2ede80f8
commit fee3af3dd3

View File

@@ -29,7 +29,7 @@
#define ALIGN(n) __attribute__((__aligned__(n)))
#define FASTCALL __attribute__((fastcall))
#ifdef __clang__
#define VISIBLE __attribute__((visibility("default")))
#define VISIBLE /* nothing */
#else
#define VISIBLE __attribute__((externally_visible))
#endif