diff --git a/.cvsignore b/.cvsignore index f06d6b53..4d49ed01 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1,6 +1,7 @@ _darcs B ChangeLog.cvs* +TODO.* build doxygen maint diff --git a/src/Makefile.bld b/src/Makefile.bld index 046d11ef..fbe7d5e9 100644 --- a/src/Makefile.bld +++ b/src/Makefile.bld @@ -440,14 +440,14 @@ LINK_EXE_OUTPUT = -Fe$@ LINK_EXE_LDFLAGS = /link /map:$T.map ##LINK_EXE_LDFLAGS += /verbose ifeq (1,2) - # statically link libc.lib - CC += -ML + # statically link libcmt.lib + CC += -MT ## DOS_LDLIBS := $(DOS_LDLIBS:.lib=_ml.lib) else # link against msvcrt.dll CC += -MD endif -LDLIBS = $(DOS_LDLIBS) setargv.obj +LDLIBS = $(DOS_LDLIBS) ifeq ($(DEBUG),1) CFLAGS += -Od -ZI LINK_EXE_LDFLAGS += /debug @@ -521,14 +521,14 @@ LINK_EXE_OUTPUT = -Fe$@ LINK_EXE_LDFLAGS = /link /map:$T.map ##LINK_EXE_LDFLAGS += /verbose ifeq (1,1) - # statically link libc.lib - CC += -ML + # statically link libcmt.lib + CC += -MT ## DOS_LDLIBS := $(DOS_LDLIBS:.lib=_ml.lib) else # link against msvcrt.dll CC += -MD endif -LDLIBS = $(DOS_LDLIBS) setargv.obj +LDLIBS = $(DOS_LDLIBS) ifeq ($(DEBUG),1) CFLAGS += -Od -ZI LINK_EXE_LDFLAGS += /debug @@ -590,14 +590,14 @@ LINK_EXE_OUTPUT = -Fe$@ LINK_EXE_LDFLAGS = /link /map:$T.map ##LINK_EXE_LDFLAGS += /verbose ifeq (1,2) - # statically link libc.lib - CC += -ML + # statically link libcmt.lib + CC += -MT ## DOS_LDLIBS := $(DOS_LDLIBS:.lib=_ml.lib) else # link against msvcrt.dll CC += -MD endif -LDLIBS = $(DOS_LDLIBS) setargv.obj +LDLIBS = $(DOS_LDLIBS) ifeq ($(DEBUG),1) CFLAGS += -Od -ZI LINK_EXE_LDFLAGS += /debug @@ -625,14 +625,14 @@ LINK_EXE_OUTPUT = -Fe$@ LINK_EXE_LDFLAGS = /link /map:$T.map ##LINK_EXE_LDFLAGS += /verbose ifeq (1,1) - # statically link libc.lib - CC += -ML + # statically link libcmt.lib + CC += -MT ## DOS_LDLIBS := $(DOS_LDLIBS:.lib=_ml.lib) else # link against msvcrt.dll CC += -MD endif -LDLIBS = $(DOS_LDLIBS) setargv.obj +LDLIBS = $(DOS_LDLIBS) ifeq ($(DEBUG),1) CFLAGS += -Od -ZI LINK_EXE_LDFLAGS += /debug diff --git a/src/conf.h b/src/conf.h index 516985fc..27a5b4b0 100644 --- a/src/conf.h +++ b/src/conf.h @@ -95,6 +95,9 @@ # pragma warning(disable: 4512) // W4: 'class': assignment operator could not be generated # pragma warning(disable: 4514) // W4: 'function': unreferenced inline function has been removed # pragma warning(disable: 4710) // W4: 'function': function not inlined +# if (_MSC_VER >= 1400) +# pragma warning(disable: 4996) // W1: 'function': was declared deprecated +# endif #elif (ACC_CC_WATCOMC) # if (__WATCOMC__ < 1100) # error "need Watcom C++ 11.0c or newer" diff --git a/src/help.cpp b/src/help.cpp index 5cc0adab..c3e590be 100644 --- a/src/help.cpp +++ b/src/help.cpp @@ -48,7 +48,7 @@ void show_head(void) fg = con_fg(f,FG_GREEN); con_fprintf(f, " Ultimate Packer for eXecutables\n" - " Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004\n" + " Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004\n" "UPX %-12s Markus F.X.J. Oberhumer & Laszlo Molnar %20s\n\n", #if (ACC_OS_DOS16 || ACC_OS_DOS32) V("d"), diff --git a/src/main.cpp b/src/main.cpp index 86b51965..6ad65067 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1088,15 +1088,12 @@ int __acc_cdecl_main main(int argc, char *argv[]) // LFN=n may cause problems with 2.03's _rename and mkdir under WinME putenv("LFN=y"); #endif -#if defined(__EMX__) - _response(&argc,&argv); - _wildcard(&argc,&argv); -#endif #if defined(__MINT__) __binmode(1); __set_binmode(stdout, 0); __set_binmode(stderr, 0); #endif + acc_wildargv(&argc, &argv); upx_sanity_check(); init_options(opt); diff --git a/src/ui.cpp b/src/ui.cpp index 9e5655a6..25095a2d 100644 --- a/src/ui.cpp +++ b/src/ui.cpp @@ -219,13 +219,14 @@ UiPacker::~UiPacker() void UiPacker::printInfo(int nl) { -#if 1 - char method_name[32+1]; - set_method_name(method_name, sizeof(method_name), p->ph.method, p->ph.level); - con_fprintf(stdout, "Compressing %s [%s, %s]%s", p->fi->getName(), p->getName(), method_name, nl ? "\n" : ""); -#else - con_fprintf(stdout, "Compressing %s [%s]%s", p->fi->getName(), p->getName(), nl ? "\n" : ""); -#endif + if (opt->all_methods && s->total_passes > 1) + con_fprintf(stdout, "Compressing %s [%s]%s", p->fi->getName(), p->getName(), nl ? "\n" : ""); + else + { + char method_name[32+1]; + set_method_name(method_name, sizeof(method_name), p->ph.method, p->ph.level); + con_fprintf(stdout, "Compressing %s [%s, %s]%s", p->fi->getName(), p->getName(), method_name, nl ? "\n" : ""); + } } diff --git a/src/util.cpp b/src/util.cpp index 96d1feb3..26601235 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -35,13 +35,10 @@ /* avoid -W4 warnings in */ # pragma warning(disable: 4201 4214 4514) #endif -#if 0 -# include "acc/acc_lib.ch" -#else -# include "acc/acc_inci.h" -# include "acc/acclib/misc.ch" -# include "acc/acclib/hsread.ch" -#endif +#include "acc/acc_inci.h" +#include "acc/acclib/misc.ch" +#include "acc/acclib/hsread.ch" +#include "acc/acclib/wildargv.ch" /************************************************************************* diff --git a/src/util.h b/src/util.h index f61fb82d..e21accff 100644 --- a/src/util.h +++ b/src/util.h @@ -65,9 +65,24 @@ upx_bytep pfind_le32(const void *b, int blen, unsigned what); #endif -inline ptrdiff_t ptr_diff(const void *p1, const void *p2) +#if (ACC_CC_BORLANDC && (__BORLANDC__ < 0x0530)) +#elif (ACC_CC_DMC && (__DMC__ < 0x830)) +#elif (ACC_CC_MSC && (_MSC_VER < 1310)) +#else +template +inline int ptr_diff(const T *p1, const T *p2) { - return (const char*) p1 - (const char*) p2; + COMPILE_TIME_ASSERT(sizeof(T) == 1) + ptrdiff_t d = (const char*) p1 - (const char*) p2; + assert((int)d == d); + return (int) d; +} +#endif +inline int ptr_diff(const void *p1, const void *p2) +{ + ptrdiff_t d = (const char*) p1 - (const char*) p2; + assert((int)d == d); + return (int) d; }