forked from enlightenment/efl
* configure.ac:
* src/lib/Makefile.am: store cpp flags in a variable instead of using an automake conditional * src/bin/Makefile.am: * src/bin/evil_suite.c: * src/bin/evil_test_memcpy.c: add test for getenv / setenv. More tests on it will come later * src/lib/evil_stdlib.c: fix getenv code and minor cleanup SVN revision: 37004
This commit is contained in:
parent
f3252b5b6e
commit
44d632008b
|
@ -1,3 +1,19 @@
|
|||
2008-10-22 Vincent Torri <doursse at users dot sf dot net>
|
||||
|
||||
* configure.ac:
|
||||
* src/lib/Makefile.am:
|
||||
store cpp flags in a variable instead of using an
|
||||
automake conditional
|
||||
|
||||
* src/bin/Makefile.am:
|
||||
* src/bin/evil_suite.c:
|
||||
* src/bin/evil_test_memcpy.c:
|
||||
add test for getenv / setenv. More tests on it will
|
||||
come later
|
||||
|
||||
* src/lib/evil_stdlib.c:
|
||||
fix getenv code and minor cleanup
|
||||
|
||||
2008-10-21 Vincent Torri <doursse at users dot sf dot net>
|
||||
|
||||
* m4/ac_attribute.m4:
|
||||
|
|
|
@ -74,6 +74,7 @@ EFL_CHECK_DOXYGEN([build_doc="yes"], [build_doc="no"])
|
|||
AC_C_CONST
|
||||
AC_C___ATTRIBUTE__
|
||||
|
||||
win32_cppflags="-DEFL_EVIL_BUILD"
|
||||
win32_cflags=""
|
||||
have_wince="no"
|
||||
have_mingw32ce="no"
|
||||
|
@ -85,11 +86,14 @@ case "$host_os" in
|
|||
mingw32ce*)
|
||||
have_wince="yes"
|
||||
have_mingw32ce="yes"
|
||||
win32_cppflags="${win32_cppflags} -D_WIN32_WCE=0x0420"
|
||||
;;
|
||||
*)
|
||||
have_wince="no"
|
||||
win32_cppflags="${win32_cppflags} -D_WIN32_WINNT=0x0500"
|
||||
;;
|
||||
esac
|
||||
AC_SUBST(win32_cppflags)
|
||||
AC_SUBST(win32_cflags)
|
||||
|
||||
if test "x${have_wince}" = "xyes" ; then
|
||||
|
|
|
@ -11,7 +11,10 @@ AM_CFLAGS = @win32_cflags@
|
|||
|
||||
bin_PROGRAMS = evil_suite test_dlfcn test_pipe test_evil
|
||||
|
||||
evil_suite_SOURCES = evil_suite.c evil_test_memcpy.c
|
||||
evil_suite_SOURCES = \
|
||||
evil_suite.c \
|
||||
evil_test_environment.c \
|
||||
evil_test_memcpy.c
|
||||
|
||||
if EVIL_HAVE_WINCE
|
||||
|
||||
|
@ -38,4 +41,7 @@ test_evil_SOURCES = test_evil.c
|
|||
test_evil_LDADD = $(top_builddir)/src/lib/libevil.la
|
||||
test_evil_LDFLAGS = -Wl,--enable-auto-import
|
||||
|
||||
EXTRA_DIST = evil_suite.h evil_test_memcpy.h
|
||||
EXTRA_DIST = \
|
||||
evil_suite.h \
|
||||
evil_test_environment.h \
|
||||
evil_test_memcpy.h
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
#undef WIN32_LEAN_AND_MEAN
|
||||
|
||||
#include "evil_suite.h"
|
||||
#include "evil_test_environment.h"
|
||||
#include "evil_test_memcpy.h"
|
||||
|
||||
|
||||
|
@ -148,8 +149,9 @@ int
|
|||
main()
|
||||
{
|
||||
test tests[] = {
|
||||
{ "memcpy", test_memcpy },
|
||||
{ NULL, NULL },
|
||||
{ "environment", test_environment },
|
||||
{ "memcpy ", test_memcpy },
|
||||
{ NULL, NULL },
|
||||
};
|
||||
suite *s;
|
||||
int i;
|
||||
|
|
|
@ -36,8 +36,6 @@ getpagesize()
|
|||
static void
|
||||
test_memcpy_test_run(suite *s, memcpy_decl fct, char *dst, const char *src, size_t len)
|
||||
{
|
||||
double start;
|
||||
double end;
|
||||
double best;
|
||||
int i;
|
||||
|
||||
|
|
|
@ -38,18 +38,7 @@ evil_time.c \
|
|||
evil_unistd.c \
|
||||
evil_util.c
|
||||
|
||||
libevil_la_CPPFLAGS = -DEFL_EVIL_BUILD
|
||||
|
||||
if EVIL_HAVE_MINGW32CE
|
||||
|
||||
libevil_la_CPPFLAGS += -D_WIN32_WCE=0x0420
|
||||
|
||||
else
|
||||
|
||||
libevil_la_CPPFLAGS += -D_WIN32_WINNT=0x0500
|
||||
|
||||
endif
|
||||
|
||||
libevil_la_CPPFLAGS = @win32_cppflags@
|
||||
libevil_la_CFLAGS = @win32_cflags@
|
||||
libevil_la_LIBADD = @win32_libs@ $(EFL_MPATROL_LIBS)
|
||||
libevil_la_LDFLAGS = -no-undefined -Wl,--enable-auto-import -version-info @version_info@
|
||||
|
|
|
@ -49,7 +49,6 @@ getenv(const char *name)
|
|||
{
|
||||
HKEY key;
|
||||
wchar_t *wname;
|
||||
char *buffer;
|
||||
LONG res;
|
||||
DWORD type;
|
||||
DWORD size = PATH_MAX;
|
||||
|
@ -76,7 +75,7 @@ getenv(const char *name)
|
|||
|
||||
if ((res = RegQueryValueEx(key, wname,
|
||||
NULL, &type,
|
||||
(LPBYTE)&buffer,
|
||||
(LPBYTE)&_evil_stdlib_getenv_buffer,
|
||||
&size)) != ERROR_SUCCESS)
|
||||
{
|
||||
_evil_stdlib_error_display("getenv", res);
|
||||
|
@ -94,7 +93,7 @@ getenv(const char *name)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
if (buffer[0] == '\0')
|
||||
if (_evil_stdlib_getenv_buffer[0] == '\0')
|
||||
return NULL;
|
||||
else
|
||||
{
|
||||
|
@ -190,6 +189,7 @@ setenv(const char *name,
|
|||
HKEY key;
|
||||
LONG res;
|
||||
DWORD disposition;
|
||||
wchar_t *wname;
|
||||
|
||||
if (!name || !*name)
|
||||
return -1;
|
||||
|
@ -214,21 +214,32 @@ setenv(const char *name,
|
|||
if (!overwrite && (disposition == REG_OPENED_EXISTING_KEY))
|
||||
return 0;
|
||||
|
||||
wname = evil_char_to_wchar(name);
|
||||
if (!wname)
|
||||
{
|
||||
if ((res = RegCloseKey (key)) != ERROR_SUCCESS)
|
||||
_evil_stdlib_error_display("setenv", res);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if ((res = RegSetValueEx(key,
|
||||
(LPCWSTR)name,
|
||||
(LPCWSTR)wname,
|
||||
0, REG_SZ,
|
||||
(const BYTE *)value,
|
||||
strlen(value) + 1)) != ERROR_SUCCESS)
|
||||
{
|
||||
free(wname);
|
||||
_evil_stdlib_error_display("setenv", res);
|
||||
if ((res = RegCloseKey (key)) != ERROR_SUCCESS)
|
||||
_evil_stdlib_error_display("getenv", res);
|
||||
_evil_stdlib_error_display("setenv", res);
|
||||
return -1;
|
||||
}
|
||||
|
||||
free(wname);
|
||||
|
||||
if ((res = RegCloseKey (key)) != ERROR_SUCCESS)
|
||||
{
|
||||
_evil_stdlib_error_display("getenv", res);
|
||||
_evil_stdlib_error_display("setenv", res);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue