[Title] redefine arch macro in some line
authorgiwoong.kim <giwoong.kim@samsung.com>
Fri, 20 Jul 2012 05:55:36 +0000 (14:55 +0900)
committergiwoong.kim <giwoong.kim@samsung.com>
Fri, 20 Jul 2012 05:55:36 +0000 (14:55 +0900)
[Type]
[Module] Emulator
[Priority] minor
[Jira#]
[Redmine#]
[Problem]
[Cause]
[Solution]
[TestCase]

tizen/src/emul_state.c [changed mode: 0644->0755]
tizen/src/emulator.c [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index a455bdb..6387c5f
@@ -161,7 +161,9 @@ MultiTouchState *get_emul_multi_touch_state(void)
 /* retrieves the status of the host lock key */
 int get_host_lock_key_state(int key)
 {
-#if defined( __linux__)
+    /* support only capslock, numlock */
+
+#if defined(CONFIG_LINUX)
     unsigned state = 0;
     Display *display = XOpenDisplay((char*)0);
     if (display) {
@@ -169,7 +171,6 @@ int get_host_lock_key_state(int key)
     }
     XCloseDisplay(display);
 
-
     if (key == HOST_CAPSLOCK_KEY) {
         return (state & 0x01) != 0;
     } else if (key == HOST_NUMLOCK_KEY) {
@@ -177,16 +178,18 @@ int get_host_lock_key_state(int key)
     }
 
     return -1;
-#elif defined(_WIN32)
-    int nVirtKey = 0;
 
+#elif defined(CONFIG_WIN32)
     if (key == HOST_CAPSLOCK_KEY) {
-        nVirtKey = VK_CAPITAL;
+        return (GetKeyState(VK_CAPITAL) & 1) != 0;
     } else if (key == HOST_NUMLOCK_KEY) {
-        nVirtKey = VK_NUMLOCK;
+        return (GetKeyState(VK_NUMLOCK) & 1) != 0;
     }
 
-    return (GetKeyState(nVirtKey) & 1) != 0;
+    return -1;
+
+#elif defined(CONFIG_DARWIN)
+    //TODO:
 #endif
 
     return 0;
old mode 100644 (file)
new mode 100755 (executable)
index 1c99efa..e877bb4
@@ -130,7 +130,7 @@ static int check_port_bind_listen(u_int port)
 
 void check_shdmem(void)
 {
-#ifndef _WIN32
+#ifndef CONFIG_WIN32
     int shm_id;
     void *shm_addr;
     u_int port;
@@ -435,9 +435,6 @@ static void system_info(void)
 {
 #define DIV 1024
 
-#ifdef __linux__
-    char lscmd[MAXLEN] = "lspci >> ";
-#endif
     char timeinfo[64] = {0, };
     struct tm *tm_time;
     struct timeval tval;
@@ -445,9 +442,7 @@ static void system_info(void)
     INFO("* SDK Version : %s\n", build_version);
     INFO("* Package %s\n", pkginfo_version);
     INFO("* User name : %s\n", g_get_real_name());
-#ifdef _WIN32
     INFO("* Host name : %s\n", g_get_host_name());
-#endif
 
     /* timestamp */
     INFO("* Build date : %s\n", build_date);
@@ -460,7 +455,7 @@ static void system_info(void)
     INFO("* Host sdl version : (%d, %d, %d)\n",
         SDL_Linked_Version()->major, SDL_Linked_Version()->minor, SDL_Linked_Version()->patch);
 
-#if defined( _WIN32)
+#if defined(CONFIG_WIN32)
     /* Retrieves information about the current os */
     OSVERSIONINFO osvi;
     ZeroMemory(&osvi, sizeof(OSVERSIONINFO));
@@ -484,7 +479,7 @@ static void system_info(void)
     INFO("* Total Ram : %llu kB, Free: %lld kB\n",
         memInfo.ullTotalPhys / DIV, memInfo.ullAvailPhys / DIV);
 
-#elif defined(__linux__)
+#elif defined(CONFIG_LINUX)
     /* depends on building */
     INFO("* Qemu build machine linux kernel version : (%d, %d, %d)\n",
         LINUX_VERSION_CODE >> 16, (LINUX_VERSION_CODE >> 8) & 0xff, LINUX_VERSION_CODE & 0xff);
@@ -505,9 +500,13 @@ static void system_info(void)
 
     /* pci device description */
     INFO("* Pci devices :\n");
+    char lscmd[MAXLEN] = "lspci >> ";
     strcat(lscmd, logpath);
     int i = system(lscmd);
     INFO("system function command : %s, system function returned value : %d\n", lscmd, i);
+
+#elif defined(CONFIG_DARWIN)
+    //TODO:
 #endif
 
     INFO("\n");