From 0e723ff0866919cbc4ddfc3d7773c3485252eba3 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Thu, 24 Sep 2015 14:59:26 +0200 Subject: Bug 1231: Add Windows x86_64 test executable ; Use 'WinMain' for Windows test-executable ; Use CustomInflate for Performance - Use 'WinMain' for Windows test-executable This may have little difference than using std 'main' entry - Add Windows x86_64 test executable Since the reporter claims the test executable works well on Windows i386, maybe utilizing a x86_64 test executable on same VM fixes the issue - Use CustomInflate for Performance - Skips GZIP header - Adds own custom header [magic, deflate-size, inflate-size] - Own header allows simplified I/O read and deflation --- src/native/tinype/make.sh | 16 ++++++++++++---- src/native/tinype/tiny.c | 9 ++++++++- src/native/tinype/tiny2.c | 17 ++++++++++++----- 3 files changed, 32 insertions(+), 10 deletions(-) (limited to 'src/native') diff --git a/src/native/tinype/make.sh b/src/native/tinype/make.sh index 9a68f0d..b141066 100755 --- a/src/native/tinype/make.sh +++ b/src/native/tinype/make.sh @@ -1,7 +1,15 @@ -/cygdrive/c/mingw/bin/gcc -nodefaultlibs -nostdlib -s -Os -mwindows -o tiny2-win32-i386.exe tiny2.c +# /cygdrive/c/mingw/bin/gcc -nodefaultlibs -nostdlib -s -Os -mconsole -o tiny-conso-i386.exe tiny.c + +jardir=../../../build-win64 + +/cygdrive/c/mingw/bin/gcc -nodefaultlibs -nostdlib -s -Os -mwindows -o tiny2-win32-i386.exe tiny2.c -lUser32 +java -cp "$jardir/test/build/gluegen-test.jar;$jardir/gluegen-rt.jar" com.jogamp.common.util.CustomDeflate tiny2-win32-i386.exe exe2-windows-i386.defl + +/cygdrive/c/mingw64/bin/gcc -nodefaultlibs -nostdlib -s -Os -mwindows -o tiny2-win32-x86_64.exe tiny2.c -lUser32 +java -cp "$jardir/test/build/gluegen-test.jar;$jardir/gluegen-rt.jar" com.jogamp.common.util.CustomDeflate tiny2-win32-x86_64.exe exe2-windows-x86_64.defl /cygdrive/c/mingw/bin/gcc -nodefaultlibs -nostdlib -s -Os -mwindows -o tiny-win32-i386.exe tiny.c -gzip -9 -c tiny-win32-i386.exe > tiny-win32-i386.exe.gz +java -cp "$jardir/test/build/gluegen-test.jar;$jardir/gluegen-rt.jar" com.jogamp.common.util.CustomDeflate tiny-win32-i386.exe exe-windows-i386.defl -#/cygdrive/c/mingw64/bin/gcc -nodefaultlibs -nostdlib -s -Os -mwindows -o tiny-win32-x86_64.exe tiny.c -#gzip -9 -c tiny-win32-x86_64.exe > tiny-win32-x86_64.exe.gz +/cygdrive/c/mingw64/bin/gcc -nodefaultlibs -nostdlib -s -Os -mwindows -o tiny-win32-x86_64.exe tiny.c +java -cp "$jardir/test/build/gluegen-test.jar;$jardir/gluegen-rt.jar" com.jogamp.common.util.CustomDeflate tiny-win32-x86_64.exe exe-windows-x86_64.defl diff --git a/src/native/tinype/tiny.c b/src/native/tinype/tiny.c index 80f9518..6d2de3a 100644 --- a/src/native/tinype/tiny.c +++ b/src/native/tinype/tiny.c @@ -1,6 +1,13 @@ +#undef UNICODE +#define UNICODE +#include + // const char * id = "JogAmp Windows Universal Test PE Executable"; -int __main() +// int __main() +// int main() +// int main( int argc, char* argv[] ) +int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd) { return 0; } diff --git a/src/native/tinype/tiny2.c b/src/native/tinype/tiny2.c index d24c287..6330911 100644 --- a/src/native/tinype/tiny2.c +++ b/src/native/tinype/tiny2.c @@ -1,8 +1,15 @@ -#include -const char * id = "JogAmp Windows Universal Test PE Executable"; +#undef UNICODE +#define UNICODE +#include -int main() +const wchar_t * id = L"JogAmp Windows Universal Test PE Executable"; +const wchar_t * cap = L"JogAmp"; + +// int __main() +// int main() +// int main( int argc, char* argv[] ) +int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd) { - fprintf(stderr, "%s\n", id); - return 42; + MessageBox(0, id, cap, MB_SETFOREGROUND | MB_OK); + return 0; } -- cgit v1.2.3