diff options
| author | Michele Calgaro <michele.calgaro@yahoo.it> | 2025-01-01 13:14:26 +0900 |
|---|---|---|
| committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2025-01-08 13:00:16 +0900 |
| commit | 840945161b56783948793acd952fa48bdbddc211 (patch) | |
| tree | 8b4f96707077d236f5904add531428db3582f2c3 /src/moc | |
| parent | b3f74bb12ab86a90a05f7d48325b25c408d0b985 (diff) | |
| download | tqt-84094516.tar.gz tqt-84094516.zip | |
Remove support for Metrowerks compiler
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
(cherry picked from commit 37293565c31fa447fbf7cb0566be51d1204e8991)
Diffstat (limited to 'src/moc')
| -rw-r--r-- | src/moc/moc.l | 25 | ||||
| -rw-r--r-- | src/moc/moc.pro | 12 | ||||
| -rw-r--r-- | src/moc/moc.y | 135 | ||||
| -rw-r--r-- | src/moc/moc_lex.cpp | 25 | ||||
| -rw-r--r-- | src/moc/moc_yacc.cpp | 135 |
5 files changed, 0 insertions, 332 deletions
diff --git a/src/moc/moc.l b/src/moc/moc.l index 868f9c0a6..82e7ac1bd 100644 --- a/src/moc/moc.l +++ b/src/moc/moc.l @@ -41,33 +41,8 @@ %{ #ifdef MOC_YACC_CODE -#ifdef MOC_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 "ntqstring.h" - #define input yyinput // yyinput in C++ #define X if(lexDebug){fprintf(stderr,"LEX (%i) : %s\n",lineNo,yytext);}; diff --git a/src/moc/moc.pro b/src/moc/moc.pro index c8abcf0d7..c1a20ff59 100644 --- a/src/moc/moc.pro +++ b/src/moc/moc.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 += MOC_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/moc/moc.y b/src/moc/moc.y index b3371cab9..64dc92fd8 100644 --- a/src/moc/moc.y +++ b/src/moc/moc.y @@ -67,21 +67,6 @@ void yyerror( const char *msg ); #include "ntqptrlist.h" #include "ntqregexp.h" #include "ntqstrlist.h" -#ifdef MOC_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 MOC_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; - -moc_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 moc_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 moc_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 moc_no_source; - } - if(stat(outpath, &ostat) == 0 && istat.st_mtime < ostat.st_mtime) { - cleanup(); - return moc_not_time; - } - - unlink(outpath.data()); - out = fopen(outpath.data(), "w+"); - if(!out) { - cleanup(); - return moc_general_error; - } - - yyparse(); - if(out != stdout) - fclose(out); - - if(g->mocError || !g->generatedCode) { - unlink(outpath.data()); - moc_status ret = !g->generatedCode ? moc_no_qobject : moc_parse_error; - cleanup(); - return ret; - } - - cleanup(); - return moc_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 MOC_MWERKS_PLUGIN - buf_buffer = NULL; - buf_index = 0; - buf_size_total = 0; -#endif } void cleanup() { delete g; g = NULL; - -#ifdef MOC_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 MOC_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/moc/moc_lex.cpp b/src/moc/moc_lex.cpp index c5f29d5fc..b54536548 100644 --- a/src/moc/moc_lex.cpp +++ b/src/moc/moc_lex.cpp @@ -986,33 +986,8 @@ char *yytext; #line 42 "moc.l" #ifdef MOC_YACC_CODE -#ifdef MOC_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 "ntqstring.h" - #define input yyinput // yyinput in C++ #define X if(lexDebug){fprintf(stderr,"LEX (%i) : %s\n",lineNo,yytext);}; diff --git a/src/moc/moc_yacc.cpp b/src/moc/moc_yacc.cpp index bf8963493..0ac0f0bb2 100644 --- a/src/moc/moc_yacc.cpp +++ b/src/moc/moc_yacc.cpp @@ -80,21 +80,6 @@ void yyerror( const char *msg ); #include "ntqptrlist.h" #include "ntqregexp.h" #include "ntqstrlist.h" -#ifdef MOC_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 MOC_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; - -moc_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 moc_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 moc_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 moc_no_source; - } - if(stat(outpath, &ostat) == 0 && istat.st_mtime < ostat.st_mtime) { - cleanup(); - return moc_not_time; - } - - unlink(outpath.data()); - out = fopen(outpath.data(), "w+"); - if(!out) { - cleanup(); - return moc_general_error; - } - - yyparse(); - if(out != stdout) - fclose(out); - - if(g->mocError || !g->generatedCode) { - unlink(outpath.data()); - moc_status ret = !g->generatedCode ? moc_no_qobject : moc_parse_error; - cleanup(); - return ret; - } - - cleanup(); - return moc_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 MOC_MWERKS_PLUGIN - buf_buffer = NULL; - buf_index = 0; - buf_size_total = 0; -#endif } void cleanup() { delete g; g = NULL; - -#ifdef MOC_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 MOC_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 ); |
