mirror of
https://github.com/upx/upx
synced 2025-09-28 19:06:07 +08:00
Portability updates.
committer: mfx <mfx> 1054071025 +0000
This commit is contained in:
parent
757bdd1264
commit
b2949259c5
|
@ -149,7 +149,7 @@ ifeq ($(DEBUG),0)
|
||||||
##LDFLAGS += -static
|
##LDFLAGS += -static
|
||||||
STUBEDIT_EXE = objcopy -S -R .comment -R .note $@
|
STUBEDIT_EXE = objcopy -S -R .comment -R .note $@
|
||||||
ifeq ($(arch),i386)
|
ifeq ($(arch),i386)
|
||||||
STUBIFY_EXE = perl $(srcdir)/stub/scripts/brandelf.pl $@
|
## STUBIFY_EXE = perl $(srcdir)/stub/scripts/brandelf.pl $@
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
CHMOD_EXE = chmod 755 $@
|
CHMOD_EXE = chmod 755 $@
|
||||||
|
@ -158,7 +158,7 @@ endif # linux
|
||||||
|
|
||||||
|
|
||||||
###
|
###
|
||||||
### linux/i386 - Intel C++ 7.0
|
### linux/i386 - Intel C++ 7.x
|
||||||
###
|
###
|
||||||
|
|
||||||
ifeq ($(target),linux-intelc70)
|
ifeq ($(target),linux-intelc70)
|
||||||
|
@ -183,6 +183,30 @@ LDFLAGS += -Wl,-Map,$T.map
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
###
|
||||||
|
### linux/i386 - Borland C++ 5.7 (Kylix 3)
|
||||||
|
###
|
||||||
|
|
||||||
|
ifeq ($(target),linux-bc57)
|
||||||
|
##DEPMODE := XXX_linux
|
||||||
|
CC = bc++ -q -3
|
||||||
|
CFLAGS = -w -w-aus -w-inl -w!
|
||||||
|
CFLAGS_OUTPUT = -o$@
|
||||||
|
LDFLAGS += -ls
|
||||||
|
LINK_EXE_OUTPUT = -e$@
|
||||||
|
ifeq ($(WITH_ZLIB),1)
|
||||||
|
LDLIBS += -lz
|
||||||
|
endif
|
||||||
|
ifeq ($(DEBUG),1)
|
||||||
|
CFLAGS += -Od -d
|
||||||
|
else
|
||||||
|
CFLAGS += -O2 -d
|
||||||
|
endif
|
||||||
|
# transform `-lxx -lyy' into `libxx.a libyy.a'
|
||||||
|
LDLIBS := $(shell echo "$(LDLIBS)" | perl -pe 's/-l(.*?)\b/lib\1.a/g')
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
###
|
###
|
||||||
### Linux cross compilers
|
### Linux cross compilers
|
||||||
###
|
###
|
||||||
|
@ -297,14 +321,14 @@ endif
|
||||||
|
|
||||||
|
|
||||||
###
|
###
|
||||||
### win32 - Borland C++ 5.5.1
|
### win32 - Borland C++
|
||||||
###
|
###
|
||||||
|
|
||||||
ifeq ($(target),bc)
|
ifeq ($(target),bc)
|
||||||
o = .obj
|
o = .obj
|
||||||
a = .lib
|
a = .lib
|
||||||
e = .exe
|
e = .exe
|
||||||
CC = bcc32 -q -3
|
CC = bcc32 -q -6
|
||||||
CFLAGS = -w -w-aus -w-inl -g1
|
CFLAGS = -w -w-aus -w-inl -g1
|
||||||
CFLAGS_OUTPUT = -o$@
|
CFLAGS_OUTPUT = -o$@
|
||||||
LDFLAGS = -ls
|
LDFLAGS = -ls
|
||||||
|
@ -326,7 +350,7 @@ endif # bc
|
||||||
|
|
||||||
|
|
||||||
###
|
###
|
||||||
### win32 - Digital Mars C++ 8.33
|
### win32 - Digital Mars C++
|
||||||
###
|
###
|
||||||
|
|
||||||
ifeq ($(target),dm)
|
ifeq ($(target),dm)
|
||||||
|
@ -356,7 +380,7 @@ endif # dm
|
||||||
|
|
||||||
|
|
||||||
###
|
###
|
||||||
### win32 - Intel C++ 7.0
|
### win32 - Intel C++
|
||||||
###
|
###
|
||||||
|
|
||||||
ifeq ($(target),ic)
|
ifeq ($(target),ic)
|
||||||
|
@ -390,7 +414,7 @@ endif # ic
|
||||||
|
|
||||||
|
|
||||||
###
|
###
|
||||||
### win32 - Visual C++ 6
|
### win32 - Visual C++
|
||||||
###
|
###
|
||||||
|
|
||||||
ifeq ($(target),vc)
|
ifeq ($(target),vc)
|
||||||
|
@ -524,17 +548,6 @@ distclean: clean
|
||||||
maintainer-clean: distclean
|
maintainer-clean: distclean
|
||||||
|
|
||||||
|
|
||||||
untabify:
|
|
||||||
mfxtu -d4 -t *.ch *.cpp *.h
|
|
||||||
mfxtu -d8 -t stub/[ln]*.asm stub/*.ash stub/*.[cs]
|
|
||||||
|
|
||||||
tags TAGS:
|
|
||||||
ctags *.ch *.cpp *.h
|
|
||||||
|
|
||||||
ID:
|
|
||||||
mkid *.ch *.cpp *.h
|
|
||||||
|
|
||||||
|
|
||||||
# /***********************************************************************
|
# /***********************************************************************
|
||||||
# // rules
|
# // rules
|
||||||
# ************************************************************************/
|
# ************************************************************************/
|
||||||
|
@ -545,11 +558,6 @@ ID:
|
||||||
%$o : %.cpp
|
%$o : %.cpp
|
||||||
$(strip $(CXX_COMPILE))
|
$(strip $(CXX_COMPILE))
|
||||||
|
|
||||||
ifneq ($(strip $(OBJECTS2)),)
|
|
||||||
$(OBJECTS2): %$o : %.cpp
|
|
||||||
$(strip $(CXX_COMPILE))
|
|
||||||
endif
|
|
||||||
|
|
||||||
%.res : %.rc
|
%.res : %.rc
|
||||||
rc -l 0x409 -fo$@ $<
|
rc -l 0x409 -fo$@ $<
|
||||||
|
|
||||||
|
|
24
src/bele.h
24
src/bele.h
|
@ -339,18 +339,18 @@ inline T* operator - (T* ptr, const LE32& v) { return ptr - (unsigned) v; }
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
// for use with qsort()
|
// for use with qsort()
|
||||||
int be16_compare(const void *e1, const void *e2);
|
int __UPX_CDECL be16_compare(const void *e1, const void *e2);
|
||||||
int be24_compare(const void *e1, const void *e2);
|
int __UPX_CDECL be24_compare(const void *e1, const void *e2);
|
||||||
int be32_compare(const void *e1, const void *e2);
|
int __UPX_CDECL be32_compare(const void *e1, const void *e2);
|
||||||
int le16_compare(const void *e1, const void *e2);
|
int __UPX_CDECL le16_compare(const void *e1, const void *e2);
|
||||||
int le24_compare(const void *e1, const void *e2);
|
int __UPX_CDECL le24_compare(const void *e1, const void *e2);
|
||||||
int le32_compare(const void *e1, const void *e2);
|
int __UPX_CDECL le32_compare(const void *e1, const void *e2);
|
||||||
int be16_compare_signed(const void *e1, const void *e2);
|
int __UPX_CDECL be16_compare_signed(const void *e1, const void *e2);
|
||||||
int be24_compare_signed(const void *e1, const void *e2);
|
int __UPX_CDECL be24_compare_signed(const void *e1, const void *e2);
|
||||||
int be32_compare_signed(const void *e1, const void *e2);
|
int __UPX_CDECL be32_compare_signed(const void *e1, const void *e2);
|
||||||
int le16_compare_signed(const void *e1, const void *e2);
|
int __UPX_CDECL le16_compare_signed(const void *e1, const void *e2);
|
||||||
int le24_compare_signed(const void *e1, const void *e2);
|
int __UPX_CDECL le24_compare_signed(const void *e1, const void *e2);
|
||||||
int le32_compare_signed(const void *e1, const void *e2);
|
int __UPX_CDECL le32_compare_signed(const void *e1, const void *e2);
|
||||||
|
|
||||||
|
|
||||||
// just for testing...
|
// just for testing...
|
||||||
|
|
|
@ -88,7 +88,7 @@ static screen_t *do_construct(screen_t *s, int fd)
|
||||||
|
|
||||||
static screen_t *screen = NULL;
|
static screen_t *screen = NULL;
|
||||||
|
|
||||||
static void do_destroy(void)
|
static void __UPX_CDECL do_destroy(void)
|
||||||
{
|
{
|
||||||
if (screen)
|
if (screen)
|
||||||
{
|
{
|
||||||
|
|
|
@ -41,6 +41,9 @@
|
||||||
#endif
|
#endif
|
||||||
#include "acc/acc.h"
|
#include "acc/acc.h"
|
||||||
#include "acc/acc_ince.h"
|
#include "acc/acc_ince.h"
|
||||||
|
#if defined(INVALID_HANDLE_VALUE) || defined(MAKEWORD) || defined(RT_CURSOR)
|
||||||
|
# error "something pulled in <windows.h>"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#if defined(__BORLANDC__)
|
#if defined(__BORLANDC__)
|
||||||
|
@ -77,6 +80,7 @@
|
||||||
# endif
|
# endif
|
||||||
# define __UPX_CDECL __cdecl
|
# define __UPX_CDECL __cdecl
|
||||||
# define SIGTYPEENTRY __cdecl
|
# define SIGTYPEENTRY __cdecl
|
||||||
|
# pragma warning(disable: 4096) // __cdecl + '...'
|
||||||
# pragma warning(disable: 4097) // W3: typedef-name 'A' used as synonym for class-name 'B'
|
# pragma warning(disable: 4097) // W3: typedef-name 'A' used as synonym for class-name 'B'
|
||||||
# pragma warning(disable: 4511) // W3: 'class': copy constructor could not be generated
|
# pragma warning(disable: 4511) // W3: 'class': copy constructor could not be generated
|
||||||
# pragma warning(disable: 4512) // W4: 'class': assignment operator could not be generated
|
# pragma warning(disable: 4512) // W4: 'class': assignment operator could not be generated
|
||||||
|
@ -86,12 +90,15 @@
|
||||||
# if (__WATCOMC__ < 1100)
|
# if (__WATCOMC__ < 1100)
|
||||||
# error "need Watcom C++ 11.0c or newer"
|
# error "need Watcom C++ 11.0c or newer"
|
||||||
# endif
|
# endif
|
||||||
# define __UPX_CDECL __cdecl
|
|
||||||
# if defined(__cplusplus)
|
# if defined(__cplusplus)
|
||||||
# pragma warning 656 9 // w5: define this function inside its class definition (may improve code quality)
|
# pragma warning 656 9 // w5: define this function inside its class definition (may improve code quality)
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if !defined(__UPX_CDECL)
|
||||||
|
# define __UPX_CDECL
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
//
|
//
|
||||||
|
|
|
@ -1034,7 +1034,7 @@ void upx_sanity_check(void)
|
||||||
COMPILE_TIME_ASSERT(sizeof(LE16) == 2);
|
COMPILE_TIME_ASSERT(sizeof(LE16) == 2);
|
||||||
COMPILE_TIME_ASSERT(sizeof(LE32) == 4);
|
COMPILE_TIME_ASSERT(sizeof(LE32) == 4);
|
||||||
|
|
||||||
#if defined(__GNUC__) || defined(__INTEL_COMPILER)
|
#if defined(__GNUC__) || (ACC_CC_INTELC >= 700)
|
||||||
COMPILE_TIME_ASSERT(__alignof__(BE16) == 1);
|
COMPILE_TIME_ASSERT(__alignof__(BE16) == 1);
|
||||||
COMPILE_TIME_ASSERT(__alignof__(BE32) == 1);
|
COMPILE_TIME_ASSERT(__alignof__(BE32) == 1);
|
||||||
COMPILE_TIME_ASSERT(__alignof__(LE16) == 1);
|
COMPILE_TIME_ASSERT(__alignof__(LE16) == 1);
|
||||||
|
@ -1118,7 +1118,7 @@ void upx_sanity_check(void)
|
||||||
|
|
||||||
#if !defined(WITH_GUI)
|
#if !defined(WITH_GUI)
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int __UPX_CDECL main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
static char default_argv0[] = "upx";
|
static char default_argv0[] = "upx";
|
||||||
|
|
10
src/msg.cpp
10
src/msg.cpp
|
@ -116,8 +116,16 @@ void printErr(const char *iname, const Throwable *e)
|
||||||
if (l < sizeof(buf) && e->getMsg())
|
if (l < sizeof(buf) && e->getMsg())
|
||||||
upx_snprintf(buf+l, sizeof(buf)-l, ": %s", e->getMsg());
|
upx_snprintf(buf+l, sizeof(buf)-l, ": %s", e->getMsg());
|
||||||
l = strlen(buf);
|
l = strlen(buf);
|
||||||
if (l < sizeof(buf) && e->getErrno())
|
if (l < sizeof(buf) && e->getErrno()) {
|
||||||
upx_snprintf(buf+l, sizeof(buf)-l, ": %s", strerror(e->getErrno()));
|
upx_snprintf(buf+l, sizeof(buf)-l, ": %s", strerror(e->getErrno()));
|
||||||
|
#if 1
|
||||||
|
// some compilers (e.g. Borland C++) put a trailing '\n'
|
||||||
|
// into strerror() result
|
||||||
|
l = strlen(buf);
|
||||||
|
while (l-- > 0 && (buf[l] == '\n' || buf[l] == ' '))
|
||||||
|
buf[l] = 0;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
pr_error(iname,buf,e->isWarning());
|
pr_error(iname,buf,e->isWarning());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -63,7 +63,7 @@ static const
|
||||||
|
|
||||||
#if defined(__BORLANDC__)
|
#if defined(__BORLANDC__)
|
||||||
# undef strcpy
|
# undef strcpy
|
||||||
# define strcpy(a,b) std::strcpy((char *)(a),(const char *)(b))
|
# define strcpy(a,b) strcpy((char *)(a),(const char *)(b))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -42,10 +42,12 @@
|
||||||
// direct screen access
|
// direct screen access
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
#if defined(_MSC_VER) && (_MSC_VER < 1200)
|
#if (ACC_CC_MSC && _MSC_VER >= 1000 && _MSC_VER < 1200)
|
||||||
# pragma warning(disable: 4201) // nonstandard extension used: nameless struct/union
|
/* avoid -W4 warnings in <conio.h> */
|
||||||
|
# pragma warning(disable: 4032)
|
||||||
|
/* avoid -W4 warnings in <windows.h> */
|
||||||
|
# pragma warning(disable: 4201 4214 4514)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__RSXNT__)
|
#if defined(__RSXNT__)
|
||||||
# define timeval win32_timeval /* struct timeval already in <sys/time.h> */
|
# define timeval win32_timeval /* struct timeval already in <sys/time.h> */
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -795,13 +795,13 @@ static int xdopr(char *buffer, size_t maxlen, const char *format, va_list args)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int upx_vsnprintf(char *str, size_t count, const char *format, va_list ap)
|
int __UPX_CDECL upx_vsnprintf(char *str, size_t count, const char *format, va_list ap)
|
||||||
{
|
{
|
||||||
return xdopr(str, count, format, ap);
|
return xdopr(str, count, format, ap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int upx_snprintf(char *str, size_t count, const char *format,...)
|
int __UPX_CDECL upx_snprintf(char *str, size_t count, const char *format,...)
|
||||||
{
|
{
|
||||||
va_list ap;
|
va_list ap;
|
||||||
int ret;
|
int ret;
|
||||||
|
@ -813,7 +813,7 @@ int upx_snprintf(char *str, size_t count, const char *format,...)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int upx_vasprintf(char **ptr, const char *format, va_list ap)
|
int __UPX_CDECL upx_vasprintf(char **ptr, const char *format, va_list ap)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
@ -832,7 +832,7 @@ int upx_vasprintf(char **ptr, const char *format, va_list ap)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int upx_asprintf(char **ptr, const char *format, ...)
|
int __UPX_CDECL upx_asprintf(char **ptr, const char *format, ...)
|
||||||
{
|
{
|
||||||
va_list ap;
|
va_list ap;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
|
@ -38,10 +38,10 @@ extern "C" {
|
||||||
//
|
//
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
int upx_vsnprintf(char *str, size_t count, const char *format, va_list ap);
|
int __UPX_CDECL upx_vsnprintf(char *str, size_t count, const char *format, va_list ap);
|
||||||
int upx_snprintf(char *str, size_t count, const char *format,...);
|
int __UPX_CDECL upx_snprintf(char *str, size_t count, const char *format,...);
|
||||||
int upx_vasprintf(char **ptr, const char *format, va_list ap);
|
int __UPX_CDECL upx_vasprintf(char **ptr, const char *format, va_list ap);
|
||||||
int upx_asprintf(char **ptr, const char *format, ...);
|
int __UPX_CDECL upx_asprintf(char **ptr, const char *format, ...);
|
||||||
|
|
||||||
#if 1
|
#if 1
|
||||||
# undef sprintf
|
# undef sprintf
|
||||||
|
|
|
@ -31,6 +31,17 @@
|
||||||
#include "stdcxx.h"
|
#include "stdcxx.h"
|
||||||
|
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
#undef _Nomemory
|
||||||
|
namespace std {
|
||||||
|
void __cdecl _Nomemory() {
|
||||||
|
static const bad_alloc ba;
|
||||||
|
throw ba;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#ifdef WANT_STL
|
#ifdef WANT_STL
|
||||||
|
|
||||||
#if defined(__GNUC__)
|
#if defined(__GNUC__)
|
||||||
|
|
|
@ -114,7 +114,9 @@ class bad_alloc { };
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#if defined(__EMX__)
|
#if defined(__BORLANDC__)
|
||||||
|
using namespace std;
|
||||||
|
#elif defined(__EMX__)
|
||||||
#define std
|
#define std
|
||||||
#elif defined(__WATCOMC__)
|
#elif defined(__WATCOMC__)
|
||||||
#define std
|
#define std
|
||||||
|
|
22
src/util.cpp
22
src/util.cpp
|
@ -29,6 +29,12 @@
|
||||||
#include "conf.h"
|
#include "conf.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
|
||||||
|
#if (ACC_CC_MSC && _MSC_VER >= 1000 && _MSC_VER < 1200)
|
||||||
|
/* avoid -W4 warnings in <conio.h> */
|
||||||
|
# pragma warning(disable: 4032)
|
||||||
|
/* avoid -W4 warnings in <windows.h> */
|
||||||
|
# pragma warning(disable: 4201 4214 4514)
|
||||||
|
#endif
|
||||||
#include "acc/acc_lib.ch"
|
#include "acc/acc_lib.ch"
|
||||||
|
|
||||||
|
|
||||||
|
@ -36,28 +42,28 @@
|
||||||
// qsort() util
|
// qsort() util
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
int be16_compare(const void *e1, const void *e2)
|
int __UPX_CDECL be16_compare(const void *e1, const void *e2)
|
||||||
{
|
{
|
||||||
const unsigned d1 = get_be16(e1);
|
const unsigned d1 = get_be16(e1);
|
||||||
const unsigned d2 = get_be16(e2);
|
const unsigned d2 = get_be16(e2);
|
||||||
return (d1 < d2) ? -1 : ((d1 > d2) ? 1 : 0);
|
return (d1 < d2) ? -1 : ((d1 > d2) ? 1 : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
int be32_compare(const void *e1, const void *e2)
|
int __UPX_CDECL be32_compare(const void *e1, const void *e2)
|
||||||
{
|
{
|
||||||
const unsigned d1 = get_be32(e1);
|
const unsigned d1 = get_be32(e1);
|
||||||
const unsigned d2 = get_be32(e2);
|
const unsigned d2 = get_be32(e2);
|
||||||
return (d1 < d2) ? -1 : ((d1 > d2) ? 1 : 0);
|
return (d1 < d2) ? -1 : ((d1 > d2) ? 1 : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
int le16_compare(const void *e1, const void *e2)
|
int __UPX_CDECL le16_compare(const void *e1, const void *e2)
|
||||||
{
|
{
|
||||||
const unsigned d1 = get_le16(e1);
|
const unsigned d1 = get_le16(e1);
|
||||||
const unsigned d2 = get_le16(e2);
|
const unsigned d2 = get_le16(e2);
|
||||||
return (d1 < d2) ? -1 : ((d1 > d2) ? 1 : 0);
|
return (d1 < d2) ? -1 : ((d1 > d2) ? 1 : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
int le32_compare(const void *e1, const void *e2)
|
int __UPX_CDECL le32_compare(const void *e1, const void *e2)
|
||||||
{
|
{
|
||||||
const unsigned d1 = get_le32(e1);
|
const unsigned d1 = get_le32(e1);
|
||||||
const unsigned d2 = get_le32(e2);
|
const unsigned d2 = get_le32(e2);
|
||||||
|
@ -65,28 +71,28 @@ int le32_compare(const void *e1, const void *e2)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int be16_compare_signed(const void *e1, const void *e2)
|
int __UPX_CDECL be16_compare_signed(const void *e1, const void *e2)
|
||||||
{
|
{
|
||||||
const int d1 = get_be16_signed(e1);
|
const int d1 = get_be16_signed(e1);
|
||||||
const int d2 = get_be16_signed(e2);
|
const int d2 = get_be16_signed(e2);
|
||||||
return (d1 < d2) ? -1 : ((d1 > d2) ? 1 : 0);
|
return (d1 < d2) ? -1 : ((d1 > d2) ? 1 : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
int be32_compare_signed(const void *e1, const void *e2)
|
int __UPX_CDECL be32_compare_signed(const void *e1, const void *e2)
|
||||||
{
|
{
|
||||||
const int d1 = get_be32_signed(e1);
|
const int d1 = get_be32_signed(e1);
|
||||||
const int d2 = get_be32_signed(e2);
|
const int d2 = get_be32_signed(e2);
|
||||||
return (d1 < d2) ? -1 : ((d1 > d2) ? 1 : 0);
|
return (d1 < d2) ? -1 : ((d1 > d2) ? 1 : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
int le16_compare_signed(const void *e1, const void *e2)
|
int __UPX_CDECL le16_compare_signed(const void *e1, const void *e2)
|
||||||
{
|
{
|
||||||
const int d1 = get_le16_signed(e1);
|
const int d1 = get_le16_signed(e1);
|
||||||
const int d2 = get_le16_signed(e2);
|
const int d2 = get_le16_signed(e2);
|
||||||
return (d1 < d2) ? -1 : ((d1 > d2) ? 1 : 0);
|
return (d1 < d2) ? -1 : ((d1 > d2) ? 1 : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
int le32_compare_signed(const void *e1, const void *e2)
|
int __UPX_CDECL le32_compare_signed(const void *e1, const void *e2)
|
||||||
{
|
{
|
||||||
const int d1 = get_le32_signed(e1);
|
const int d1 = get_le32_signed(e1);
|
||||||
const int d2 = get_le32_signed(e2);
|
const int d2 = get_le32_signed(e2);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user