From f58c5b09fb59baf07c942d373fc4d522b27e73c6 Mon Sep 17 00:00:00 2001 From: Kevin Cernekee Date: Wed, 4 Jan 2017 14:30:26 -0800 Subject: Use __EXPORTED rather than EXPORT_SYMBOL clang is sensitive to the ordering of __attribute__((visibility("default"))) relative to the function body. gcc is not. So if we try to re-declare an existing function with default visibility, clang prints a warning and generates a broken .so file in which nfct_helper_* are not exported to library callers. Move the attribute up into the function definition to make clang happy. Signed-off-by: Kevin Cernekee Signed-off-by: Pablo Neira Ayuso --- src/internal.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/internal.h') diff --git a/src/internal.h b/src/internal.h index 3a88d1a..5d78171 100644 --- a/src/internal.h +++ b/src/internal.h @@ -3,10 +3,9 @@ #include "config.h" #ifdef HAVE_VISIBILITY_HIDDEN -# define __visible __attribute__((visibility("default"))) -# define EXPORT_SYMBOL(x) typeof(x) (x) __visible +# define __EXPORTED __attribute__((visibility("default"))) #else -# define EXPORT_SYMBOL +# define __EXPORTED #endif #endif -- cgit v1.2.3