java_ui: fix compilation error in Windows
authorJinhyung Jo <jinhyung.jo@samsung.com>
Mon, 25 Jan 2016 10:21:01 +0000 (19:21 +0900)
committerJinhyung Jo <jinhyung.jo@samsung.com>
Tue, 26 Jan 2016 09:45:24 +0000 (18:45 +0900)
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 <jinhyung.jo@samsung.com>
(cherry picked from commit 4dc427f05e081453a7dd5e0b1da5f7f4bb9ada0e)

tizen/src/emulator_common.h
tizen/src/skin/maruskin_client.c

index 1e0ea8d913b258baa29e9e774e8cef19d16d5cce..270f35e63ac1cd57ffeeda31670abb0d58ed4973 100644 (file)
@@ -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
index feb4d84d1d08e6428f017c379d728a0ac6e4b8ed..1b926d3c19ac38e0b99deddbb97380bf0d3396b0 100644 (file)
@@ -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);