1
0
mirror of https://github.com/upx/upx synced 2025-09-28 19:06:07 +08:00

Misc cleanups.

committer: mfx <mfx> 1088804669 +0000
This commit is contained in:
Markus F.X.J. Oberhumer 2004-07-02 21:44:29 +00:00
parent f412b5e0cd
commit 61594f7873
8 changed files with 47 additions and 33 deletions

View File

@ -1,6 +1,7 @@
_darcs
B
ChangeLog.cvs*
TODO.*
build
doxygen
maint

View File

@ -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

View File

@ -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"

View File

@ -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"),

View File

@ -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);

View File

@ -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" : "");
}
}

View File

@ -35,13 +35,10 @@
/* avoid -W4 warnings in <windows.h> */
# 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"
/*************************************************************************

View File

@ -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 <class T>
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;
}