Define JNIEXPORT as visibility default with GCC?

Florian Weimer fweimer at redhat.com
Thu Feb 14 13:43:43 PST 2013


On 02/14/2013 08:09 PM, David DeHaven wrote:
>
>>> +#if defined(__GNUC__) && (__GNUC__ > 4) || (__GNUC__ == 4) &&
>>> (__GNUC_MINOR__ > 2)
>>> +  #define JNIEXPORT     __attribute__((visibility("default")))
>>> +  #define JNIIMPORT     __attribute__((visibility("default")))
>>
>> The default compiler in Xcode 4.1 is llvm-gcc 4.2, it seems.  The conditional above excludes that.  Is this intentional?
>
> It's *is* gcc, with a LLVM backend.

Yes, but it identifies itself as GCC 4.2, so the conditional doesn't fire.

If Xcode is fine with the #define, I suggest to drop the version check 
completely.  We already do not support compiling with GCC versions which 
are so old that they lack visibility support.

-- 
Florian Weimer / Red Hat Product Security Team


More information about the hotspot-runtime-dev mailing list