Fix for windows build
authorsyeon.hwang <syeon.hwang@samsung.com>
Wed, 14 Mar 2012 12:14:48 +0000 (21:14 +0900)
committersyeon.hwang <syeon.hwang@samsung.com>
Wed, 14 Mar 2012 12:14:48 +0000 (21:14 +0900)
tizen/src/Makefile.tizen
tizen/src/guest_server.c
tizen/src/maru_sdl.h
tizen/src/skin/maruskin_operation.c
tizen/src/skin/maruskin_server.c

index c7f37ea..857fdcf 100644 (file)
@@ -9,7 +9,11 @@ QEMU_CFLAGS += -I$(SRC_PATH)/tizen/distrib/ffmpeg/include
 QEMU_CFLAGS += -L$(SRC_PATH)/tizen/distrib/ffmpeg/lib
 QEMU_CFLAGS += $(SDL_CFLAGS)
 
+ifdef CONFIG_WIN32
+LIBS += -lavformat -lavcodec -lavutil -lm
+else
 LIBS += -lavformat -lavcodec -lavutil -lm -lGL
+endif
 
 # maru loader
 obj-y += emulator.o process.o maru_signal.o maru_sdl.o
@@ -38,11 +42,15 @@ endif
 
 
 # maru skin
-obj-i386-y += maruskin_client.o maruskin_server.o maruskin_operation.o maruskin_keymap.o
+obj-i386-y += maruskin_client.o maruskin_server.o maruskin_operation.o
+ifdef CONFIG_WIN32 
+obj-i386-y += maruskin_keymap.o
+endif
 
 # guest server
 obj-i386-y += guest_server.o 
 
+ifndef CONFIG_WIN32
 ##########################################################
 # opengl library for i386
 obj-i386-y += helper_opengl.o opengl_exec.o opengl_server.o
@@ -74,4 +82,5 @@ endif
 #gles2.o: gles2.c gles2.h gles2_calls.h
 
 ##########################################################
+endif
        
index 36069d1..a7d8763 100644 (file)
 #include <stdio.h>
 #include <string.h>
 #include <unistd.h>
+
+#ifdef _WIN32
+#include <windows.h>
+#include <winsock2.h>
+#include <ws2tcpip.h>
+#else
 #include <arpa/inet.h>
+#endif
+
 #include "guest_server.h"
 #include "skin/maruskin_server.h"
 #include "debug_ch.h"
@@ -51,7 +59,7 @@ pthread_t start_guest_server( int server_port ) {
 
     svr_port = server_port;
 
-    pthread_t thread_id = -1;
+    pthread_t thread_id;
 
     if ( 0 != pthread_create( &thread_id, NULL, run_guest_server, NULL ) ) {
         ERR( "fail to create guest_server pthread.\n" );
index 33a3dd7..9ab855f 100644 (file)
 #include "console.h"
 #ifndef _WIN32
 #include <SDL/SDL.h>
-#include <SDL/SDL_image.h>
 #include <SDL/SDL_syswm.h>
 #else
 #include <windows.h>
 #include <winbase.h>
 #include <SDL.h>
-#include <SDL_image.h>
 #include <SDL_syswm.h>
 #include <SDL_getenv.h>
 #endif
index 661d422..185707d 100644 (file)
 #include "maru_sdl.h"
 #include "debug_ch.h"
 #include "../hw/maru_pm.h"
-#include "maruskin_keymap.h"
+
 #include "console.h"
 #include "sdb.h"
 #include "nbd.h"
 
+#ifndef _WIN32
+#include "maruskin_keymap.h"
+#endif
+
 MULTI_DEBUG_CHANNEL(qemu, skin_operation);
 
 enum {
@@ -169,7 +173,7 @@ void do_rotation_event( int event_type) {
 
     INFO( "send to sendord(size: %d) 127.0.0.1:%d/tcp \n", buf_size, get_sdb_base_port() + SDB_TCP_EMULD_INDEX);
 #ifdef _WIN32
-    closiesocket( s );
+    closesocket( s );
 #else
     close( s );
 #endif
index 5cb2508..a273500 100644 (file)
 #include <stdlib.h>
 #include <unistd.h>
 #include <string.h>
+#ifdef _WIN32
+#include <windows.h>
+#include <winsock2.h>
+#include <ws2tcpip.h>
+#else
 #include <arpa/inet.h>
-#include <sys/types.h>
 #include <netinet/in.h>
 #include <sys/socket.h>
+#endif
+#include <sys/types.h>
 #include <sys/time.h>
 #include <pthread.h>
 #include "maruskin_server.h"