From: caro Date: Mon, 5 Apr 2010 08:26:48 +0000 (+0000) Subject: various fixes for vc++. I'll add the Visual Studio projects later X-Git-Tag: accepted/2.0/20130306.224007~195^2~1012 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4e4944fdd6220359f1dd73339f58403bae911706;p=profile%2Fivi%2Fecore.git various fixes for vc++. I'll add the Visual Studio projects later git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/ecore@47758 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- diff --git a/configure.ac b/configure.ac index 11790c4..d8bb3a6 100644 --- a/configure.ac +++ b/configure.ac @@ -346,6 +346,7 @@ case "$host_os" in EFL_ECORE_EVAS_BUILD="-DEFL_ECORE_EVAS_BUILD" EFL_ECORE_IMF_BUILD="-DEFL_ECORE_IMF_BUILD" EFL_ECORE_INPUT_BUILD="-DEFL_ECORE_INPUT_BUILD" + EFL_ECORE_INPUT_EVAS_BUILD="-DEFL_ECORE_INPUT_EVAS_BUILD" ;; esac diff --git a/src/lib/ecore/Ecore.h b/src/lib/ecore/Ecore.h index 4ea2ba9..164e9ed 100644 --- a/src/lib/ecore/Ecore.h +++ b/src/lib/ecore/Ecore.h @@ -1,6 +1,10 @@ #ifndef _ECORE_H #define _ECORE_H +#ifdef _MSC_VER +# include +#endif + #include #ifdef EAPI diff --git a/src/lib/ecore/Makefile.am b/src/lib/ecore/Makefile.am index da710ad..c1fb716 100644 --- a/src/lib/ecore/Makefile.am +++ b/src/lib/ecore/Makefile.am @@ -21,7 +21,6 @@ ecore_job.c \ ecore_main.c \ ecore_pipe.c \ ecore_poll.c \ -ecore_signal.c \ ecore_time.c \ ecore_timer.c \ ecore_thread.c \ @@ -39,7 +38,7 @@ libecore_la_SOURCES += ecore_exe_wince.c else -libecore_la_SOURCES += ecore_exe.c +libecore_la_SOURCES += ecore_signal.c ecore_exe.c endif diff --git a/src/lib/ecore/ecore.c b/src/lib/ecore/ecore.c index 7c10b96..8ccb8d2 100644 --- a/src/lib/ecore/ecore.c +++ b/src/lib/ecore/ecore.c @@ -9,10 +9,13 @@ #include #include #include -#include #include #include +#ifndef _MSC_VER +# include +#endif + #ifdef HAVE_LOCALE_H # include #endif @@ -48,7 +51,7 @@ static pid_t _ecore_memory_pid = 0; static const char *_ecore_magic_string_get(Ecore_Magic m); static int _ecore_init_count = 0; -EAPI int _ecore_log_dom = -1; +int _ecore_log_dom = -1; int _ecore_fps_debug = 0; /** OpenBSD does not define CODESET diff --git a/src/lib/ecore/ecore_app.c b/src/lib/ecore/ecore_app.c index 2c7bab0..93c2436 100644 --- a/src/lib/ecore/ecore_app.c +++ b/src/lib/ecore/ecore_app.c @@ -7,7 +7,10 @@ #endif #include -#include + +#ifndef _MSC_VER +# include +#endif #ifdef HAVE_EVIL # include diff --git a/src/lib/ecore/ecore_exe_win32.c b/src/lib/ecore/ecore_exe_win32.c index 42da785..c2d99f6 100644 --- a/src/lib/ecore/ecore_exe_win32.c +++ b/src/lib/ecore/ecore_exe_win32.c @@ -14,6 +14,11 @@ # include #endif +#define WIN32_LEAN_AND_MEAN +#include +#undef WIN32_LEAN_AND_MEAN +#include + #ifdef HAVE_EVIL # include #endif @@ -21,11 +26,6 @@ #include "Ecore.h" #include "ecore_private.h" -#define WIN32_LEAN_AND_MEAN -#include -#undef WIN32_LEAN_AND_MEAN -#include - #define ECORE_EXE_WIN32_TIMEOUT 3000 typedef enum diff --git a/src/lib/ecore/ecore_getopt.c b/src/lib/ecore/ecore_getopt.c index 08d5b22..09e47dd 100644 --- a/src/lib/ecore/ecore_getopt.c +++ b/src/lib/ecore/ecore_getopt.c @@ -100,13 +100,13 @@ _ecore_getopt_help_line(FILE *fp, const int base, const int total, int used, con /* process line considering spaces (new line and tabs are spaces!) */ while ((used < total) && (len > 0)) { + const char *space = NULL; int i, todo; todo = total - used; if (todo > len) todo = len; - const char *space = NULL; for (i = 0; i < todo; i++) if (isspace(text[i])) { diff --git a/src/lib/ecore/ecore_main.c b/src/lib/ecore/ecore_main.c index e4280bf..2f38cb3 100644 --- a/src/lib/ecore/ecore_main.c +++ b/src/lib/ecore/ecore_main.c @@ -7,8 +7,12 @@ #endif #ifdef _WIN32 +# define WIN32_LEAN_AND_MEAN # include -# define USER_TIMER_MINIMUM 0x0a +# undef WIN32_LEAN_AND_MEAN +# ifndef USER_TIMER_MINIMUM +# define USER_TIMER_MINIMUM 0x0a +# endif #endif #ifdef __SUNPRO_C @@ -19,16 +23,23 @@ #include #include #include -#include #include -#include #include #include +#ifndef _MSC_VER +#include +# include +#else +# include +#endif + #define FIX_HZ 1 #ifdef FIX_HZ -# include +# ifndef _MSC_VER +# include +# endif # ifndef HZ # define HZ 100 # endif @@ -1039,12 +1050,12 @@ _ecore_main_win32_select(int nfds, fd_set *readfds, fd_set *writefds, } else { - ERR(stderr, "unknown result...\n"); + ERR("unknown result...\n"); res = -1; } /* Remove event objects again */ - for(i = 0; i < events_nbr; i++) + for(i = 0; i < (int)events_nbr; i++) WSACloseEvent(objects[i]); return res; diff --git a/src/lib/ecore/ecore_signal.c b/src/lib/ecore/ecore_signal.c index 5d5a42b..5d0ddb5 100644 --- a/src/lib/ecore/ecore_signal.c +++ b/src/lib/ecore/ecore_signal.c @@ -2,8 +2,6 @@ * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2 */ -#ifndef _WIN32 - #ifdef HAVE_CONFIG_H # include #endif @@ -624,4 +622,3 @@ _ecore_signal_exe_exit_delay(void *data) } return 0; } -#endif diff --git a/src/lib/ecore_file/ecore_file.c b/src/lib/ecore_file/ecore_file.c index 97544b8..385307a 100644 --- a/src/lib/ecore_file/ecore_file.c +++ b/src/lib/ecore_file/ecore_file.c @@ -10,9 +10,12 @@ #include #include #include -#include #include -#include + +#ifndef _MSC_VER +# include +# include +#endif #ifndef _FILE_OFFSET_BITS # define _FILE_OFFSET_BITS 64 @@ -177,10 +180,10 @@ ecore_file_mkdir(const char *dir) EAPI int ecore_file_mkdirs(const char **dirs) { - if (!dirs) return -1; - int i = 0; + if (!dirs) return -1; + for (; *dirs != NULL; dirs++) if (ecore_file_mkdir(*dirs)) i++; @@ -417,11 +420,10 @@ ecore_file_mkpath(const char *path) EAPI int ecore_file_mkpaths(const char **paths) { + int i = 0; if (!paths) return -1; - int i = 0; - for (; *paths != NULL; paths++) if (ecore_file_mkpath(*paths)) i++; diff --git a/src/lib/ecore_file/ecore_file_download.c b/src/lib/ecore_file/ecore_file_download.c index 8cf3863..94682c5 100644 --- a/src/lib/ecore_file/ecore_file_download.c +++ b/src/lib/ecore_file/ecore_file_download.c @@ -9,7 +9,10 @@ #include #include -#include "Ecore_Con.h" +#ifdef BUILD_ECORE_CON +# include "Ecore_Con.h" +#endif + #include "ecore_file_private.h" #ifdef BUILD_ECORE_CON diff --git a/src/lib/ecore_input/ecore_input.c b/src/lib/ecore_input/ecore_input.c index 9ff510f..448772e 100644 --- a/src/lib/ecore_input/ecore_input.c +++ b/src/lib/ecore_input/ecore_input.c @@ -10,9 +10,10 @@ #include #include "Ecore.h" -#include "ecore_input_private.h" #include "ecore_private.h" + #include "Ecore_Input.h" +#include "ecore_input_private.h" int _ecore_input_log_dom = -1; diff --git a/src/lib/ecore_input_evas/Ecore_Input_Evas.h b/src/lib/ecore_input_evas/Ecore_Input_Evas.h index fa13bd3..265d611 100644 --- a/src/lib/ecore_input_evas/Ecore_Input_Evas.h +++ b/src/lib/ecore_input_evas/Ecore_Input_Evas.h @@ -12,7 +12,7 @@ #endif #ifdef _WIN32 -# ifdef EFL_ECORE_INPUT_BUILD +# ifdef EFL_ECORE_INPUT_EVAS_BUILD # ifdef DLL_EXPORT # define EAPI __declspec(dllexport) # else diff --git a/src/lib/ecore_input_evas/Makefile.am b/src/lib/ecore_input_evas/Makefile.am index 8a0ae99..b0fe622 100644 --- a/src/lib/ecore_input_evas/Makefile.am +++ b/src/lib/ecore_input_evas/Makefile.am @@ -5,7 +5,7 @@ AM_CPPFLAGS = \ -I$(top_builddir)/src/lib/ecore_input \ -I$(top_srcdir)/src/lib/ecore \ -I$(top_builddir)/src/lib/ecore \ -@EFL_ECORE_INPUT_BUILD@ \ +@EFL_ECORE_INPUT_EVAS_BUILD@ \ @EVAS_CFLAGS@ \ @EINA_CFLAGS@ \ @EVIL_CFLAGS@ diff --git a/src/lib/ecore_input_evas/ecore_input_evas.c b/src/lib/ecore_input_evas/ecore_input_evas.c index e537a31..15664da 100644 --- a/src/lib/ecore_input_evas/ecore_input_evas.c +++ b/src/lib/ecore_input_evas/ecore_input_evas.c @@ -9,9 +9,10 @@ #include #include "Ecore.h" -#include "ecore_input_evas_private.h" #include "Ecore_Input.h" + #include "Ecore_Input_Evas.h" +#include "ecore_input_evas_private.h" int _ecore_input_evas_log_dom = -1; diff --git a/src/lib/ecore_win32/ecore_win32_dnd.c b/src/lib/ecore_win32/ecore_win32_dnd.c index 6ce9367..25363b2 100755 --- a/src/lib/ecore_win32/ecore_win32_dnd.c +++ b/src/lib/ecore_win32/ecore_win32_dnd.c @@ -55,20 +55,18 @@ int ecore_win32_dnd_shutdown() int ecore_win32_dnd_begin(const char *data, int size) { - if (data == NULL) - return 0; - if (size < 0) - size = strlen(data) + 1; - IDataObject *pDataObject = NULL; IDropSource *pDropSource = NULL; - FORMATETC fmtetc = { CF_TEXT, 0, DVASPECT_CONTENT, -1, TYMED_HGLOBAL }; STGMEDIUM stgmed = { TYMED_HGLOBAL, { 0 }, 0 }; + int res = 0; - stgmed.hGlobal = DataToHandle(data, size); + if (data == NULL) + return 0; + if (size < 0) + size = strlen(data) + 1; - int res = 0; + stgmed.hGlobal = DataToHandle(data, size); // create the data object pDataObject = (IDataObject *)_ecore_win32_dnd_data_object_new((void *)&fmtetc, @@ -112,10 +110,11 @@ int ecore_win32_dnd_begin(const char *data, int ecore_win32_dnd_register_drop_target(Ecore_Win32_Window *window, Ecore_Win32_Dnd_DropTarget_Callback callback) { + struct _Ecore_Win32_Window *wnd = (struct _Ecore_Win32_Window *)window; + if (window == NULL) return 0; - struct _Ecore_Win32_Window *wnd = (struct _Ecore_Win32_Window *)window; wnd->dnd_drop_target = _ecore_win32_dnd_register_drop_window(wnd->window, callback, (void *)wnd); @@ -124,10 +123,11 @@ int ecore_win32_dnd_register_drop_target(Ecore_Win32_Window *win void ecore_win32_dnd_unregister_drop_target(Ecore_Win32_Window *window) { + struct _Ecore_Win32_Window *wnd = (struct _Ecore_Win32_Window *)window; + if (window == NULL) return; - struct _Ecore_Win32_Window *wnd = (struct _Ecore_Win32_Window *)window; if (wnd->dnd_drop_target != NULL) _ecore_win32_dnd_unregister_drop_window(wnd->window, wnd->dnd_drop_target); }