diff --git a/src/dsp/dsp.h b/src/dsp/dsp.h index 1e3dbb12..c225163b 100644 --- a/src/dsp/dsp.h +++ b/src/dsp/dsp.h @@ -100,7 +100,7 @@ typedef enum { } CPUFeature; // returns true if the CPU supports the feature. typedef int (*VP8CPUInfo)(CPUFeature feature); -extern VP8CPUInfo VP8GetCPUInfo; +WEBP_EXTERN(VP8CPUInfo) VP8GetCPUInfo; //------------------------------------------------------------------------------ // Encoding diff --git a/src/webp/types.h b/src/webp/types.h index 568d1f26..6281b3b7 100644 --- a/src/webp/types.h +++ b/src/webp/types.h @@ -38,7 +38,11 @@ typedef long long int int64_t; #ifndef WEBP_EXTERN // This explicitly marks library functions and allows for changing the // signature for e.g., Windows DLL builds. -#define WEBP_EXTERN(type) extern type +# if defined(__GNUC__) && __GNUC__ >= 4 +# define WEBP_EXTERN(type) extern __attribute__ ((visibility ("default"))) type +# else +# define WEBP_EXTERN(type) extern type +# endif /* __GNUC__ >= 4 */ #endif /* WEBP_EXTERN */ // Macro to check ABI compatibility (same major revision number)