8206106: [solaris sparc] jck tests api/javax_print/PrintService failing
authorprr
Mon, 09 Jul 2018 10:25:55 -0700
changeset 51015 01fc2c1ee3e6
parent 51014 9ad98030b2b6
child 51016 a926b7737d3b
8206106: [solaris sparc] jck tests api/javax_print/PrintService failing Reviewed-by: simonis, erikj
src/java.desktop/unix/native/common/awt/CUPSfuncs.c
--- a/src/java.desktop/unix/native/common/awt/CUPSfuncs.c	Mon Jul 09 10:23:17 2018 -0700
+++ b/src/java.desktop/unix/native/common/awt/CUPSfuncs.c	Mon Jul 09 10:25:55 2018 -0700
@@ -29,6 +29,16 @@
 #include <dlfcn.h>
 #include <cups/cups.h>
 #include <cups/ppd.h>
+/*
+ * CUPS #define's __attribute__(x) to be empty unless __GNUC__ is defined.
+ * However OpenJDK officially uses the SunStudio compiler on Solaris.
+ * We need to #undef this else it breaks use of this keyword used by JNIEXPORT.
+ * See: https://github.com/apple/cups/issues/5349
+ */
+#ifdef __SUNPRO_C
+#undef __attribute__
+#endif
+
 
 //#define CUPS_DEBUG