git: d7146f6d335b - main - java/openjdk8: fix build with clang 15

From: Dimitry Andric <dim_at_FreeBSD.org>
Date: Sun, 18 Dec 2022 17:43:42 UTC
The branch main has been updated by dim (src committer):

URL: https://cgit.FreeBSD.org/ports/commit/?id=d7146f6d335b360c5c9fb736cf49c7af939b77d7

commit d7146f6d335b360c5c9fb736cf49c7af939b77d7
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2022-12-07 14:53:48 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2022-12-18 17:23:58 +0000

    java/openjdk8: fix build with clang 15
    
    During an exp-run for llvm 15 (see bug 265425), it turned out that
    java/openjdk8 failed to build with clang 15:
    
        /wrkdirs/usr/ports/java/openjdk8/work/jdk8u-jdk8u352-b08.1/jdk/src/share/bin/splashscreen_stubs.c:64:30: error: incompatible pointer to integer conversion returning 'void *' from a function with result type 'int' [-Wint-conversion]
            INVOKE(SplashLoadMemory, NULL)(pdata, size);
                                     ^~~~
        /usr/include/sys/_null.h:34:14: note: expanded from macro 'NULL'
        #define NULL    ((void *)0)
                        ^~~~~~~~~~~
        /wrkdirs/usr/ports/java/openjdk8/work/jdk8u-jdk8u352-b08.1/jdk/src/share/bin/splashscreen_stubs.c:60:39: note: expanded from macro 'INVOKE'
        #define INVOKE(name,def) _INVOKE(name,def,return)
                                              ^~~
        /wrkdirs/usr/ports/java/openjdk8/work/jdk8u-jdk8u352-b08.1/jdk/src/share/bin/splashscreen_stubs.c:57:25: note: expanded from macro '_INVOKE'
            if (!proc) { return def; } \
                                ^~~
        /wrkdirs/usr/ports/java/openjdk8/work/jdk8u-jdk8u352-b08.1/jdk/src/share/bin/splashscreen_stubs.c:68:28: error: incompatible pointer to integer conversion returning 'void *' from a function with result type 'int' [-Wint-conversion]
            INVOKE(SplashLoadFile, NULL)(filename);
                                   ^~~~
        /usr/include/sys/_null.h:34:14: note: expanded from macro 'NULL'
        #define NULL    ((void *)0)
                        ^~~~~~~~~~~
        /wrkdirs/usr/ports/java/openjdk8/work/jdk8u-jdk8u352-b08.1/jdk/src/share/bin/splashscreen_stubs.c:60:39: note: expanded from macro 'INVOKE'
        #define INVOKE(name,def) _INVOKE(name,def,return)
                                              ^~~
        /wrkdirs/usr/ports/java/openjdk8/work/jdk8u-jdk8u352-b08.1/jdk/src/share/bin/splashscreen_stubs.c:57:25: note: expanded from macro '_INVOKE'
            if (!proc) { return def; } \
                                ^~~
        2 errors generated.
    
    Indeed, instead of the pointer value NULL, the integer value 0 should be
    used.
    
    PR:             268223
    Approved by:    portmgr (tcberner)
    MFH:            2022Q4
---
 .../files/patch-jdk_src_share_bin_splashscreen__stubs.c  | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/java/openjdk8/files/patch-jdk_src_share_bin_splashscreen__stubs.c b/java/openjdk8/files/patch-jdk_src_share_bin_splashscreen__stubs.c
new file mode 100644
index 000000000000..80019e780130
--- /dev/null
+++ b/java/openjdk8/files/patch-jdk_src_share_bin_splashscreen__stubs.c
@@ -0,0 +1,16 @@
+--- jdk/src/share/bin/splashscreen_stubs.c.orig	2022-07-31 16:21:00 UTC
++++ jdk/src/share/bin/splashscreen_stubs.c
+@@ -61,11 +61,11 @@ int     DoSplashLoadMemory(void* pdata, int size) {
+ #define INVOKEV(name) _INVOKE(name, ,;)
+ 
+ int     DoSplashLoadMemory(void* pdata, int size) {
+-    INVOKE(SplashLoadMemory, NULL)(pdata, size);
++    INVOKE(SplashLoadMemory, 0)(pdata, size);
+ }
+ 
+ int     DoSplashLoadFile(const char* filename) {
+-    INVOKE(SplashLoadFile, NULL)(filename);
++    INVOKE(SplashLoadFile, 0)(filename);
+ }
+ 
+ void    DoSplashInit(void) {