From bc8c0ccf09741815232959c7ce5a7265745b0a8d Mon Sep 17 00:00:00 2001 From: Jason Feng Date: Fri, 23 Aug 2024 15:28:56 -0400 Subject: [PATCH] Fix JDK11 Windows compilation error Signed-off-by: Jason Feng --- runtime/j9vm/jvm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/runtime/j9vm/jvm.c b/runtime/j9vm/jvm.c index c9e1be4f919..59da8aacc60 100644 --- a/runtime/j9vm/jvm.c +++ b/runtime/j9vm/jvm.c @@ -4085,9 +4085,9 @@ JVM_LoadLibrary(const char *libName, jboolean throwOnFailure) char *errMsg = errBuf; int bufSize = sizeof(errBuf); const char *portMsg = -#if defined(WIN32) +#if defined(WIN32) && (JAVA_SPEC_VERSION >= 17) !attemptedLoad ? "" : -#endif /* defined(WIN32) */ +#endif /* defined(WIN32) && (JAVA_SPEC_VERSION >= 17) */ j9error_last_error_message(); const char *space = ('\0' == *portMsg) ? "" : " "; bufSize = jio_snprintf(errMsg, bufSize, "Failed to load library (\"%s\")%s%s", libName, space, portMsg);