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