changeset 51676:01fc2c1ee3e6

8206106: [solaris sparc] jck tests api/javax_print/PrintService failing Reviewed-by: simonis, erikj
author prr
date Mon, 09 Jul 2018 10:25:55 -0700
parents 9ad98030b2b6
children a926b7737d3b
files src/java.desktop/unix/native/common/awt/CUPSfuncs.c
diffstat 1 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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