Elementary: Windows fixes: link of test_entry module and compilation of Eio test

SVN revision: 70862
This commit is contained in:
Vincent Torri 2012-05-08 05:01:38 +00:00
parent 3cb22f6b00
commit 3ab54eaedc
2 changed files with 70 additions and 3 deletions

View File

@ -1,18 +1,37 @@
#ifdef HAVE_CONFIG_H
# include "elementary_config.h"
#endif
#ifdef HAVE_SYS_TIMES_H
# include <sys/times.h>
#endif
#ifdef _WIN32
# ifndef WIN32_LEAN_AND_MEAN
# define WIN32_LEAN_AND_MEAN
# endif
# include <windows.h>
# undef WIN32_LEAN_AND_MEAN
#endif
#include <Eio.h>
#include <sys/times.h>
#include <Elementary.h>
#ifndef ELM_LIB_QUICKLAUNCH
static Elm_Genlist_Item_Class it_eio;
#ifdef _WIN32
ULONGLONG st_time_kernel;
ULONGLONG st_time_user;
ULONGLONG en_time_kernel;
ULONGLONG en_time_user;
#else
static clock_t st_time;
static clock_t en_time;
static struct tms st_cpu;
static struct tms en_cpu;
#endif
static void _sel_file(void *data, Evas_Object *obj, void *event_info);
static Eina_Bool _ls_filter_cb(void *data, Eio_File *handler, const char *file);
@ -62,12 +81,38 @@ _ls_main_cb(void *data, Eio_File *handler __UNUSED__, const char *file)
static void
_ls_done_cb(void *data __UNUSED__, Eio_File *handler __UNUSED__)
{
#ifdef _WIN32
FILETIME tc;
FILETIME te;
FILETIME tk;
FILETIME tu;
ULARGE_INTEGER time_kernel;
ULARGE_INTEGER time_user;
if (!GetProcessTimes(GetCurrentProcess(),
&tc, &te, &tk, &tu))
return;
time_kernel.u.LowPart = tk.dwLowDateTime;
time_kernel.u.HighPart = tk.dwHighDateTime;
en_time_kernel = time_kernel.QuadPart;
time_user.u.LowPart = tu.dwLowDateTime;
time_user.u.HighPart = tu.dwHighDateTime;
en_time_user = time_user.QuadPart;
fprintf(stderr, "ls done\n");
fprintf(stderr, "Kernel Time: %lld, User Time: %lld",
(en_time_kernel - st_time_kernel),
(en_time_user - st_time_user));
#else
en_time = times(&en_cpu);
fprintf(stderr, "ls done\n");
fprintf(stderr, "Real Time: %.jd, User Time: %.jd, System Time: %.jd\n",
(intmax_t)(en_time - st_time),
(intmax_t)(en_cpu.tms_utime - st_cpu.tms_utime),
(intmax_t)(en_cpu.tms_stime - st_cpu.tms_stime));
#endif
}
static void
@ -82,7 +127,28 @@ _file_chosen(void *data, Evas_Object *obj __UNUSED__, void *event_info)
const char *file = event_info;
if (file)
{
#ifdef _WIN32
FILETIME tc;
FILETIME te;
FILETIME tk;
FILETIME tu;
ULARGE_INTEGER time_kernel;
ULARGE_INTEGER time_user;
if (!GetProcessTimes(GetCurrentProcess(),
&tc, &te, &tk, &tu))
return;
time_kernel.u.LowPart = tk.dwLowDateTime;
time_kernel.u.HighPart = tk.dwHighDateTime;
st_time_kernel = time_kernel.QuadPart;
time_user.u.LowPart = tu.dwLowDateTime;
time_user.u.HighPart = tu.dwHighDateTime;
st_time_user = time_user.QuadPart;
#else
st_time = times(&st_cpu);
#endif
eio_file_ls(file,
_ls_filter_cb,
_ls_main_cb,

View File

@ -17,7 +17,8 @@ AM_CPPFLAGS = \
@ELEMENTARY_EDBUS_CFLAGS@ \
@ELEMENTARY_EFREET_CFLAGS@ \
@ELEMENTARY_ETHUMB_CFLAGS@ \
@ELEMENTARY_EMAP_CFLAGS@
@ELEMENTARY_EMAP_CFLAGS@ \
@EVIL_CFLAGS@
if ELEMENTARY_WINDOWS_BUILD
AM_CPPFLAGS += -DELEMENTARY_BUILD
@ -28,6 +29,6 @@ pkg_LTLIBRARIES = module.la
module_la_SOURCES = mod.c
module_la_LIBADD = $(top_builddir)/src/lib/libelementary.la
module_la_LIBADD = $(top_builddir)/src/lib/libelementary.la @EVIL_LIBS@
module_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -module -avoid-version
module_la_LIBTOOLFLAGS = --tag=disable-static