From e9e33d78603861b219611ad6bd71fd4c5ae6e4a2 Mon Sep 17 00:00:00 2001 From: "Alexander S. Aganichev" Date: Wed, 16 Apr 2003 08:43:49 +0000 Subject: [PATCH] Add QNX6 port (Mike Gorchak), remove obsolete stuff --- golded3/gcarea.cpp | 4 ++-- golded3/golded3.cpp | 5 +++++ goldlib/gall/gcmpall.h | 3 +++ goldlib/gall/gfile.cpp | 10 ---------- goldlib/gall/gfile.h | 2 -- goldlib/gall/gfilutil.h | 12 ++++-------- goldlib/gall/gstrall.h | 3 +++ 7 files changed, 17 insertions(+), 22 deletions(-) diff --git a/golded3/gcarea.cpp b/golded3/gcarea.cpp index 72bbb25..1625266 100644 --- a/golded3/gcarea.cpp +++ b/golded3/gcarea.cpp @@ -1016,9 +1016,9 @@ char* MapPath(char* map, bool reverse) { char sl1, sl2; char* ptr; - ptr = strpbrk(p, "/\\"); + ptr = strpbrk((char *)p, "/\\"); sl1 = ptr ? *ptr : NUL; - ptr = strpbrk(q, "/\\"); + ptr = strpbrk((char *)q, "/\\"); sl2 = ptr ? *ptr : NUL; if(sl1 and sl2 and (sl1 != sl2)) diff --git a/golded3/golded3.cpp b/golded3/golded3.cpp index 79ee69a..691c560 100644 --- a/golded3/golded3.cpp +++ b/golded3/golded3.cpp @@ -116,6 +116,11 @@ const char* __gver_shortver__ = __GVER_SVER__(__GVER_MAJOR__,__GVER_MINOR__,__GV #define __GVER_SHORTPLATFORM__ "BeOS" #define __GVER_SHORTLOGNAME__ "B" #define __GVER_CFGEXT__ ".gbe" +#elif defined(__QNXNTO__) +#define __GVER_PLATFORM__ "/QNX" +#define __GVER_SHORTPLATFORM__ "QNX" +#define __GVER_SHORTLOGNAME__ "Q" +#define __GVER_CFGEXT__ ".gqx" #elif defined(__UNIX__) #define __GVER_PLATFORM__ "/UNX" #define __GVER_SHORTPLATFORM__ "UNX" diff --git a/goldlib/gall/gcmpall.h b/goldlib/gall/gcmpall.h index c733483..9241adc 100644 --- a/goldlib/gall/gcmpall.h +++ b/goldlib/gall/gcmpall.h @@ -74,6 +74,9 @@ #if defined(__BEOS__) #define __UNIX__ __BEOS__ #endif + #if defined(__QNXNTO__) + #define __UNIX__ __QNXNTO__ + #endif #endif #ifdef __GNUC__ diff --git a/goldlib/gall/gfile.cpp b/goldlib/gall/gfile.cpp index 87d7209..0d40bab 100644 --- a/goldlib/gall/gfile.cpp +++ b/goldlib/gall/gfile.cpp @@ -225,16 +225,6 @@ int gfile::unlock(long __offset, long __len) { return _ret; } -// ------------------------------------------------------------------ - -int gfile::eof() { - - int _ret = ::eof(fh); - status = (_ret == -1) ? errno : 0; - return _ret; -} - - // ------------------------------------------------------------------ int gfile::getftime(dword* __ftime) { diff --git a/goldlib/gall/gfile.h b/goldlib/gall/gfile.h index f3759d8..de70b3e 100644 --- a/goldlib/gall/gfile.h +++ b/goldlib/gall/gfile.h @@ -112,8 +112,6 @@ public: int getftime (dword* __ftime); - int eof (); - // -------------------------------------------------------------- // ANSI-style streaming buffered I/O diff --git a/goldlib/gall/gfilutil.h b/goldlib/gall/gfilutil.h index 00f40bf..2e0c040 100644 --- a/goldlib/gall/gfilutil.h +++ b/goldlib/gall/gfilutil.h @@ -52,7 +52,7 @@ // ------------------------------------------------------------------M #if defined(__UNIX__) -#if !defined(__BEOS__) +#if !defined(__BEOS__) && !defined(__QNXNTO__) #define O_TEXT 0 #define O_BINARY 0 #endif @@ -236,22 +236,18 @@ int unlock(int handle, long offset, long length); #if !defined(__DJGPP__) && defined(__GNUC__) int lock(int handle, long offset, long length); int unlock(int handle, long offset, long length); +#if !defined(__QNXNTO__) && !defined(__MINGW32__) inline long tell(int fh) { return lseek(fh, 0, SEEK_CUR); } #endif +#endif -#if !defined(__MINGW32__) && !defined(__EMX__) && defined(__GNUC__) - -inline int eof(int h) { - return tell(h) > filelength(h); -} - +#if !defined(sopen) && !defined(__MINGW32__) && !defined(__EMX__) && !defined(__QNXNTO__) && defined(__GNUC__) inline int sopen(const char* path, int access, int shflag, int mode) { #ifdef __UNIX__ shflag = 0; #endif return open(path, access|shflag, mode); } - #endif #if defined(__UNIX__) || defined(__CYGWIN__) diff --git a/goldlib/gall/gstrall.h b/goldlib/gall/gstrall.h index 36efab1..b0a9efa 100644 --- a/goldlib/gall/gstrall.h +++ b/goldlib/gall/gstrall.h @@ -44,6 +44,9 @@ #define strupr(s) (char *)_nls_strupr((unsigned char *)(s)) #define strlwr(s) (char *)_nls_strlwr((unsigned char *)(s)) #elif defined(__GNUC__) +#if defined(__QNXNTO__) +#include +#endif #define stricmp strcasecmp #define strnicmp strncasecmp char* strupr(char* s);