summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/3rdparty/libpng/pngconf.h11
-rw-r--r--src/3rdparty/sqlite/os.c426
-rw-r--r--src/3rdparty/sqlite/os.h46
-rw-r--r--src/3rdparty/zlib/minigzip.c3
-rw-r--r--src/3rdparty/zlib/zconf.h2
-rw-r--r--src/3rdparty/zlib/zconf.in.h2
-rw-r--r--src/3rdparty/zlib/zutil.h8
-rw-r--r--src/tools/tqglobal.cpp26
-rw-r--r--src/tools/tqglobal.h8
-rw-r--r--src/tqmoc/tqmoc.l24
-rw-r--r--src/tqmoc/tqmoc.pro12
-rw-r--r--src/tqmoc/tqmoc.y135
-rw-r--r--src/tqmoc/tqmoc_lex.cpp24
-rw-r--r--src/tqmoc/tqmoc_yacc.cpp135
14 files changed, 15 insertions, 847 deletions
diff --git a/src/3rdparty/libpng/pngconf.h b/src/3rdparty/libpng/pngconf.h
index 6c07bceab..313e4557d 100644
--- a/src/3rdparty/libpng/pngconf.h
+++ b/src/3rdparty/libpng/pngconf.h
@@ -225,13 +225,9 @@
#endif /* PNGARG */
-/* Try to determine if we are compiling on a Mac. Note that testing for
- * just __MWERKS__ is not good enough, because the Codewarrior is now used
- * on non-Mac platforms.
- */
+/* Try to determine if we are compiling on a Mac. */
#ifndef MACOS
-# if (defined(__MWERKS__) && defined(macintosh)) || defined(applec) || \
- defined(THINK_C) || defined(__SC__) || defined(TARGET_OS_MAC)
+# if defined(applec) || defined(THINK_C) || defined(__SC__) || defined(TARGET_OS_MAC)
# define MACOS
# endif
#endif
@@ -294,8 +290,7 @@
# endif
#endif
-/* Codewarrior on NT has linking problems without this. */
-#if (defined(__MWERKS__) && defined(WIN32)) || defined(__STDC__)
+#if defined(__STDC__)
# define PNG_ALWAYS_EXTERN
#endif
diff --git a/src/3rdparty/sqlite/os.c b/src/3rdparty/sqlite/os.c
index b4ae7a107..89f6c967a 100644
--- a/src/3rdparty/sqlite/os.c
+++ b/src/3rdparty/sqlite/os.c
@@ -41,16 +41,6 @@
# include <winbase.h>
#endif
-#if OS_MAC
-# include <extras.h>
-# include <path2fss.h>
-# include <TextUtils.h>
-# include <FinderRegistry.h>
-# include <Folders.h>
-# include <Timer.h>
-# include <OSUtils.h>
-#endif
-
/*
** The DJGPP compiler environment looks mostly like Unix, but it
** lacks the fcntl() system call. So redefine fcntl() to be something
@@ -74,10 +64,6 @@
#if OS_WIN && defined(THREADSAFE) && THREADSAFE
# define SQLITE_W32_THREADS 1
#endif
-#if OS_MAC && defined(THREADSAFE) && THREADSAFE
-# include <Multiprocessing.h>
-# define SQLITE_MACOS_MULTITASKING 1
-#endif
/*
** Macros for performance tracing. Normally turned off
@@ -394,9 +380,6 @@ int sqliteOsDelete(const char *zFilename){
#if OS_WIN
DeleteFile(zFilename);
#endif
-#if OS_MAC
- unlink(zFilename);
-#endif
return SQLITE_OK;
}
@@ -410,9 +393,6 @@ int sqliteOsFileExists(const char *zFilename){
#if OS_WIN
return GetFileAttributes(zFilename) != 0xffffffff;
#endif
-#if OS_MAC
- return access(zFilename, 0)==0;
-#endif
}
@@ -434,10 +414,6 @@ int sqliteOsFileRename(const char *zOldName, const char *zNewName){
}
return SQLITE_OK;
#endif
-#if OS_MAC
- /**** FIX ME ***/
- return SQLITE_ERROR;
-#endif
}
#endif /* NOT USED */
@@ -514,56 +490,6 @@ int sqliteOsOpenReadWrite(
OpenCounter(+1);
return SQLITE_OK;
#endif
-#if OS_MAC
- FSSpec fsSpec;
-# ifdef _LARGE_FILE
- HFSUniStr255 dfName;
- FSRef fsRef;
- if( __path2fss(zFilename, &fsSpec) != noErr ){
- if( HCreate(fsSpec.vRefNum, fsSpec.parID, fsSpec.name, 'SQLI', cDocumentFile) != noErr )
- return SQLITE_CANTOPEN;
- }
- if( FSpMakeFSRef(&fsSpec, &fsRef) != noErr )
- return SQLITE_CANTOPEN;
- FSGetDataForkName(&dfName);
- if( FSOpenFork(&fsRef, dfName.length, dfName.unicode,
- fsRdWrShPerm, &(id->refNum)) != noErr ){
- if( FSOpenFork(&fsRef, dfName.length, dfName.unicode,
- fsRdWrPerm, &(id->refNum)) != noErr ){
- if (FSOpenFork(&fsRef, dfName.length, dfName.unicode,
- fsRdPerm, &(id->refNum)) != noErr )
- return SQLITE_CANTOPEN;
- else
- *pReadonly = 1;
- } else
- *pReadonly = 0;
- } else
- *pReadonly = 0;
-# else
- __path2fss(zFilename, &fsSpec);
- if( !sqliteOsFileExists(zFilename) ){
- if( HCreate(fsSpec.vRefNum, fsSpec.parID, fsSpec.name, 'SQLI', cDocumentFile) != noErr )
- return SQLITE_CANTOPEN;
- }
- if( HOpenDF(fsSpec.vRefNum, fsSpec.parID, fsSpec.name, fsRdWrShPerm, &(id->refNum)) != noErr ){
- if( HOpenDF(fsSpec.vRefNum, fsSpec.parID, fsSpec.name, fsRdWrPerm, &(id->refNum)) != noErr ){
- if( HOpenDF(fsSpec.vRefNum, fsSpec.parID, fsSpec.name, fsRdPerm, &(id->refNum)) != noErr )
- return SQLITE_CANTOPEN;
- else
- *pReadonly = 1;
- } else
- *pReadonly = 0;
- } else
- *pReadonly = 0;
-# endif
- if( HOpenRF(fsSpec.vRefNum, fsSpec.parID, fsSpec.name, fsRdWrShPerm, &(id->refNumRF)) != noErr){
- id->refNumRF = -1;
- }
- id->locked = 0;
- id->delOnClose = 0;
- OpenCounter(+1);
- return SQLITE_OK;
-#endif
}
@@ -634,35 +560,6 @@ int sqliteOsOpenExclusive(const char *zFilename, OsFile *id, int delFlag){
OpenCounter(+1);
return SQLITE_OK;
#endif
-#if OS_MAC
- FSSpec fsSpec;
-# ifdef _LARGE_FILE
- HFSUniStr255 dfName;
- FSRef fsRef;
- __path2fss(zFilename, &fsSpec);
- if( HCreate(fsSpec.vRefNum, fsSpec.parID, fsSpec.name, 'SQLI', cDocumentFile) != noErr )
- return SQLITE_CANTOPEN;
- if( FSpMakeFSRef(&fsSpec, &fsRef) != noErr )
- return SQLITE_CANTOPEN;
- FSGetDataForkName(&dfName);
- if( FSOpenFork(&fsRef, dfName.length, dfName.unicode,
- fsRdWrPerm, &(id->refNum)) != noErr )
- return SQLITE_CANTOPEN;
-# else
- __path2fss(zFilename, &fsSpec);
- if( HCreate(fsSpec.vRefNum, fsSpec.parID, fsSpec.name, 'SQLI', cDocumentFile) != noErr )
- return SQLITE_CANTOPEN;
- if( HOpenDF(fsSpec.vRefNum, fsSpec.parID, fsSpec.name, fsRdWrPerm, &(id->refNum)) != noErr )
- return SQLITE_CANTOPEN;
-# endif
- id->refNumRF = -1;
- id->locked = 0;
- id->delOnClose = delFlag;
- if (delFlag)
- id->pathToDel = sqliteOsFullPathname(zFilename);
- OpenCounter(+1);
- return SQLITE_OK;
-#endif
}
/*
@@ -709,32 +606,6 @@ int sqliteOsOpenReadOnly(const char *zFilename, OsFile *id){
OpenCounter(+1);
return SQLITE_OK;
#endif
-#if OS_MAC
- FSSpec fsSpec;
-# ifdef _LARGE_FILE
- HFSUniStr255 dfName;
- FSRef fsRef;
- if( __path2fss(zFilename, &fsSpec) != noErr )
- return SQLITE_CANTOPEN;
- if( FSpMakeFSRef(&fsSpec, &fsRef) != noErr )
- return SQLITE_CANTOPEN;
- FSGetDataForkName(&dfName);
- if( FSOpenFork(&fsRef, dfName.length, dfName.unicode,
- fsRdPerm, &(id->refNum)) != noErr )
- return SQLITE_CANTOPEN;
-# else
- __path2fss(zFilename, &fsSpec);
- if( HOpenDF(fsSpec.vRefNum, fsSpec.parID, fsSpec.name, fsRdPerm, &(id->refNum)) != noErr )
- return SQLITE_CANTOPEN;
-# endif
- if( HOpenRF(fsSpec.vRefNum, fsSpec.parID, fsSpec.name, fsRdWrShPerm, &(id->refNumRF)) != noErr){
- id->refNumRF = -1;
- }
- id->locked = 0;
- id->delOnClose = 0;
- OpenCounter(+1);
- return SQLITE_OK;
-#endif
}
/*
@@ -830,49 +701,6 @@ int sqliteOsTempFileName(char *zBuf){
if( !sqliteOsFileExists(zBuf) ) break;
}
#endif
-#if OS_MAC
- static char zChars[] =
- "abcdefghijklmnopqrstuvwxyz"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
- "0123456789";
- int i, j;
- char zTempPath[SQLITE_TEMPNAME_SIZE];
- char zdirName[32];
- CInfoPBRec infoRec;
- Str31 dirName;
- memset(&infoRec, 0, sizeof(infoRec));
- memset(zTempPath, 0, SQLITE_TEMPNAME_SIZE);
- if( FindFolder(kOnSystemDisk, kTemporaryFolderType, kCreateFolder,
- &(infoRec.dirInfo.ioVRefNum), &(infoRec.dirInfo.ioDrParID)) == noErr ){
- infoRec.dirInfo.ioNamePtr = dirName;
- do{
- infoRec.dirInfo.ioFDirIndex = -1;
- infoRec.dirInfo.ioDrDirID = infoRec.dirInfo.ioDrParID;
- if( PBGetCatInfoSync(&infoRec) == noErr ){
- CopyPascalStringToC(dirName, zdirName);
- i = strlen(zdirName);
- memmove(&(zTempPath[i+1]), zTempPath, strlen(zTempPath));
- strcpy(zTempPath, zdirName);
- zTempPath[i] = ':';
- }else{
- *zTempPath = 0;
- break;
- }
- } while( infoRec.dirInfo.ioDrDirID != fsRtDirID );
- }
- if( *zTempPath == 0 )
- getcwd(zTempPath, SQLITE_TEMPNAME_SIZE-24);
- for(;;){
- sprintf(zBuf, "%s"TEMP_FILE_PREFIX, zTempPath);
- j = strlen(zBuf);
- sqliteRandomness(15, &zBuf[j]);
- for(i=0; i<15; i++, j++){
- zBuf[j] = (char)zChars[ ((unsigned char)zBuf[j])%(sizeof(zChars)-1) ];
- }
- zBuf[j] = 0;
- if( !sqliteOsFileExists(zBuf) ) break;
- }
-#endif
return SQLITE_OK;
}
@@ -917,21 +745,6 @@ int sqliteOsClose(OsFile *id){
OpenCounter(-1);
return SQLITE_OK;
#endif
-#if OS_MAC
- if( id->refNumRF!=-1 )
- FSClose(id->refNumRF);
-# ifdef _LARGE_FILE
- FSCloseFork(id->refNum);
-# else
- FSClose(id->refNum);
-# endif
- if( id->delOnClose ){
- unlink(id->pathToDel);
- sqliteFree(id->pathToDel);
- }
- OpenCounter(-1);
- return SQLITE_OK;
-#endif
}
/*
@@ -968,22 +781,6 @@ int sqliteOsRead(OsFile *id, void *pBuf, int amt){
return SQLITE_IOERR;
}
#endif
-#if OS_MAC
- int got;
- SimulateIOError(SQLITE_IOERR);
- TRACE2("READ %d\n", last_page);
-# ifdef _LARGE_FILE
- FSReadFork(id->refNum, fsAtMark, 0, (ByteCount)amt, pBuf, (ByteCount*)&got);
-# else
- got = amt;
- FSRead(id->refNum, &got, pBuf);
-# endif
- if( got==amt ){
- return SQLITE_OK;
- }else{
- return SQLITE_IOERR;
- }
-#endif
}
/*
@@ -1021,29 +818,6 @@ int sqliteOsWrite(OsFile *id, const void *pBuf, int amt){
}
return SQLITE_OK;
#endif
-#if OS_MAC
- OSErr oserr;
- int wrote = 0;
- SimulateIOError(SQLITE_IOERR);
- TRACE2("WRITE %d\n", last_page);
- while( amt>0 ){
-# ifdef _LARGE_FILE
- oserr = FSWriteFork(id->refNum, fsAtMark, 0,
- (ByteCount)amt, pBuf, (ByteCount*)&wrote);
-# else
- wrote = amt;
- oserr = FSWrite(id->refNum, &wrote, pBuf);
-# endif
- if( wrote == 0 || oserr != noErr)
- break;
- amt -= wrote;
- pBuf = &((char*)pBuf)[wrote];
- }
- if( oserr != noErr || amt>wrote ){
- return SQLITE_FULL;
- }
- return SQLITE_OK;
-#endif
}
/*
@@ -1065,28 +839,6 @@ int sqliteOsSeek(OsFile *id, off_t offset){
}
return SQLITE_OK;
#endif
-#if OS_MAC
- {
- off_t curSize;
- if( sqliteOsFileSize(id, &curSize) != SQLITE_OK ){
- return SQLITE_IOERR;
- }
- if( offset >= curSize ){
- if( sqliteOsTruncate(id, offset+1) != SQLITE_OK ){
- return SQLITE_IOERR;
- }
- }
-# ifdef _LARGE_FILE
- if( FSSetForkPosition(id->refNum, fsFromStart, offset) != noErr ){
-# else
- if( SetFPos(id->refNum, fsFromStart, offset) != noErr ){
-# endif
- return SQLITE_IOERR;
- }else{
- return SQLITE_OK;
- }
- }
-#endif
}
/*
@@ -1123,20 +875,6 @@ int sqliteOsSync(OsFile *id){
return SQLITE_IOERR;
}
#endif
-#if OS_MAC
-# ifdef _LARGE_FILE
- if( FSFlushFork(id->refNum) != noErr ){
-# else
- ParamBlockRec params;
- memset(&params, 0, sizeof(ParamBlockRec));
- params.ioParam.ioRefNum = id->refNum;
- if( PBFlushFileSync(&params) != noErr ){
-# endif
- return SQLITE_IOERR;
- }else{
- return SQLITE_OK;
- }
-#endif
}
/*
@@ -1155,17 +893,6 @@ int sqliteOsTruncate(OsFile *id, off_t nByte){
}
return SQLITE_OK;
#endif
-#if OS_MAC
-# ifdef _LARGE_FILE
- if( FSSetForkSize(id->refNum, fsFromStart, nByte) != noErr){
-# else
- if( SetEOF(id->refNum, nByte) != noErr ){
-# endif
- return SQLITE_IOERR;
- }else{
- return SQLITE_OK;
- }
-#endif
}
/*
@@ -1188,17 +915,6 @@ int sqliteOsFileSize(OsFile *id, off_t *pSize){
*pSize = (((off_t)upperBits)<<32) + lowerBits;
return SQLITE_OK;
#endif
-#if OS_MAC
-# ifdef _LARGE_FILE
- if( FSGetForkSize(id->refNum, pSize) != noErr){
-# else
- if( GetEOF(id->refNum, pSize) != noErr ){
-# endif
- return SQLITE_IOERR;
- }else{
- return SQLITE_OK;
- }
-#endif
}
#if OS_WIN
@@ -1271,11 +987,7 @@ int isNT(void){
** the first byte in the range of bytes used for locking.
*/
#define N_LOCKBYTE 10239
-#if OS_MAC
-# define FIRST_LOCKBYTE (0x000fffff - N_LOCKBYTE)
-#else
-# define FIRST_LOCKBYTE (0xffffffff - N_LOCKBYTE)
-#endif
+#define FIRST_LOCKBYTE (0xffffffff - N_LOCKBYTE)
/*
** Change the status of the lock on the file "id" to be a readlock.
@@ -1356,46 +1068,6 @@ int sqliteOsReadLock(OsFile *id){
}
return rc;
#endif
-#if OS_MAC
- int rc;
- if( id->locked>0 || id->refNumRF == -1 ){
- rc = SQLITE_OK;
- }else{
- int lk;
- OSErr res;
- int cnt = 5;
- ParamBlockRec params;
- sqliteRandomness(sizeof(lk), &lk);
- lk = (lk & 0x7fffffff)%N_LOCKBYTE + 1;
- memset(&params, 0, sizeof(params));
- params.ioParam.ioRefNum = id->refNumRF;
- params.ioParam.ioPosMode = fsFromStart;
- params.ioParam.ioPosOffset = FIRST_LOCKBYTE;
- params.ioParam.ioReqCount = 1;
- while( cnt-->0 && (res = PBLockRangeSync(&params))!=noErr ){
- UInt32 finalTicks;
- Delay(1, &finalTicks); /* 1/60 sec */
- }
- if( res == noErr ){
- params.ioParam.ioPosOffset = FIRST_LOCKBYTE+1;
- params.ioParam.ioReqCount = N_LOCKBYTE;
- PBUnlockRangeSync(&params);
- params.ioParam.ioPosOffset = FIRST_LOCKBYTE+lk;
- params.ioParam.ioReqCount = 1;
- res = PBLockRangeSync(&params);
- params.ioParam.ioPosOffset = FIRST_LOCKBYTE;
- params.ioParam.ioReqCount = 1;
- PBUnlockRangeSync(&params);
- }
- if( res == noErr ){
- id->locked = lk;
- rc = SQLITE_OK;
- }else{
- rc = SQLITE_BUSY;
- }
- }
- return rc;
-#endif
}
/*
@@ -1465,47 +1137,6 @@ int sqliteOsWriteLock(OsFile *id){
}
return rc;
#endif
-#if OS_MAC
- int rc;
- if( id->locked<0 || id->refNumRF == -1 ){
- rc = SQLITE_OK;
- }else{
- OSErr res;
- int cnt = 5;
- ParamBlockRec params;
- memset(&params, 0, sizeof(params));
- params.ioParam.ioRefNum = id->refNumRF;
- params.ioParam.ioPosMode = fsFromStart;
- params.ioParam.ioPosOffset = FIRST_LOCKBYTE;
- params.ioParam.ioReqCount = 1;
- while( cnt-->0 && (res = PBLockRangeSync(&params))!=noErr ){
- UInt32 finalTicks;
- Delay(1, &finalTicks); /* 1/60 sec */
- }
- if( res == noErr ){
- params.ioParam.ioPosOffset = FIRST_LOCKBYTE + id->locked;
- params.ioParam.ioReqCount = 1;
- if( id->locked==0
- || PBUnlockRangeSync(&params)==noErr ){
- params.ioParam.ioPosOffset = FIRST_LOCKBYTE+1;
- params.ioParam.ioReqCount = N_LOCKBYTE;
- res = PBLockRangeSync(&params);
- }else{
- res = afpRangeNotLocked;
- }
- params.ioParam.ioPosOffset = FIRST_LOCKBYTE;
- params.ioParam.ioReqCount = 1;
- PBUnlockRangeSync(&params);
- }
- if( res == noErr ){
- id->locked = -1;
- rc = SQLITE_OK;
- }else{
- rc = SQLITE_BUSY;
- }
- }
- return rc;
-#endif
}
/*
@@ -1574,29 +1205,6 @@ int sqliteOsUnlock(OsFile *id){
}
return rc;
#endif
-#if OS_MAC
- int rc;
- ParamBlockRec params;
- memset(&params, 0, sizeof(params));
- params.ioParam.ioRefNum = id->refNumRF;
- params.ioParam.ioPosMode = fsFromStart;
- if( id->locked==0 || id->refNumRF == -1 ){
- rc = SQLITE_OK;
- }else if( id->locked<0 ){
- params.ioParam.ioPosOffset = FIRST_LOCKBYTE+1;
- params.ioParam.ioReqCount = N_LOCKBYTE;
- PBUnlockRangeSync(&params);
- rc = SQLITE_OK;
- id->locked = 0;
- }else{
- params.ioParam.ioPosOffset = FIRST_LOCKBYTE+id->locked;
- params.ioParam.ioReqCount = 1;
- PBUnlockRangeSync(&params);
- rc = SQLITE_OK;
- id->locked = 0;
- }
- return rc;
-#endif
}
/*
@@ -1629,14 +1237,6 @@ int sqliteOsRandomSeed(char *zBuf){
#if OS_WIN && !defined(SQLITE_TEST)
GetSystemTime((LPSYSTEMTIME)zBuf);
#endif
-#if OS_MAC
- {
- int pid;
- Microseconds((UnsignedWide*)zBuf);
- pid = getpid();
- memcpy(&zBuf[sizeof(UnsignedWide)], &pid, sizeof(pid));
- }
-#endif
return SQLITE_OK;
}
@@ -1657,12 +1257,6 @@ int sqliteOsSleep(int ms){
Sleep(ms);
return ms;
#endif
-#if OS_MAC
- UInt32 finalTicks;
- UInt32 ticks = (((UInt32)ms+16)*3)/50; /* 1/60 sec per tick */
- Delay(ticks, &finalTicks);
- return (int)((ticks*50)/3);
-#endif
}
/*
@@ -1762,26 +1356,10 @@ char *sqliteOsFullPathname(const char *zRelative){
GetFullPathName(zRelative, nByte, zFull, &zNotUsed);
return zFull;
#endif
-#if OS_MAC
- char *zFull = 0;
- if( zRelative[0]==':' ){
- char zBuf[_MAX_PATH+1];
- sqliteSetString(&zFull, getcwd(zBuf, sizeof(zBuf)), &(zRelative[1]),
- (char*)0);
- }else{
- if( strchr(zRelative, ':') ){
- sqliteSetString(&zFull, zRelative, (char*)0);
- }else{
- char zBuf[_MAX_PATH+1];
- sqliteSetString(&zFull, getcwd(zBuf, sizeof(zBuf)), zRelative, (char*)0);
- }
- }
- return zFull;
-#endif
}
/*
-** The following variable, if set to a now-zero value, become the result
+** The following variable, if set to a non-zero value, becomes the result
** returned from sqliteOsCurrentTime(). This is used for testing.
*/
#ifdef SQLITE_TEST
diff --git a/src/3rdparty/sqlite/os.h b/src/3rdparty/sqlite/os.h
index 5b12c21cd..d5541d469 100644
--- a/src/3rdparty/sqlite/os.h
+++ b/src/3rdparty/sqlite/os.h
@@ -63,37 +63,21 @@
** Figure out if we are dealing with Unix, Windows or MacOS.
**
** N.B. MacOS means Mac Classic (or Carbon). Treat Darwin (OS X) as Unix.
-** The MacOS build is designed to use CodeWarrior (tested with v8)
*/
#ifndef OS_UNIX
# ifndef OS_WIN
-# ifndef OS_MAC
-# if defined(__MACOS__)
-# define OS_MAC 1
-# define OS_WIN 0
-# define OS_UNIX 0
-# elif defined(_WIN32) || defined(WIN32) || defined(__CYGWIN__) || defined(__MINGW32__)
-# define OS_MAC 0
-# define OS_WIN 1
-# define OS_UNIX 0
-# else
-# define OS_MAC 0
-# define OS_WIN 0
-# define OS_UNIX 1
-# endif
+# if defined(_WIN32) || defined(WIN32) || defined(__CYGWIN__) || defined(__MINGW32__)
+# define OS_WIN 1
+# define OS_UNIX 0
# else
# define OS_WIN 0
-# define OS_UNIX 0
+# define OS_UNIX 1
# endif
# else
-# define OS_MAC 0
# define OS_UNIX 0
# endif
#else
-# define OS_MAC 0
-# ifndef OS_WIN
-# define OS_WIN 0
-# endif
+# define OS_WIN 0
#endif
/*
@@ -142,26 +126,6 @@
# define SQLITE_MIN_SLEEP_MS 1
#endif
-#if OS_MAC
-# include <unistd.h>
-# include <Files.h>
- typedef struct OsFile OsFile;
- struct OsFile {
- SInt16 refNum; /* Data fork/file reference number */
- SInt16 refNumRF; /* Resource fork reference number (for locking) */
- int locked; /* 0: unlocked, <0: write lock, >0: read lock */
- int delOnClose; /* True if file is to be deleted on close */
- char *pathToDel; /* Name of file to delete on close */
- };
-# ifdef _LARGE_FILE
- typedef SInt64 off_t;
-# else
- typedef SInt32 off_t;
-# endif
-# define SQLITE_TEMPNAME_SIZE _MAX_PATH
-# define SQLITE_MIN_SLEEP_MS 17
-#endif
-
int sqliteOsDelete(const char*);
int sqliteOsFileExists(const char*);
int sqliteOsFileRename(const char*, const char*);
diff --git a/src/3rdparty/zlib/minigzip.c b/src/3rdparty/zlib/minigzip.c
index 6de35dde9..ed1d1486d 100644
--- a/src/3rdparty/zlib/minigzip.c
+++ b/src/3rdparty/zlib/minigzip.c
@@ -48,9 +48,6 @@
# define GZ_SUFFIX "-gz"
# define fileno(file) file->__file
#endif
-#if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os
-# include <unix.h> /* for fileno */
-#endif
#ifndef WIN32 /* unlink already in stdio.h for WIN32 */
extern int unlink OF((const char *));
diff --git a/src/3rdparty/zlib/zconf.h b/src/3rdparty/zlib/zconf.h
index af321ab6f..7b4d7a0d5 100644
--- a/src/3rdparty/zlib/zconf.h
+++ b/src/3rdparty/zlib/zconf.h
@@ -120,7 +120,7 @@
#endif
/* Some Mac compilers merge all .h files incorrectly: */
-#if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__)
+#if defined(applec)||defined(THINK_C)||defined(__SC__)
# define NO_DUMMY_DECL
#endif
diff --git a/src/3rdparty/zlib/zconf.in.h b/src/3rdparty/zlib/zconf.in.h
index af321ab6f..7b4d7a0d5 100644
--- a/src/3rdparty/zlib/zconf.in.h
+++ b/src/3rdparty/zlib/zconf.in.h
@@ -120,7 +120,7 @@
#endif
/* Some Mac compilers merge all .h files incorrectly: */
-#if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__)
+#if defined(applec)||defined(THINK_C)||defined(__SC__)
# define NO_DUMMY_DECL
#endif
diff --git a/src/3rdparty/zlib/zutil.h b/src/3rdparty/zlib/zutil.h
index 50bcbbf6e..e673e7244 100644
--- a/src/3rdparty/zlib/zutil.h
+++ b/src/3rdparty/zlib/zutil.h
@@ -99,12 +99,8 @@ extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
#if defined(MACOS) || defined(TARGET_OS_MAC)
# define OS_CODE 0x07
-# if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os
-# include <unix.h> /* for fdopen */
-# else
-# ifndef fdopen
-# define fdopen(fd,mode) NULL /* No fdopen() */
-# endif
+# ifndef fdopen
+# define fdopen(fd,mode) NULL /* No fdopen() */
# endif
#endif
diff --git a/src/tools/tqglobal.cpp b/src/tools/tqglobal.cpp
index d77e284ea..038e1225c 100644
--- a/src/tools/tqglobal.cpp
+++ b/src/tools/tqglobal.cpp
@@ -447,34 +447,12 @@ static TQtMsgHandler handler = 0; // pointer to debug handler
static const int QT_BUFFER_LENGTH = 8196; // internal buffer length
-#ifdef Q_CC_MWERKS
-
-#include "qt_mac.h"
-
-extern bool tqt_is_gui_used;
-static void mac_default_handler( const char *msg )
-{
- if ( tqt_is_gui_used ) {
- const unsigned char *p = p_str(msg);
- DebugStr(p);
- free((void*)p);
- } else {
- fprintf( stderr, msg );
- }
-}
-
-#endif
-
void handle_buffer(const char *buf, TQtMsgType msgType)
{
if ( handler ) {
(*handler)( msgType, buf );
} else if (msgType == TQtFatalMsg) {
-#if defined(Q_CC_MWERKS)
- mac_default_handler(buf);
-#else
fprintf( stderr, "%s\n", buf ); // add newline
-#endif
#if defined(Q_OS_UNIX) && defined(QT_DEBUG)
abort(); // trap; generates core dump
#elif defined(Q_OS_TEMP) && defined(QT_DEBUG)
@@ -487,9 +465,7 @@ void handle_buffer(const char *buf, TQtMsgType msgType)
exit( 1 ); // goodbye cruel world
#endif
} else {
-#if defined(Q_CC_MWERKS)
- mac_default_handler(buf);
-#elif defined(Q_OS_TEMP)
+#if defined(Q_OS_TEMP)
TQString fstr( buf );
OutputDebugString( (fstr + "\n").ucs2() );
#else
diff --git a/src/tools/tqglobal.h b/src/tools/tqglobal.h
index 67422110e..f80109911 100644
--- a/src/tools/tqglobal.h
+++ b/src/tools/tqglobal.h
@@ -104,8 +104,6 @@
# define Q_OS_WIN64
#elif !defined(SAG_COM) && (defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__))
# define Q_OS_WIN32
-#elif defined(__MWERKS__) && defined(__INTEL__)
-# define Q_OS_WIN32
#elif defined(__sun) || defined(sun)
# define Q_OS_SOLARIS
#elif defined(hpux) || defined(__hpux)
@@ -194,7 +192,6 @@
SYM - Symantec C++ for both PC and Macintosh
MPW - MPW C++
- MWERKS - Metrowerks CodeWarrior
MSVC - Microsoft Visual C/C++, Intel C++ for Windows
WAT - Watcom C++
GNU - GNU C++
@@ -234,11 +231,6 @@
# define Q_NO_EXPLICIT_KEYWORD
# define Q_NO_USING_KEYWORD
-#elif defined(__MWERKS__)
-# define Q_CC_MWERKS
-/* "explicit" recognized since 4.0d1 */
-# define TQMAC_PASCAL pascal
-
#elif defined(_MSC_VER)
# define Q_CC_MSVC
/* proper support of bool for _MSC_VER >= 1100 */
diff --git a/src/tqmoc/tqmoc.l b/src/tqmoc/tqmoc.l
index 373c6712c..8051e7310 100644
--- a/src/tqmoc/tqmoc.l
+++ b/src/tqmoc/tqmoc.l
@@ -41,30 +41,6 @@
%{
#ifdef TQMOC_YACC_CODE
-#ifdef TQMOC_MWERKS_PLUGIN
-#ifdef Q_OS_MAC9
-# define isascii(c) ((int)( (unsigned int) (c) <= (unsigned char)0x7F ))
-#endif
-const char *buf_buffer = NULL;
-long buf_size_total = 0, buf_index = 0;
-#define YY_INPUT(buf, result, max_size) \
- { \
- if(buf_index < buf_size_total ) { \
- while(!isascii(buf_buffer[buf_index])) buf_index++; \
- int ms = ((max_size < buf_size_total) ? max_size : buf_size_total); \
- for(result = 0; result < ms; result++) { \
- char c = buf_buffer[buf_index + result]; \
- if(!isascii(c)) { \
- buf_index++; \
- break; \
- } \
- buf[result] = c == '\r' ? '\n' : c; \
- } \
- buf_index += result; \
- } else result = YY_NULL; \
- }
-#endif
-
#include "tqstring.h"
diff --git a/src/tqmoc/tqmoc.pro b/src/tqmoc/tqmoc.pro
index 2a430efee..bcb942e6e 100644
--- a/src/tqmoc/tqmoc.pro
+++ b/src/tqmoc/tqmoc.pro
@@ -51,15 +51,3 @@ macx:LIBS += -framework Carbon
target.path=$$bins.path
INSTALLS += target
-
-*-mwerks {
- TEMPLATE = lib
- TARGET = McMoc
- CONFIG -= static
- CONFIG += shared plugin
- DEFINES += TQMOC_MWERKS_PLUGIN
- MWERKSDIR = $QT_SOURCE_TREE/util/mwerks_plugin
- INCLUDEPATH += $$MWERKSDIR/Headers
- LIBS += $$MWERKSDIR/Libraries/PluginLib4.shlb
- SOURCES += mwerks_mac.cpp
-}
diff --git a/src/tqmoc/tqmoc.y b/src/tqmoc/tqmoc.y
index 7bd726a32..639756218 100644
--- a/src/tqmoc/tqmoc.y
+++ b/src/tqmoc/tqmoc.y
@@ -67,21 +67,6 @@ void yyerror( const char *msg );
#include "tqptrlist.h"
#include "tqregexp.h"
#include "tqstrlist.h"
-#ifdef TQMOC_MWERKS_PLUGIN
-# ifdef Q_OS_MACX
-# undef OLD_DEBUG
-# ifdef DEBUG
-# define OLD_DEBUG DEBUG
-# undef DEBUG
-# endif
-# define DEBUG 0
-# ifndef __IMAGECAPTURE__
-# define __IMAGECAPTURE__
-# endif
-# include <Carbon/Carbon.h>
-# endif
-# include "mwerks_mac.h"
-#endif
#include <ctype.h>
#include <stdio.h>
@@ -1673,7 +1658,6 @@ void setDefaultIncludeFile()
#define ErrorFormatString "%s:%d:"
#endif
-#ifndef TQMOC_MWERKS_PLUGIN
int main( int argc, char **argv )
{
init();
@@ -1815,109 +1799,7 @@ int main( int argc, char **argv )
cleanup();
return ret;
}
-#else
-bool tqt_is_gui_used = FALSE;
-#include <ctype.h>
-#include <stdio.h>
-#include <string.h>
-#ifdef Q_OS_MAC9
-# include <Files.h>
-# include <Strings.h>
-# include <Errors.h>
-# include "Aliases.h"
-#endif
-#include "CWPluginErrors.h"
-#include <CWPlugins.h>
-#include "DropInCompilerLinker.h"
-#include <stat.h>
-
-const unsigned char *p_str(const char *, int =-1);
-
-CWPluginContext g_ctx;
-
-tqmoc_status do_moc( CWPluginContext ctx, const TQCString &fin, const TQCString &fout, CWFileSpec *dspec, bool i)
-{
- init();
-
- g_ctx = ctx;
- g->noInclude = i;
- g->fileName = fin;
- g->outputFile = fout;
-
- setDefaultIncludeFile();
-
- CWFileInfo fi;
- memset(&fi, 0, sizeof(fi));
- fi.fullsearch = TRUE;
- fi.dependencyType = cwNormalDependency;
- fi.isdependentoffile = kCurrentCompiledFile;
- if(CWFindAndLoadFile( ctx, fin.data(), &fi) != cwNoErr) {
- cleanup();
- return tqmoc_no_source;
- }
-
- if(dspec) {
- memcpy(dspec, &fi.filespec, sizeof(fi.filespec));
- const unsigned char *f = p_str(fout.data());
- memcpy(dspec->name, f, f[0]+1);
- free(f);
- }
- buf_size_total = fi.filedatalength;
- buf_buffer = fi.filedata;
-
- TQCString path("");
- AliasHandle alias;
- Str63 str;
- AliasInfoType x = 1;
- char tmp[sizeof(Str63)+2];
- if(NewAlias( NULL, &fi.filespec, &alias) != noErr) {
- cleanup();
- return tqmoc_general_error;
- }
- for(;;) {
- GetAliasInfo(alias, x++, str);
- if(!str[0])
- break;
- strncpy((char *)tmp, (const char *)str+1, str[0]);
- tmp[str[0]] = '\0';
- path.prepend(":");
- path.prepend((char *)tmp);
- }
- path.prepend("MacOS 9:"); //FIXME
- TQString inpath = path + fin, outpath = path + fout;
- struct stat istat, ostat;
- if(stat(inpath, &istat) == -1) {
- cleanup();
- return tqmoc_no_source;
- }
- if(stat(outpath, &ostat) == 0 && istat.st_mtime < ostat.st_mtime) {
- cleanup();
- return tqmoc_not_time;
- }
-
- unlink(outpath.data());
- out = fopen(outpath.data(), "w+");
- if(!out) {
- cleanup();
- return tqmoc_general_error;
- }
-
- yyparse();
- if(out != stdout)
- fclose(out);
-
- if(g->mocError || !g->generatedCode) {
- unlink(outpath.data());
- tqmoc_status ret = !g->generatedCode ? tqmoc_no_qobject : tqmoc_parse_error;
- cleanup();
- return ret;
- }
-
- cleanup();
- return tqmoc_success;
-}
-#endif
void replace( char *s, char c1, char c2 )
{
if ( !s )
@@ -1995,23 +1877,12 @@ void init() // initialize
tmpArgList = new ArgList;
tmpFunc = new Function;
tmpEnum = new Enum;
-
-#ifdef TQMOC_MWERKS_PLUGIN
- buf_buffer = NULL;
- buf_index = 0;
- buf_size_total = 0;
-#endif
}
void cleanup()
{
delete g;
g = NULL;
-
-#ifdef TQMOC_MWERKS_PLUGIN
- if(buf_buffer && g_ctx)
- CWReleaseFileText(g_ctx, buf_buffer);
-#endif
}
void initClass() // prepare for new class
@@ -2182,13 +2053,7 @@ void addExpressionChar( const char c )
void yyerror( const char *msg ) // print yacc error message
{
g->mocError = TRUE;
-#ifndef TQMOC_MWERKS_PLUGIN
fprintf( stderr, ErrorFormatString" Error: %s\n", g->fileName.data(), lineNo, msg );
-#else
- char msg2[200];
- sprintf(msg2, ErrorFormatString" Error: %s", g->fileName.data(), lineNo, msg);
- CWReportMessage(g_ctx, NULL, msg2, NULL, messagetypeError, 0);
-#endif
if ( errorControl ) {
if ( !g->outputFile.isEmpty() && yyin && fclose(yyin) == 0 )
remove( g->outputFile );
diff --git a/src/tqmoc/tqmoc_lex.cpp b/src/tqmoc/tqmoc_lex.cpp
index aba3d5b48..de1d2822e 100644
--- a/src/tqmoc/tqmoc_lex.cpp
+++ b/src/tqmoc/tqmoc_lex.cpp
@@ -986,30 +986,6 @@ char *yytext;
#line 42 "moc.l"
#ifdef TQMOC_YACC_CODE
-#ifdef TQMOC_MWERKS_PLUGIN
-#ifdef Q_OS_MAC9
-# define isascii(c) ((int)( (unsigned int) (c) <= (unsigned char)0x7F ))
-#endif
-const char *buf_buffer = NULL;
-long buf_size_total = 0, buf_index = 0;
-#define YY_INPUT(buf, result, max_size) \
- { \
- if(buf_index < buf_size_total ) { \
- while(!isascii(buf_buffer[buf_index])) buf_index++; \
- int ms = ((max_size < buf_size_total) ? max_size : buf_size_total); \
- for(result = 0; result < ms; result++) { \
- char c = buf_buffer[buf_index + result]; \
- if(!isascii(c)) { \
- buf_index++; \
- break; \
- } \
- buf[result] = c == '\r' ? '\n' : c; \
- } \
- buf_index += result; \
- } else result = YY_NULL; \
- }
-#endif
-
#include "tqstring.h"
diff --git a/src/tqmoc/tqmoc_yacc.cpp b/src/tqmoc/tqmoc_yacc.cpp
index fdf898cd6..2c7098fc1 100644
--- a/src/tqmoc/tqmoc_yacc.cpp
+++ b/src/tqmoc/tqmoc_yacc.cpp
@@ -80,21 +80,6 @@ void yyerror( const char *msg );
#include "tqptrlist.h"
#include "tqregexp.h"
#include "tqstrlist.h"
-#ifdef TQMOC_MWERKS_PLUGIN
-# ifdef Q_OS_MACX
-# undef OLD_DEBUG
-# ifdef DEBUG
-# define OLD_DEBUG DEBUG
-# undef DEBUG
-# endif
-# define DEBUG 0
-# ifndef __IMAGECAPTURE__
-# define __IMAGECAPTURE__
-# endif
-# include <Carbon/Carbon.h>
-# endif
-# include "mwerks_mac.h"
-#endif
#include <ctype.h>
#include <stdio.h>
@@ -4548,7 +4533,6 @@ void setDefaultIncludeFile()
#define ErrorFormatString "%s:%d:"
#endif
-#ifndef TQMOC_MWERKS_PLUGIN
int main( int argc, char **argv )
{
init();
@@ -4690,109 +4674,7 @@ int main( int argc, char **argv )
cleanup();
return ret;
}
-#else
-bool tqt_is_gui_used = FALSE;
-#include <ctype.h>
-#include <stdio.h>
-#include <string.h>
-#ifdef Q_OS_MAC9
-# include <Files.h>
-# include <Strings.h>
-# include <Errors.h>
-# include "Aliases.h"
-#endif
-#include "CWPluginErrors.h"
-#include <CWPlugins.h>
-#include "DropInCompilerLinker.h"
-#include <stat.h>
-
-const unsigned char *p_str(const char *, int =-1);
-
-CWPluginContext g_ctx;
-
-tqmoc_status do_moc( CWPluginContext ctx, const TQCString &fin, const TQCString &fout, CWFileSpec *dspec, bool i)
-{
- init();
-
- g_ctx = ctx;
- g->noInclude = i;
- g->fileName = fin;
- g->outputFile = fout;
-
- setDefaultIncludeFile();
-
- CWFileInfo fi;
- memset(&fi, 0, sizeof(fi));
- fi.fullsearch = TRUE;
- fi.dependencyType = cwNormalDependency;
- fi.isdependentoffile = kCurrentCompiledFile;
- if(CWFindAndLoadFile( ctx, fin.data(), &fi) != cwNoErr) {
- cleanup();
- return tqmoc_no_source;
- }
- if(dspec) {
- memcpy(dspec, &fi.filespec, sizeof(fi.filespec));
- const unsigned char *f = p_str(fout.data());
- memcpy(dspec->name, f, f[0]+1);
- free(f);
- }
- buf_size_total = fi.filedatalength;
- buf_buffer = fi.filedata;
-
- TQCString path("");
- AliasHandle alias;
- Str63 str;
- AliasInfoType x = 1;
- char tmp[sizeof(Str63)+2];
- if(NewAlias( NULL, &fi.filespec, &alias) != noErr) {
- cleanup();
- return tqmoc_general_error;
- }
- for(;;) {
- GetAliasInfo(alias, x++, str);
- if(!str[0])
- break;
- strncpy((char *)tmp, (const char *)str+1, str[0]);
- tmp[str[0]] = '\0';
- path.prepend(":");
- path.prepend((char *)tmp);
- }
- path.prepend("MacOS 9:"); //FIXME
-
- TQString inpath = path + fin, outpath = path + fout;
- struct stat istat, ostat;
- if(stat(inpath, &istat) == -1) {
- cleanup();
- return tqmoc_no_source;
- }
- if(stat(outpath, &ostat) == 0 && istat.st_mtime < ostat.st_mtime) {
- cleanup();
- return tqmoc_not_time;
- }
-
- unlink(outpath.data());
- out = fopen(outpath.data(), "w+");
- if(!out) {
- cleanup();
- return tqmoc_general_error;
- }
-
- yyparse();
- if(out != stdout)
- fclose(out);
-
- if(g->mocError || !g->generatedCode) {
- unlink(outpath.data());
- tqmoc_status ret = !g->generatedCode ? tqmoc_no_qobject : tqmoc_parse_error;
- cleanup();
- return ret;
- }
-
- cleanup();
- return tqmoc_success;
-}
-#endif
void replace( char *s, char c1, char c2 )
{
if ( !s )
@@ -4870,23 +4752,12 @@ void init() // initialize
tmpArgList = new ArgList;
tmpFunc = new Function;
tmpEnum = new Enum;
-
-#ifdef TQMOC_MWERKS_PLUGIN
- buf_buffer = NULL;
- buf_index = 0;
- buf_size_total = 0;
-#endif
}
void cleanup()
{
delete g;
g = NULL;
-
-#ifdef TQMOC_MWERKS_PLUGIN
- if(buf_buffer && g_ctx)
- CWReleaseFileText(g_ctx, buf_buffer);
-#endif
}
void initClass() // prepare for new class
@@ -5057,13 +4928,7 @@ void addExpressionChar( const char c )
void yyerror( const char *msg ) // print yacc error message
{
g->mocError = TRUE;
-#ifndef TQMOC_MWERKS_PLUGIN
fprintf( stderr, ErrorFormatString" Error: %s\n", g->fileName.data(), lineNo, msg );
-#else
- char msg2[200];
- sprintf(msg2, ErrorFormatString" Error: %s", g->fileName.data(), lineNo, msg);
- CWReportMessage(g_ctx, NULL, msg2, NULL, messagetypeError, 0);
-#endif
if ( errorControl ) {
if ( !g->outputFile.isEmpty() && yyin && fclose(yyin) == 0 )
remove( g->outputFile );