From dad121df6d754802707a923f31ea371cfa80fb2e Mon Sep 17 00:00:00 2001 From: Peter Shipton Date: Fri, 1 Nov 2024 15:09:49 -0400 Subject: [PATCH] Backport parts of 8300169: Build failure with clang-15 https://github.com/ibmruntimes/openj9-openjdk-jdk17/commit/f441ba047 Signed-off-by: Peter Shipton --- make/lib/Awt2dLibraries.gmk | 7 +++++-- .../macosx/native/libawt_lwawt/awt/CPrinterJob.m | 4 ++-- src/java.desktop/share/native/libharfbuzz/hb-meta.hh | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/make/lib/Awt2dLibraries.gmk b/make/lib/Awt2dLibraries.gmk index d50e5fa4cf..ec76b5fca8 100644 --- a/make/lib/Awt2dLibraries.gmk +++ b/make/lib/Awt2dLibraries.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2022, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -22,6 +22,9 @@ # or visit www.oracle.com if you need additional information or have any # questions. # +# =========================================================================== +# (c) Copyright IBM Corp. 2024, 2024 All Rights Reserved +# =========================================================================== $(eval $(call IncludeCustomExtension, lib/Awt2dLibraries-pre.gmk)) @@ -227,7 +230,7 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBAWT, \ EXTRA_HEADER_DIRS := $(LIBAWT_EXTRA_HEADER_DIRS), \ DISABLED_WARNINGS_gcc := sign-compare unused-result maybe-uninitialized \ format-nonliteral parentheses, \ - DISABLED_WARNINGS_clang := logical-op-parentheses extern-initializer, \ + DISABLED_WARNINGS_clang := logical-op-parentheses extern-initializer deprecated-non-prototype unknown-warning-option, \ DISABLED_WARNINGS_solstudio := E_DECLARATION_IN_CODE, \ DISABLED_WARNINGS_microsoft := 4244 4267 4996, \ ASFLAGS := $(LIBAWT_ASFLAGS), \ diff --git a/src/java.desktop/macosx/native/libawt_lwawt/awt/CPrinterJob.m b/src/java.desktop/macosx/native/libawt_lwawt/awt/CPrinterJob.m index 545138de71..9cbd48bf84 100644 --- a/src/java.desktop/macosx/native/libawt_lwawt/awt/CPrinterJob.m +++ b/src/java.desktop/macosx/native/libawt_lwawt/awt/CPrinterJob.m @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -63,7 +63,7 @@ GET_CPRINTERDIALOG_CLASS_RETURN(ret); \ GET_FIELD_RETURN(sjm_printerJob, sjc_CPrinterDialog, "fPrinterJob", "Lsun/lwawt/macosx/CPrinterJob;", ret); -static NSPrintInfo* createDefaultNSPrintInfo(); +static NSPrintInfo* createDefaultNSPrintInfo(JNIEnv* env, jstring printer); static void makeBestFit(NSPrintInfo* src); diff --git a/src/java.desktop/share/native/libharfbuzz/hb-meta.hh b/src/java.desktop/share/native/libharfbuzz/hb-meta.hh index c3af0e75e5..d8d12f0aeb 100644 --- a/src/java.desktop/share/native/libharfbuzz/hb-meta.hh +++ b/src/java.desktop/share/native/libharfbuzz/hb-meta.hh @@ -199,7 +199,7 @@ template <> struct hb_int_max : hb_integral_constant struct hb_int_max : hb_integral_constant {}; #define hb_int_max(T) hb_int_max::value -#if defined(__GNUC__) && __GNUC__ < 5 +#if defined(__GNUC__) && __GNUC__ < 5 && !defined(__clang__) #define hb_is_trivially_copyable(T) __has_trivial_copy(T) #define hb_is_trivially_copy_assignable(T) __has_trivial_assign(T) #define hb_is_trivially_constructible(T) __has_trivial_constructor(T)