From e53302fceadc69585f2e2f53d9a9ef9da78011d0 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Mon, 6 Feb 2012 16:44:57 +0100 Subject: [PATCH] Explicitly export libuv symbols if gcc >= 4. Only export symbols that are part of the libuv API, hide everything else. Prevents symbol clashes in applications and libraries that depend on libuv and speeds up link times to boot. --- include/uv.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/uv.h b/include/uv.h index ba93e07c..f0f1ff33 100644 --- a/include/uv.h +++ b/include/uv.h @@ -41,8 +41,9 @@ extern "C" { # define UV_EXTERN /* nothing */ # define CARES_STATICLIB 1 # endif +#elif __GNUC__ >= 4 +# define UV_EXTERN __attribute__((visibility("default"))) #else - /* Unix. TODO: symbol hiding */ # define UV_EXTERN /* nothing */ #endif