From dab9bb7d1f52e0d6af2bc030863bb6d1047d20ed Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Wed, 13 Jan 2016 09:28:07 -0800 Subject: [PATCH] replace preprocessor __try/__except hack with patch --- makefile | 3 +++ .../java_props_md.c.8.windows.patch | 24 +++++++++++++++++++ openjdk-src.mk | 4 +--- 3 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 openjdk-patches/java_props_md.c.8.windows.patch diff --git a/makefile b/makefile index 3f0ce03941..e42c3e7f23 100755 --- a/makefile +++ b/makefile @@ -2278,6 +2278,9 @@ ifneq (7,$(openjdk-version)) if [ -f openjdk-patches/$(notdir $(<)).8.patch ]; then \ ( cd $(build) && patch -p0 ) < openjdk-patches/$(notdir $(<)).8.patch; \ fi + if [ -f openjdk-patches/$(notdir $(<)).8.$(platform).patch ]; then \ + ( cd $(build) && patch -p0 ) < openjdk-patches/$(notdir $(<)).8.$(platform).patch; \ + fi endif if [ -f openjdk-patches/$(notdir $(<)).patch ]; then \ ( cd $(build) && patch -p0 ) < openjdk-patches/$(notdir $(<)).patch; \ diff --git a/openjdk-patches/java_props_md.c.8.windows.patch b/openjdk-patches/java_props_md.c.8.windows.patch new file mode 100644 index 0000000000..0211421383 --- /dev/null +++ b/openjdk-patches/java_props_md.c.8.windows.patch @@ -0,0 +1,24 @@ +--- openjdk/java_props_md.c ++++ openjdk/java_props_md.c +@@ -212,17 +212,17 @@ + * SHELL32 DLL is delay load DLL and we can use the trick with + * __try/__except block. + */ +- __try { ++ /* __try { */ + /* + * For Windows Vista and later (or patched MS OS) we need to use + * [SHGetKnownFolderPath] call to avoid MAX_PATH length limitation. + * Shell32.dll (version 6.0.6000 or later) + */ + hr = SHGetKnownFolderPath(&FOLDERID_Profile, KF_FLAG_DONT_VERIFY, NULL, &u_path); +- } __except(EXCEPTION_EXECUTE_HANDLER) { ++ /* } __except(EXCEPTION_EXECUTE_HANDLER) { */ + /* Exception: no [SHGetKnownFolderPath] entry */ +- hr = E_FAIL; +- } ++ /* hr = E_FAIL; */ ++ /* } */ + + if (FAILED(hr)) { + WCHAR path[MAX_PATH+1]; diff --git a/openjdk-src.mk b/openjdk-src.mk index 0270de9a4d..f4ec22b9d0 100644 --- a/openjdk-src.mk +++ b/openjdk-src.mk @@ -252,9 +252,7 @@ ifeq ($(platform),windows) -D_JAVASOFT_WIN32_TYPEDEF_MD_H_ \ -D_WIN32_WINNT=0x0600 \ -Ds6_words=_s6_words \ - -Ds6_bytes=_s6_bytes \ - "-D__try=if (1)" \ - "-D__except(a)=else" + -Ds6_bytes=_s6_bytes ifeq ($(arch),x86_64) openjdk-cflags += "-I$(root)/win64/include"