* configure.ac:

* src/bin/Makefile.am:
* src/bin/test_memcpy.c:
compile memcpy_glibc.S only if cegcc or mingw32ce is used

* src/bin/test_pipe.c:
use evil_sockets_init and evil_sockets_shutdown.

* src/lib/evil_unistd.c:
formatting


SVN revision: 36294
This commit is contained in:
Vincent Torri 2008-09-28 13:32:49 +00:00
parent d6ae9053ad
commit be3df7fcd1
6 changed files with 61 additions and 21 deletions

View File

@ -1,3 +1,16 @@
2008-09-28 Vincent Torri <doursse at users dot sf dot net>
* configure.ac:
* src/bin/Makefile.am:
* src/bin/test_memcpy.c:
compile memcpy_glibc.S only if cegcc or mingw32ce is used
* src/bin/test_pipe.c:
use evil_sockets_init and evil_sockets_shutdown.
* src/lib/evil_unistd.c:
formatting
2008-09-15 Vincent Torri <doursse at users dot sf dot net> 2008-09-15 Vincent Torri <doursse at users dot sf dot net>
* Makefile.am: * Makefile.am:

View File

@ -8,6 +8,7 @@ AC_CANONICAL_HOST
dnl If the host is not windows, we exit, dnl If the host is not windows, we exit,
dnl otherwise, we set the correct flags dnl otherwise, we set the correct flags
dnl for each platform. dnl for each platform.
have_wince="no"
win32_libs="" win32_libs=""
win32_cflags="" win32_cflags=""
case "$host_os" in case "$host_os" in
@ -15,10 +16,12 @@ case "$host_os" in
win32_libs="-lole32 -luuid -lws2_32" win32_libs="-lole32 -luuid -lws2_32"
;; ;;
cegcc) cegcc)
have_wince="yes"
win32_cflags="-mwin32" win32_cflags="-mwin32"
win32_libs="-lws2" win32_libs="-lws2"
;; ;;
mingw32ce) mingw32ce)
have_wince="yes"
win32_libs="-lws2" win32_libs="-lws2"
;; ;;
*) *)
@ -28,6 +31,12 @@ esac
AC_SUBST(win32_cflags) AC_SUBST(win32_cflags)
AC_SUBST(win32_libs) AC_SUBST(win32_libs)
if test "x${have_wince}" = "xyes" ; then
AC_DEFINE(EVIL_HAVE_WINCE, 1, [Define to mention that Windows CE is the target])
fi
AM_CONDITIONAL(EVIL_HAVE_WINCE, test "x${have_wince}" = "xyes")
dnl needed for correct definition of EAPI dnl needed for correct definition of EAPI
AC_DEFINE(EFL_EVIL_BUILD, 1, [Define to mention that evil is built]) AC_DEFINE(EFL_EVIL_BUILD, 1, [Define to mention that evil is built])
AC_DEFINE(EFL_EVIL_DLFCN_BUILD, 1, [Define to mention that evil dlfcn is built]) AC_DEFINE(EFL_EVIL_DLFCN_BUILD, 1, [Define to mention that evil dlfcn is built])

View File

@ -11,7 +11,14 @@ AM_CFLAGS = @win32_cflags@
bin_PROGRAMS = suite test_dlfcn test_pipe test_evil bin_PROGRAMS = suite test_dlfcn test_pipe test_evil
suite_SOURCES = suite.c test_memcpy.c memcpy_glibc.S suite_SOURCES = suite.c test_memcpy.c
if EVIL_HAVE_WINCE
suite_SOURCES += memcpy_glibc.S
endif
suite_LDADD = $(top_builddir)/src/lib/libevil.la suite_LDADD = $(top_builddir)/src/lib/libevil.la
suite_LDFLAGS = -Wl,--enable-auto-import suite_LDFLAGS = -Wl,--enable-auto-import
suite_DEPENDENCIES = $(top_builddir)/src/lib/libevil.la suite_DEPENDENCIES = $(top_builddir)/src/lib/libevil.la

View File

@ -7,6 +7,10 @@
#include <windows.h> #include <windows.h>
#undef WIN32_LEAN_AND_MEAN #undef WIN32_LEAN_AND_MEAN
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif /* HAVE_CONFIG_H */
#include "suite.h" #include "suite.h"
#include "test_memcpy.h" #include "test_memcpy.h"
@ -70,7 +74,9 @@ test_memcpy_tests_run(size_t align1, size_t align2, size_t len)
printf ("length: %6d, align %2d/%2d:", (int)len, align1, align2); printf ("length: %6d, align %2d/%2d:", (int)len, align1, align2);
test_memcpy_test_run(memcpy, s2, s1, len); test_memcpy_test_run(memcpy, s2, s1, len);
#ifdef EVIL_HAVE_WINCE
test_memcpy_test_run(memcpy_glibc, s2, s1, len); test_memcpy_test_run(memcpy_glibc, s2, s1, len);
#endif /* EVIL_HAVE_WINCE */
printf ("\n"); printf ("\n");
} }

View File

