diff --git a/src/c_screen.cpp b/src/c_screen.cpp index 7c25b48c..f46ecb6b 100644 --- a/src/c_screen.cpp +++ b/src/c_screen.cpp @@ -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 diff --git a/src/conf.h b/src/conf.h index e28a5ee4..484bfe50 100644 --- a/src/conf.h +++ b/src/conf.h @@ -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 diff --git a/src/console.h b/src/console.h index bbe9c88a..8dc87fc0 100644 --- a/src/console.h +++ b/src/console.h @@ -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 diff --git a/src/file.cpp b/src/file.cpp index af232492..7612829e 100644 --- a/src/file.cpp +++ b/src/file.cpp @@ -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); diff --git a/src/help.cpp b/src/help.cpp index d77bc69c..568cb318 100644 --- a/src/help.cpp +++ b/src/help.cpp @@ -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 ""); diff --git a/src/main.cpp b/src/main.cpp index 5d87877f..b2c3d93b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -33,7 +33,7 @@ #include "p_elf.h" -#if 1 && defined(__DJGPP__) +#if 1 && (ACC_OS_DOS32) && defined(__DJGPP__) #include 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 diff --git a/src/packer.cpp b/src/packer.cpp index b4e83b3c..bdc3e63d 100644 --- a/src/packer.cpp +++ b/src/packer.cpp @@ -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 diff --git a/src/s_djgpp2.cpp b/src/s_djgpp2.cpp index 3808c8fe..365ded1a 100644 --- a/src/s_djgpp2.cpp +++ b/src/s_djgpp2.cpp @@ -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: */ diff --git a/src/ui.cpp b/src/ui.cpp index e3da0983..f01b7442 100644 --- a/src/ui.cpp +++ b/src/ui.cpp @@ -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; diff --git a/src/util.cpp b/src/util.cpp index 265b5a78..3383614e 100644 --- a/src/util.cpp +++ b/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" diff --git a/src/work.cpp b/src/work.cpp index 695875f1..a98726b9 100644 --- a/src/work.cpp +++ b/src/work.cpp @@ -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