Fix compilation issues

This commit is contained in:
Alexander S. Aganichev 2003-04-03 14:11:03 +00:00
parent 73f64102bd
commit 1c8471befd
5 changed files with 25 additions and 11 deletions

View File

@ -19,7 +19,7 @@
*/
#if defined(UNIX) || defined(__MINGW32__) || defined(EMX) || defined(RSXNT) || defined(__DJGPP__) || defined(_MSC_VER)
#if defined(UNIX) || defined(__MINGW32__) || defined(__EMX__) || defined(RSXNT) || defined(__DJGPP__) || defined(_MSC_VER)
/* These are compilers that have both a working stat() and (important!) the
S_ISREG and S_ISDIR macros. The problem is that while stat() is POSIX, those
macros are not. For compilers that do not provide these macros, we revert to

View File

@ -43,9 +43,9 @@
#endif
#endif
#ifdef UNIX
/*#ifdef UNIX
#include "patmat.h"
#endif
#endif*/
/*
* FFindOpen; Use like MSDOS "find first" function, except be sure to
@ -118,6 +118,7 @@ FFIND *FFindOpen(const char *filespec, unsigned short attribute)
ff->ff_fdate = *((USHORT *) & findbuf.fdateLastWrite);
strncpy(ff->ff_name, findbuf.achName, sizeof(ff->ff_name));
ff->ff_name[sizeof(ff->ff_name) - 1] = '\0';
}
else
{
@ -166,6 +167,7 @@ FFIND *FFindOpen(const char *filespec, unsigned short attribute)
if (patmat(de->d_name, ff->lastbit))
{
strncpy(ff->ff_name, de->d_name, sizeof ff->ff_name);
ff->ff_name[sizeof(ff->ff_name) - 1] = '\0';
ff->ff_fsize = -1L; /* All who wants to know it's size
* must read it by himself
*/
@ -315,6 +317,7 @@ int FFindNext(FFIND * ff)
ff->ff_fdate = *((USHORT *) & findbuf.fdateLastWrite);
ff->ff_fsize = findbuf.cbFile;
strncpy(ff->ff_name, findbuf.achName, sizeof(ff->ff_name));
ff->ff_name[sizeof(ff->ff_name) - 1] = '\0';
rc = 0;
}
@ -337,6 +340,7 @@ int FFindNext(FFIND * ff)
if (patmat(de->d_name, ff->lastbit))
{
strncpy(ff->ff_name, de->d_name, sizeof ff->ff_name);
ff->ff_name[sizeof(ff->ff_name) - 1] = '\0';
ff->ff_fsize = -1L; /* All who wants to know it's size
* must read it by himself
*/
@ -480,6 +484,7 @@ FFIND *FindInfo(const char *filespec)
f++;
}
strncpy(ff->ff_name, f, sizeof(ff->ff_name));
ff->ff_name[sizeof(ff->ff_name) - 1] = '\0';
}
else
{

View File

@ -35,7 +35,7 @@
#if !defined(UNIX) && !defined(SASC)
# include <io.h>
#endif
#if defined(UNIX) || defined(__DJGPP__) || defined(EMX)
#if defined(UNIX) || defined(__DJGPP__) || defined(__EMX__)
# include <unistd.h>
#endif

View File

@ -12,6 +12,15 @@
#define TRUE 1
#endif
#if defined(__EMX__)
#if !defined(OS2)
#define OS2 1
#endif
#if !defined(__FLAT__)
#define __FLAT__ 1
#endif
#endif
#if defined(__MINGW32__)
/* mingw32 warnings */
#define NONAMELESSUNION

View File

@ -1,7 +1,7 @@
## ------------------------------------------------------------------
## Master build file.
## ------------------------------------------------------------------
genmsgid c all ovl bcd bco bcx wcn wco wcx lnx emx djg rsx cyg
ffind c all ovl bcd bco bcx wcn wco wcx lnx emx djg rsx cyg
fexist c all ovl bcd bco bcx wcn wco wcx lnx emx djg rsx cyg
patmat c all ovl bcd bco bcx wcn wco wcx lnx emx djg rsx
genmsgid c all ovl bcd bco bcx wcn wco wcx lnx emx djg rsx cyg be
ffind c all ovl bcd bco bcx wcn wco wcx lnx emx djg rsx cyg be
fexist c all ovl bcd bco bcx wcn wco wcx lnx emx djg rsx cyg be
patmat c all lnx be