Bug 493761: Platform won't launch on Java 9-ea builds
(InjectionException: NoClassDefFoundError:
javax/annotation/PostConstruct)
Fix Windows build failure by declaring variables at the beginning of the
block (Windows build seems to be using an old version of VS compiler not
compliant with C99)
Change-Id: If19501943ee90e959fcc71fc8dc32b9a3a906124
Signed-off-by: Arun Thondapu <arunkumar.thondapu@in.ibm.com>
diff --git a/features/org.eclipse.equinox.executable.feature/library/eclipse.c b/features/org.eclipse.equinox.executable.feature/library/eclipse.c
index 27e2e2f..d65cfb2 100644
--- a/features/org.eclipse.equinox.executable.feature/library/eclipse.c
+++ b/features/org.eclipse.equinox.executable.feature/library/eclipse.c
@@ -1042,7 +1042,7 @@
if (!isModularVM(javaVM, jniLib)) {
while ((*vmArgv)[i] != NULL) {
if (_tcsncmp((*vmArgv)[i], ADDMODULES, _tcslen(ADDMODULES)) == 0) {
- int j = 0;
+ int j = 0, k = 0;
if ((_tcschr((*vmArgv)[i], '=') != NULL) && ((*vmArgv)[i][13] == '=')) {
/* --add-modules=<value> */
@@ -1057,7 +1057,7 @@
}
/* shift all remaining arguments, but keep i, so that we can find repeated occurrences of --add-modules */
- int k = i;
+ k = i;
(*vmArgv)[k] = (*vmArgv)[j];
while ((*vmArgv)[j] != NULL) {
(*vmArgv)[++k] = (*vmArgv)[++j];