diff --git a/build-win32 b/build-win32 index 36bad8d..b5be83b 100755 --- a/build-win32 +++ b/build-win32 @@ -25,10 +25,6 @@ cd "${BUILDDIR}" make pkglibdir=/lib pkgdatadir=/data bindir=/bin # Install into our private directory make install DESTDIR="${INSTALLDIR}" pkglibdir=/lib/ pkgdatadir=/ bindir=/bin/ -# Create a launcher -echo 'int main(int argc, char *argv[], char *envp[]) { argv[0] = ".\\bin\\ThePimp.exe"; execve(argv[0], argv, envp); return 0; }' > run.c -i586-mingw32msvc-gcc run.c -mwindows -o "${INSTALLDIR}/ThePimp.exe" -i586-mingw32msvc-strip "${INSTALLDIR}/ThePimp.exe" # Clean up cd "${SRCDIR}" rm -Rf "${BUILDDIR}" @@ -44,6 +40,13 @@ find "${INSTALLDIR}/" -name .svn -prune -exec rm -rf '{}' ';' mv "${INSTALLDIR}/lib/mono/gac/pipi-sharp/"*/* "${INSTALLDIR}/bin/" rm -Rf "${INSTALLDIR}/lib/mono" +# Install The Pimp +mv "${INSTALLDIR}/lib/ThePimp.exe" "${INSTALLDIR}/bin/" +echo 'int main(int argc, char *argv[], char *envp[]) { argv[0] = ".\\bin\\ThePimp.exe"; execve(argv[0], argv, envp); return 0; }' > run.c +i586-mingw32msvc-gcc run.c -mwindows -o "${INSTALLDIR}/ThePimp.exe" +i586-mingw32msvc-strip "${INSTALLDIR}/ThePimp.exe" + +# Install documentation mkdir "${INSTALLDIR}/doc" for f in COPYING NOTES; do sed -e 's/$/ /' < "${SRCDIR}/${f}" > "${INSTALLDIR}/doc/${f}.txt" diff --git a/pipi/Makefile.am b/pipi/Makefile.am index 946f514..951e022 100644 --- a/pipi/Makefile.am +++ b/pipi/Makefile.am @@ -113,7 +113,7 @@ codec_sources += codec/gdi.c endif if USE_GDIPLUS -codec_libs += -lgdiplus +codec_libs += -Wl,--exclude-symbols,$$(printf '\x7f')gdiplus_NULL_THUNK_DATA -lgdiplus codec_sources += codec/gdiplus.cpp endif diff --git a/pipi/codec/gdiplus.cpp b/pipi/codec/gdiplus.cpp index c387f8c..0138a79 100755 --- a/pipi/codec/gdiplus.cpp +++ b/pipi/codec/gdiplus.cpp @@ -33,11 +33,10 @@ extern "C" { extern "C" pipi_image_t *pipi_load_gdiplus(const char *name) { -#if 0 size_t len; len = mbstowcs(NULL, name, 0); wchar_t *wname = new wchar_t[len + 1]; - if(mbstowcs(wname, name, len + 1) != (size_t)-1) + if(mbstowcs(wname, name, len + 1) == (size_t)-1) { delete[] wname; return NULL; @@ -78,13 +77,10 @@ extern "C" pipi_image_t *pipi_load_gdiplus(const char *name) img->u8 = 1; return img; -#endif -return NULL; } extern "C" int pipi_save_gdiplus(pipi_image_t *img, const char *name) { -#if 0 wchar_t const *fmt; if(strstr(name, ".gif")) fmt = L"image/gif"; @@ -117,7 +113,7 @@ extern "C" int pipi_save_gdiplus(pipi_image_t *img, const char *name) size_t len; len = mbstowcs(NULL, name, 0); wchar_t *wname = new wchar_t[len + 1]; - if(mbstowcs(wname, name, len + 1) != (size_t)-1) + if(mbstowcs(wname, name, len + 1) == (size_t)-1) { delete[] wname; return -1; @@ -154,7 +150,6 @@ extern "C" int pipi_save_gdiplus(pipi_image_t *img, const char *name) delete[] wname; delete b; -#endif return 0; } diff --git a/win32/gdiplus/lib/libgdiplus.a b/win32/gdiplus/lib/libgdiplus.a index 71fff4a..189daaf 100644 Binary files a/win32/gdiplus/lib/libgdiplus.a and b/win32/gdiplus/lib/libgdiplus.a differ