@ -1,9 +1,10 @@
#include <stdlib.h>
#include <stdio.h>
# define WIN32_LEAN_AND_MEAN # define WIN32_LEAN_AND_MEAN
# include <winsock2.h> # include <winsock2.h>
# undef WIN32_LEAN_AND_MEAN # undef WIN32_LEAN_AND_MEAN
#include <stdio.h>
#include "Evil.h" #include "Evil.h"
#define FDREAD 0 #define FDREAD 0
@ -34,7 +35,6 @@ int
main (int argc, char *argv[]) main (int argc, char *argv[])
{ {
int sockets[2]; int sockets[2];
WSADATA version_data;
int ret; int ret;
fd_set rfds; fd_set rfds;
struct timeval t; struct timeval t;
@ -42,25 +42,28 @@ main (int argc, char *argv[])
DWORD thread_id; DWORD thread_id;
HANDLE h; HANDLE h;
if (!evil_sockets_init())
return EXIT_FAILURE;
FD_ZERO(&rfds); FD_ZERO(&rfds);
t.tv_sec = 5; t.tv_sec = 5;
t.tv_usec = 0; t.tv_usec = 0;
WSAStartup(MAKEWORD(2, 2), &version_data);
if (pipe(sockets) < 0) if (pipe(sockets) < 0)
{ {
printf ("error\n"); printf ("can not create sockets\n");
return -1; evil_sockets_shutdown();
return EXIT_FAILURE;
} }
FD_SET(sockets[FDREAD], &rfds); FD_SET(sockets[FDREAD], &rfds);
d = (data *)malloc(sizeof (data)); d = (data *)malloc(sizeof (data));
d->val = 14; d->val = 14;
d->fd_write = sockets[FDWRITE]; d->fd_write = sockets[FDWRITE];
printf (" pointeur sent........: %p\n", d); printf (" pointeur sent........: %p\n", d);
h = CreateThread (NULL, 0, thread, d, 0, &thread_id); h = CreateThread(NULL, 0, thread, d, 0, &thread_id);
ret = select(sockets[FDREAD] + 1, &rfds, NULL, NULL, &t); ret = select(sockets[FDREAD] + 1, &rfds, NULL, NULL, &t);
@ -91,5 +94,7 @@ main (int argc, char *argv[])
CloseHandle (h); CloseHandle (h);
return 0; evil_sockets_shutdown();
return EXIT_SUCCESS;
} }

View File

@ -74,9 +74,9 @@ symlink(const char *oldpath, const char *newpath)
return res ? 0 : -1; return res ? 0 : -1;
#else #else
#ifdef UNICODE # ifdef UNICODE
wchar_t new_path[MB_CUR_MAX]; wchar_t new_path[MB_CUR_MAX];
#endif /* UNICODE */ # endif /* UNICODE */
IShellLink *pISL; IShellLink *pISL;
IShellLink **shell_link; IShellLink **shell_link;
IPersistFile *pIPF; IPersistFile *pIPF;
@ -108,14 +108,14 @@ symlink(const char *oldpath, const char *newpath)
if (FAILED(pISL->lpVtbl->QueryInterface(pISL, &IID_IPersistFile, (void **)persit_file))) if (FAILED(pISL->lpVtbl->QueryInterface(pISL, &IID_IPersistFile, (void **)persit_file)))
goto no_queryinterface; goto no_queryinterface;
#ifdef UNICODE # ifdef UNICODE
mbstowcs(new_path, newpath, MB_CUR_MAX); mbstowcs(new_path, newpath, MB_CUR_MAX);
if (FAILED(pIPF->lpVtbl->Save(pIPF, new_path, FALSE))) if (FAILED(pIPF->lpVtbl->Save(pIPF, new_path, FALSE)))
goto no_save; goto no_save;
#else # else
if (FAILED(pIPF->lpVtbl->Save(pIPF, newpath, FALSE))) if (FAILED(pIPF->lpVtbl->Save(pIPF, newpath, FALSE)))
goto no_save; goto no_save;
#endif /* ! UNICODE */ # endif /* ! UNICODE */
pIPF->lpVtbl->Release(pIPF); pIPF->lpVtbl->Release(pIPF);
pISL->lpVtbl->Release(pISL); pISL->lpVtbl->Release(pISL);
@ -169,9 +169,9 @@ readlink(const char *path, char *buf, size_t bufsiz)
return length; return length;
#else #else
#ifdef UNICODE # ifdef UNICODE
wchar_t old_path[MB_CUR_MAX]; wchar_t old_path[MB_CUR_MAX];
#endif /* UNICODE */ # endif /* UNICODE */
char new_path[PATH_MAX]; char new_path[PATH_MAX];
IShellLink *pISL; IShellLink *pISL;
IShellLink **shell_link; IShellLink **shell_link;
@ -197,14 +197,14 @@ readlink(const char *path, char *buf, size_t bufsiz)
(void **)persit_file))) (void **)persit_file)))
goto no_instance; goto no_instance;
#ifdef UNICODE # ifdef UNICODE
mbstowcs(old_path, path, MB_CUR_MAX); mbstowcs(old_path, path, MB_CUR_MAX);
if (FAILED(pIPF->lpVtbl->Load(pIPF, old_path, STGM_READWRITE))) if (FAILED(pIPF->lpVtbl->Load(pIPF, old_path, STGM_READWRITE)))
goto no_load; goto no_load;
#else # else
if (FAILED(pIPF->lpVtbl->Load(pIPF, path, STGM_READWRITE))) if (FAILED(pIPF->lpVtbl->Load(pIPF, path, STGM_READWRITE)))
goto no_load; goto no_load;
#endif /* ! UNICODE */ # endif /* ! UNICODE */
shell_link = &pISL; shell_link = &pISL;
if (FAILED(pIPF->lpVtbl->QueryInterface(pIPF, &IID_IShellLink, (void **)shell_link))) if (FAILED(pIPF->lpVtbl->QueryInterface(pIPF, &IID_IShellLink, (void **)shell_link)))
@ -297,7 +297,7 @@ evil_sockets_init(void)
{ {
WSADATA wsa_data; WSADATA wsa_data;
return (WSAStartup(MAKEWORD( 2, 2 ), &wsa_data) == 0) ? 1 : 0; return (WSAStartup(MAKEWORD(2, 2), &wsa_data) == 0) ? 1 : 0;
} }
void void