Fix building with recent djgpp2 gcc-6 version.
This commit is contained in:
+1
-1
@@ -126,7 +126,7 @@ static int init(FILE *f, int o, int now)
|
|||||||
else
|
else
|
||||||
return CON_INIT;
|
return CON_INIT;
|
||||||
|
|
||||||
#if defined(__DJGPP__)
|
#if (ACC_OS_DOS32) && defined(__DJGPP__)
|
||||||
if (!screen)
|
if (!screen)
|
||||||
screen = do_construct(screen_djgpp2_construct(),fd);
|
screen = do_construct(screen_djgpp2_construct(),fd);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+1
-1
@@ -123,7 +123,7 @@ typedef unsigned char upx_byte;
|
|||||||
#undef small
|
#undef small
|
||||||
#undef tos
|
#undef tos
|
||||||
#undef unix
|
#undef unix
|
||||||
#if defined(__DJGPP__)
|
#if (ACC_OS_DOS32) && defined(__DJGPP__)
|
||||||
# undef sopen
|
# undef sopen
|
||||||
# undef __unix__
|
# undef __unix__
|
||||||
# undef __unix
|
# undef __unix
|
||||||
|
|||||||
+1
-1
@@ -56,7 +56,7 @@
|
|||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if 1 && defined(__DJGPP__)
|
#if 1 && (ACC_OS_DOS32) && defined(__DJGPP__)
|
||||||
# define USE_SCREEN 1
|
# define USE_SCREEN 1
|
||||||
#elif 1 && (ACC_OS_CYGWIN || ACC_OS_WIN32 || ACC_OS_WIN64)
|
#elif 1 && (ACC_OS_CYGWIN || ACC_OS_WIN32 || ACC_OS_WIN64)
|
||||||
# define USE_SCREEN 1
|
# define USE_SCREEN 1
|
||||||
|
|||||||
+2
-2
@@ -48,7 +48,7 @@ void File::chmod(const char *name, int mode)
|
|||||||
|
|
||||||
void File::rename(const char *old_, const char *new_)
|
void File::rename(const char *old_, const char *new_)
|
||||||
{
|
{
|
||||||
#if defined(__DJGPP__)
|
#if (ACC_OS_DOS32) && defined(__DJGPP__)
|
||||||
if (::_rename(old_,new_) != 0)
|
if (::_rename(old_,new_) != 0)
|
||||||
#else
|
#else
|
||||||
if (::rename(old_,new_) != 0)
|
if (::rename(old_,new_) != 0)
|
||||||
@@ -94,7 +94,7 @@ bool FileBase::do_sopen()
|
|||||||
_fd = ::open(_name, _flags, _mode);
|
_fd = ::open(_name, _flags, _mode);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
#if defined(__DJGPP__)
|
#if (ACC_OS_DOS32) && defined(__DJGPP__)
|
||||||
_fd = ::open(_name,_flags | _shflags, _mode);
|
_fd = ::open(_name,_flags | _shflags, _mode);
|
||||||
#elif defined(__MINT__)
|
#elif defined(__MINT__)
|
||||||
_fd = ::open(_name,_flags | (_shflags & O_SHMODE), _mode);
|
_fd = ::open(_name,_flags | (_shflags & O_SHMODE), _mode);
|
||||||
|
|||||||
+1
-1
@@ -91,7 +91,7 @@ void show_usage(void)
|
|||||||
FILE *f = con_term;
|
FILE *f = con_term;
|
||||||
|
|
||||||
con_fprintf(f,"Usage: %s [-123456789dlthVL] [-qvfk] [-o file] %sfile..\n", progname,
|
con_fprintf(f,"Usage: %s [-123456789dlthVL] [-qvfk] [-o file] %sfile..\n", progname,
|
||||||
#if defined(__DJGPP__) || defined(__EMX__)
|
#if (ACC_OS_DOS32) && defined(__DJGPP__)
|
||||||
"[@]");
|
"[@]");
|
||||||
#else
|
#else
|
||||||
"");
|
"");
|
||||||
|
|||||||
+3
-3
@@ -33,7 +33,7 @@
|
|||||||
#include "p_elf.h"
|
#include "p_elf.h"
|
||||||
|
|
||||||
|
|
||||||
#if 1 && defined(__DJGPP__)
|
#if 1 && (ACC_OS_DOS32) && defined(__DJGPP__)
|
||||||
#include <crt0.h>
|
#include <crt0.h>
|
||||||
int _crt0_startup_flags = _CRT0_FLAG_UNIX_SBRK;
|
int _crt0_startup_flags = _CRT0_FLAG_UNIX_SBRK;
|
||||||
#endif
|
#endif
|
||||||
@@ -61,7 +61,7 @@ void options_t::reset()
|
|||||||
o->preserve_timestamp = true;
|
o->preserve_timestamp = true;
|
||||||
|
|
||||||
o->console = CON_FILE;
|
o->console = CON_FILE;
|
||||||
#if defined(__DJGPP__)
|
#if (ACC_OS_DOS32) && defined(__DJGPP__)
|
||||||
o->console = CON_INIT;
|
o->console = CON_INIT;
|
||||||
#elif (USE_SCREEN_WIN32)
|
#elif (USE_SCREEN_WIN32)
|
||||||
o->console = CON_INIT;
|
o->console = CON_INIT;
|
||||||
@@ -1413,7 +1413,7 @@ int __acc_cdecl_main main(int argc, char *argv[])
|
|||||||
static char default_argv0[] = "upx";
|
static char default_argv0[] = "upx";
|
||||||
// int cmdline_cmd = CMD_NONE;
|
// int cmdline_cmd = CMD_NONE;
|
||||||
|
|
||||||
#if 0 && defined(__DJGPP__)
|
#if 0 && (ACC_OS_DOS32) && defined(__DJGPP__)
|
||||||
// LFN=n may cause problems with 2.03's _rename and mkdir under WinME
|
// LFN=n may cause problems with 2.03's _rename and mkdir under WinME
|
||||||
putenv("LFN=y");
|
putenv("LFN=y");
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+1
-1
@@ -638,7 +638,7 @@ unsigned Packer::getRandomId() const
|
|||||||
#endif
|
#endif
|
||||||
while (id == 0)
|
while (id == 0)
|
||||||
{
|
{
|
||||||
#if !(HAVE_GETTIMEOFDAY) || defined(__DJGPP__)
|
#if !(HAVE_GETTIMEOFDAY) || ((ACC_OS_DOS32) && defined(__DJGPP__))
|
||||||
id ^= (unsigned) time(NULL);
|
id ^= (unsigned) time(NULL);
|
||||||
id ^= ((unsigned) clock()) << 12;
|
id ^= ((unsigned) clock()) << 12;
|
||||||
#else
|
#else
|
||||||
|
|||||||
+6
-3
@@ -27,7 +27,10 @@
|
|||||||
|
|
||||||
#include "conf.h"
|
#include "conf.h"
|
||||||
|
|
||||||
#if (USE_SCREEN) && defined(__DJGPP__)
|
#if (USE_SCREEN) && (ACC_OS_DOS32) && defined(__DJGPP__)
|
||||||
|
#if (ACC_CC_GNUC >= 0x040300ul)
|
||||||
|
#pragma GCC diagnostic ignored "-Wvla"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "screen.h"
|
#include "screen.h"
|
||||||
|
|
||||||
@@ -248,7 +251,7 @@ static int init(screen_t *this, int fd) {
|
|||||||
if (getPage(this) != 0)
|
if (getPage(this) != 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
#if 1 && defined(__DJGPP__)
|
#if 1 && (ACC_OS_DOS32) && defined(__DJGPP__)
|
||||||
/* check for Windows NT/2000/XP */
|
/* check for Windows NT/2000/XP */
|
||||||
if (_get_dos_version(1) == 0x0532)
|
if (_get_dos_version(1) == 0x0532)
|
||||||
return -1;
|
return -1;
|
||||||
@@ -432,6 +435,6 @@ static const screen_t driver = {sobject_destroy, 0, /* finalize, */
|
|||||||
/* public constructor */
|
/* public constructor */
|
||||||
screen_t *screen_djgpp2_construct(void) { return sobject_construct(&driver, sizeof(*driver.data)); }
|
screen_t *screen_djgpp2_construct(void) { return sobject_construct(&driver, sizeof(*driver.data)); }
|
||||||
|
|
||||||
#endif /* (USE_SCREEN) && defined(__DJGPP__) */
|
#endif /* (USE_SCREEN) && (ACC_OS_DOS32) && defined(__DJGPP__) */
|
||||||
|
|
||||||
/* vim:set ts=4 sw=4 et: */
|
/* vim:set ts=4 sw=4 et: */
|
||||||
|
|||||||
+1
-1
@@ -105,7 +105,7 @@ static void init_global_constants(void) {
|
|||||||
return;
|
return;
|
||||||
done = true;
|
done = true;
|
||||||
|
|
||||||
#if 1 && defined(__DJGPP__)
|
#if 1 && (ACC_OS_DOS32) && defined(__DJGPP__)
|
||||||
/* check for Windows NT/2000/XP */
|
/* check for Windows NT/2000/XP */
|
||||||
if (_get_dos_version(1) == 0x0532)
|
if (_get_dos_version(1) == 0x0532)
|
||||||
return;
|
return;
|
||||||
|
|||||||
+5
-15
@@ -587,24 +587,14 @@ extern "C" {
|
|||||||
int dup(int fd) { UNUSED(fd); return -1; }
|
int dup(int fd) { UNUSED(fd); return -1; }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__DJGPP__)
|
#if (ACC_OS_DOS32) && defined(__DJGPP__)
|
||||||
int _is_executable(const char *, int, const char *)
|
//int _is_executable(const char *, int, const char *) { return 0; }
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// FIXME: something wants to link in ctime.o
|
// FIXME: something wants to link in ctime.o
|
||||||
time_t XXX_mktime(struct tm *)
|
//time_t mktime(struct tm *) { return 0; }
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
time_t time(time_t *t)
|
//time_t time(time_t *t) { if (t) *t = 0; return 0; }
|
||||||
{
|
#endif
|
||||||
if (t) *t = 0;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
#endif /* __DJGPP__ */
|
|
||||||
|
|
||||||
|
|
||||||
} // extern "C"
|
} // extern "C"
|
||||||
|
|||||||
+1
-1
@@ -33,7 +33,7 @@
|
|||||||
#include "ui.h"
|
#include "ui.h"
|
||||||
|
|
||||||
|
|
||||||
#if defined(__DJGPP__)
|
#if (ACC_OS_DOS32) && defined(__DJGPP__)
|
||||||
# define USE_FTIME 1
|
# define USE_FTIME 1
|
||||||
#elif (ACC_OS_WIN32 && ACC_CC_MWERKS) && defined(__MSL__)
|
#elif (ACC_OS_WIN32 && ACC_CC_MWERKS) && defined(__MSL__)
|
||||||
# include <utime.h>
|
# include <utime.h>
|
||||||
|
|||||||
Reference in New Issue
Block a user