From 12cad8d887912c98f23f9f6f5cac5aabb366481b Mon Sep 17 00:00:00 2001 From: Jinhyung Jo Date: Mon, 25 Jan 2016 19:21:01 +0900 Subject: [PATCH] java_ui: fix compilation error in Windows The JAVA_EXEFILE_PATH definition makes a compilation error. And the definition is no longer needed, because of the get_java_path() function returns a java path. Remove the definition and modify the variable name. Add include file in the "maruskin_client.c" for the get_java_path(). Change-Id: I937b0ab733558ada9a6ad1c6f6f73b8093ec136e Signed-off-by: Jinhyung Jo (cherry picked from commit 4dc427f05e081453a7dd5e0b1da5f7f4bb9ada0e) --- tizen/src/emulator_common.h | 1 - tizen/src/skin/maruskin_client.c | 26 +++++++++++--------------- 2 files changed, 11 insertions(+), 16 deletions(-) diff --git a/tizen/src/emulator_common.h b/tizen/src/emulator_common.h index 1e0ea8d913..270f35e63a 100644 --- a/tizen/src/emulator_common.h +++ b/tizen/src/emulator_common.h @@ -74,7 +74,6 @@ #define JAR_SKINFILE "emulator-skin.jar" #define JAVA_LIBRARY_PATH "-Djava.library.path" #define JAVA_SIMPLEMODE_OPTION "simple.msg" -#define JAVA_EXEFILE_PATH "java" #ifndef CONFIG_DARWIN #define JAVA_EXEOPTION "-jar" #else diff --git a/tizen/src/skin/maruskin_client.c b/tizen/src/skin/maruskin_client.c index feb4d84d1d..1b926d3c19 100644 --- a/tizen/src/skin/maruskin_client.c +++ b/tizen/src/skin/maruskin_client.c @@ -38,6 +38,7 @@ #include "maruskin_client.h" #include "maruskin_server.h" #include "emulator.h" +#include "util/osutil.h" #include "util/sdb.h" #include "debug_ch.h" #include "emul_state.h" @@ -78,9 +79,7 @@ extern char tizen_target_path[]; static int skin_argc; static char** skin_argv; -#ifdef CONFIG_WIN32 -static const char* JAVA_EXEFILE_PATH = NULL; -#endif +static const char *java_exec_path = NULL; static void *run_skin_client(void *arg) { @@ -158,7 +157,7 @@ static void *run_skin_client(void *arg) is_netclient_tap_attached() ? "true" : "false"); int tap_opt_len = (int)strlen(tap_enabled); - get_java_path(&JAVA_EXEFILE_PATH); + get_java_path(&java_exec_path); #ifdef CONFIG_WIN32 char const* bin_dir = get_bin_path(); int bin_len = strlen(bin_dir); @@ -179,7 +178,7 @@ static void *run_skin_client(void *arg) } /* calculate buffer length */ - int cmd_len = strlen(JAVA_EXEFILE_PATH) + SPACE_LEN + + int cmd_len = strlen(java_exec_path) + SPACE_LEN + strlen(JAVA_EXEOPTION) + SPACE_LEN + strlen(JAVA_LIBRARY_PATH) + EQUAL_LEN + #ifdef CONFIG_WIN32 @@ -228,7 +227,7 @@ static void *run_skin_client(void *arg) %s \ %s \ %s", - JAVA_EXEFILE_PATH, JAVA_EXEOPTION, JAVA_LIBRARY_PATH, + java_exec_path, JAVA_EXEOPTION, JAVA_LIBRARY_PATH, #ifdef CONFIG_WIN32 bin_dir_win, bin_dir, JAR_SKINFILE, #else @@ -247,10 +246,8 @@ static void *run_skin_client(void *arg) INFO("command for swt : %s\n", cmd); + java_exec_path = NULL; #ifdef CONFIG_WIN32 - /* for 64bit windows */ - JAVA_EXEFILE_PATH = NULL; - //WinExec( cmd, SW_SHOW ); { STARTUPINFO sti = { 0 }; @@ -382,7 +379,7 @@ int start_simple_client(char* msg) INFO("run simple client\n"); - get_java_path(&JAVA_EXEFILE_PATH); + get_java_path(&java_exec_path); #ifdef CONFIG_WIN32 char const* bin_dir = get_bin_path(); int bin_dir_len = strlen(bin_dir); @@ -395,7 +392,7 @@ int start_simple_client(char* msg) INFO("bin directory : %s\n", bin_dir); /* calculate buffer length */ - int cmd_len = strlen(JAVA_EXEFILE_PATH) + SPACE_LEN + + int cmd_len = strlen(java_exec_path) + SPACE_LEN + strlen(JAVA_EXEOPTION) + SPACE_LEN + strlen(JAVA_LIBRARY_PATH) + EQUAL_LEN + #ifdef CONFIG_WIN32 @@ -414,17 +411,16 @@ int start_simple_client(char* msg) snprintf(cmd, cmd_len, "%s %s %s=\"%s\" \"%s%s\" %s=\"%s\"", #ifdef CONFIG_WIN32 - JAVA_EXEFILE_PATH, JAVA_EXEOPTION, JAVA_LIBRARY_PATH, bin_dir_win, + java_exec_path, JAVA_EXEOPTION, JAVA_LIBRARY_PATH, bin_dir_win, #else - JAVA_EXEFILE_PATH, JAVA_EXEOPTION, JAVA_LIBRARY_PATH, bin_dir, + java_exec_path, JAVA_EXEOPTION, JAVA_LIBRARY_PATH, bin_dir, #endif bin_dir, JAR_SKINFILE, JAVA_SIMPLEMODE_OPTION, msg); INFO("command for swt : %s\n", cmd); + java_exec_path = NULL; #ifdef CONFIG_WIN32 - JAVA_EXEFILE_PATH = NULL; - ret = WinExec(cmd, SW_SHOW); #else ret = system(cmd); -- 2.34.1