Re: [cups-devel] cups #defines __attribute__ to be empty

Michael Sweet <[email protected]> Sun, 08 Jul 2018 23:18:30 -0400
Newsgroups gmane.comp.printing.cups.devel
Message-ID <[email protected]>
Phil,

> On Jul 5, 2018, at 4:30 PM, Phil Race <[email protected]> wrote:
> 
> OpenJDK builds use the __attribute__  keyword to indicate symbols are exported
> However cups/versioning.h #defines this to be empty unless the compiler is GNU C.
> See the last few lines here :
> https://github.com/apple/cups/blob/master/cups/versioning.h
> 
> So in our code when we include cups/cups.h cups we lose the value of __attribute__
> and you only find out at runtime when these symbols are loaded via JNI and
> we get a linkage error.
> 
> Why is CUPS doing this ?

Because __attribute__ is a GNU C extension that is also supported by Clang, and there are other source files where we need to use __attribute__ for other GNUisms.  If you are using a different compiler that also supports __attribute__, please let us know and we can update this header accordingly.

> And more importantly can it be fixed ?

Of course, if we know what the fix should be...

_________________________________________________________
Michael Sweet, Senior Printing System Engineer