Remove remaining code to support macos9
This OS has been unsupported for over 20 years. We stopped providing macswig builds more than 20 years ago too: https://sourceforge.net/projects/swig/files/macswig/ The required SIOUX library doesn't seem to be available anywhere now either. Closes #2323
This commit is contained in:
parent
892557e799
commit
6b4d5fe3f0
10 changed files with 9 additions and 307 deletions
|
|
@ -7,6 +7,10 @@ the issue number to the end of the URL: https://github.com/swig/swig/issues/
|
||||||
Version 4.1.0 (in progress)
|
Version 4.1.0 (in progress)
|
||||||
===========================
|
===========================
|
||||||
|
|
||||||
|
2022-07-19: olly
|
||||||
|
Remove remaining support code for classic macos, which has not been
|
||||||
|
supported by Apple for over 20 years now.
|
||||||
|
|
||||||
2022-07-12: wsfulton
|
2022-07-12: wsfulton
|
||||||
Performance optimisation for parameters passed by value that are C++11 movable.
|
Performance optimisation for parameters passed by value that are C++11 movable.
|
||||||
The C++ wrappers create a temporary variable for a parameter to be passed to a
|
The C++ wrappers create a temporary variable for a parameter to be passed to a
|
||||||
|
|
|
||||||
|
|
@ -1,233 +0,0 @@
|
||||||
/* -----------------------------------------------------------------------------
|
|
||||||
* mactkinit.c
|
|
||||||
*
|
|
||||||
* This is a support file needed to build a new version of Wish.
|
|
||||||
* Normally, this capability is found in TkAppInit.c, but this creates
|
|
||||||
* tons of namespace problems for many applications.
|
|
||||||
* ----------------------------------------------------------------------------- */
|
|
||||||
|
|
||||||
#include <Gestalt.h>
|
|
||||||
#include <ToolUtils.h>
|
|
||||||
#include <Fonts.h>
|
|
||||||
#include <Dialogs.h>
|
|
||||||
#include <SegLoad.h>
|
|
||||||
#include <Traps.h>
|
|
||||||
|
|
||||||
#include "tk.h"
|
|
||||||
#include "tkInt.h"
|
|
||||||
#include "tkMacInt.h"
|
|
||||||
|
|
||||||
typedef int (*TclMacConvertEventPtr) _ANSI_ARGS_((EventRecord *eventPtr));
|
|
||||||
Tcl_Interp *gStdoutInterp = NULL;
|
|
||||||
|
|
||||||
void TclMacSetEventProc _ANSI_ARGS_((TclMacConvertEventPtr procPtr));
|
|
||||||
int TkMacConvertEvent _ANSI_ARGS_((EventRecord *eventPtr));
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Prototypes for functions the ANSI library needs to link against.
|
|
||||||
*/
|
|
||||||
short InstallConsole _ANSI_ARGS_((short fd));
|
|
||||||
void RemoveConsole _ANSI_ARGS_((void));
|
|
||||||
long WriteCharsToConsole _ANSI_ARGS_((char *buff, long n));
|
|
||||||
long ReadCharsFromConsole _ANSI_ARGS_((char *buff, long n));
|
|
||||||
char * __ttyname _ANSI_ARGS_((long fildes));
|
|
||||||
short SIOUXHandleOneEvent _ANSI_ARGS_((EventRecord *event));
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Forward declarations for procedures defined later in this file:
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
*----------------------------------------------------------------------
|
|
||||||
*
|
|
||||||
* MacintoshInit --
|
|
||||||
*
|
|
||||||
* This procedure calls Mac specific initialization calls. Most of
|
|
||||||
* these calls must be made as soon as possible in the startup
|
|
||||||
* process.
|
|
||||||
*
|
|
||||||
* Results:
|
|
||||||
* Returns TCL_OK if everything went fine. If it didn't the
|
|
||||||
* application should probably fail.
|
|
||||||
*
|
|
||||||
* Side effects:
|
|
||||||
* Inits the application.
|
|
||||||
*
|
|
||||||
*----------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
|
|
||||||
int
|
|
||||||
MacintoshInit()
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
long result, mask = 0x0700; /* mask = system 7.x */
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Tk needs us to set the qd pointer it uses. This is needed
|
|
||||||
* so Tk doesn't have to assume the availiblity of the qd global
|
|
||||||
* variable. Which in turn allows Tk to be used in code resources.
|
|
||||||
*/
|
|
||||||
tcl_macQdPtr = &qd;
|
|
||||||
|
|
||||||
InitGraf(&tcl_macQdPtr->thePort);
|
|
||||||
InitFonts();
|
|
||||||
InitWindows();
|
|
||||||
InitMenus();
|
|
||||||
InitDialogs((long) NULL);
|
|
||||||
InitCursor();
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Make sure we are running on system 7 or higher
|
|
||||||
*/
|
|
||||||
|
|
||||||
if ((NGetTrapAddress(_Gestalt, ToolTrap) ==
|
|
||||||
NGetTrapAddress(_Unimplemented, ToolTrap))
|
|
||||||
|| (((Gestalt(gestaltSystemVersion, &result) != noErr)
|
|
||||||
|| (mask != (result & mask))))) {
|
|
||||||
panic("Tcl/Tk requires System 7 or higher.");
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Make sure we have color quick draw
|
|
||||||
* (this means we can't run on 68000 macs)
|
|
||||||
*/
|
|
||||||
|
|
||||||
if (((Gestalt(gestaltQuickdrawVersion, &result) != noErr)
|
|
||||||
|| (result < gestalt32BitQD13))) {
|
|
||||||
panic("Tk requires Color QuickDraw.");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
FlushEvents(everyEvent, 0);
|
|
||||||
SetEventMask(everyEvent);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Set up stack & heap sizes
|
|
||||||
*/
|
|
||||||
/* TODO: stack size
|
|
||||||
size = StackSpace();
|
|
||||||
SetAppLimit(GetAppLimit() - 8192);
|
|
||||||
*/
|
|
||||||
MaxApplZone();
|
|
||||||
for (i = 0; i < 4; i++) {
|
|
||||||
(void) MoreMasters();
|
|
||||||
}
|
|
||||||
|
|
||||||
TclMacSetEventProc(TkMacConvertEvent);
|
|
||||||
TkConsoleCreate();
|
|
||||||
|
|
||||||
return TCL_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
*----------------------------------------------------------------------
|
|
||||||
*
|
|
||||||
* SetupMainInterp --
|
|
||||||
*
|
|
||||||
* This procedure calls initialization routines require a Tcl
|
|
||||||
* interp as an argument. This call effectively makes the passed
|
|
||||||
* interpreter the "main" interpreter for the application.
|
|
||||||
*
|
|
||||||
* Results:
|
|
||||||
* Returns TCL_OK if everything went fine. If it didn't the
|
|
||||||
* application should probably fail.
|
|
||||||
*
|
|
||||||
* Side effects:
|
|
||||||
* More initialization.
|
|
||||||
*
|
|
||||||
*----------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
|
|
||||||
int
|
|
||||||
SetupMainInterp(
|
|
||||||
Tcl_Interp *interp)
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
* Initialize the console only if we are running as an interactive
|
|
||||||
* application.
|
|
||||||
*/
|
|
||||||
|
|
||||||
TkMacInitAppleEvents(interp);
|
|
||||||
TkMacInitMenus(interp);
|
|
||||||
|
|
||||||
if (strcmp(Tcl_GetVar(interp, "tcl_interactive", TCL_GLOBAL_ONLY), "1")
|
|
||||||
== 0) {
|
|
||||||
if (TkConsoleInit(interp) == TCL_ERROR) {
|
|
||||||
goto error;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Attach the global interpreter to tk's expected global console
|
|
||||||
*/
|
|
||||||
|
|
||||||
gStdoutInterp = interp;
|
|
||||||
|
|
||||||
return TCL_OK;
|
|
||||||
|
|
||||||
error:
|
|
||||||
panic(interp->result);
|
|
||||||
return TCL_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
*----------------------------------------------------------------------
|
|
||||||
*
|
|
||||||
* InstallConsole, RemoveConsole, etc. --
|
|
||||||
*
|
|
||||||
* The following functions provide the UI for the console package.
|
|
||||||
* Users wishing to replace SIOUX with their own console package
|
|
||||||
* need only provide the four functions below in a library.
|
|
||||||
*
|
|
||||||
* Results:
|
|
||||||
* See SIOUX documentation for details.
|
|
||||||
*
|
|
||||||
* Side effects:
|
|
||||||
* See SIOUX documentation for details.
|
|
||||||
*
|
|
||||||
*----------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
|
|
||||||
short
|
|
||||||
InstallConsole(short fd)
|
|
||||||
{
|
|
||||||
#pragma unused (fd)
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
RemoveConsole(void)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
long
|
|
||||||
WriteCharsToConsole(char *buffer, long n)
|
|
||||||
{
|
|
||||||
TkConsolePrint(gStdoutInterp, TCL_STDOUT, buffer, n);
|
|
||||||
return n;
|
|
||||||
}
|
|
||||||
|
|
||||||
long
|
|
||||||
ReadCharsFromConsole(char *buffer, long n)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
extern char *
|
|
||||||
__ttyname(long fildes)
|
|
||||||
{
|
|
||||||
static char *devicename = "null device";
|
|
||||||
|
|
||||||
if (fildes >= 0 && fildes <= 2) {
|
|
||||||
return (devicename);
|
|
||||||
}
|
|
||||||
|
|
||||||
return (0L);
|
|
||||||
}
|
|
||||||
|
|
||||||
short
|
|
||||||
SIOUXHandleOneEvent(EventRecord *event)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
@ -33,10 +33,6 @@ char *SWIG_RcFileName = "~/.myapprc";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#ifdef MAC_TCL
|
|
||||||
extern int MacintoshInit _ANSI_ARGS_((void));
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int Tcl_AppInit(Tcl_Interp *interp){
|
int Tcl_AppInit(Tcl_Interp *interp){
|
||||||
|
|
||||||
if (Tcl_Init(interp) == TCL_ERROR)
|
if (Tcl_Init(interp) == TCL_ERROR)
|
||||||
|
|
@ -47,27 +43,11 @@ int Tcl_AppInit(Tcl_Interp *interp){
|
||||||
if (SWIG_init(interp) == TCL_ERROR)
|
if (SWIG_init(interp) == TCL_ERROR)
|
||||||
return TCL_ERROR;
|
return TCL_ERROR;
|
||||||
Tcl_SetVar(interp, (char *) "tcl_rcFileName",SWIG_RcFileName,TCL_GLOBAL_ONLY);
|
Tcl_SetVar(interp, (char *) "tcl_rcFileName",SWIG_RcFileName,TCL_GLOBAL_ONLY);
|
||||||
#ifdef SWIG_RcRsrcName
|
|
||||||
Tcl_SetVar(interp, (char *) "tcl_rcRsrcName",SWIG_RcRsrcName,TCL_GLOBAL);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return TCL_OK;
|
return TCL_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
#ifdef MAC_TCL
|
|
||||||
char *newArgv[2];
|
|
||||||
|
|
||||||
if (MacintoshInit() != TCL_OK) {
|
|
||||||
Tcl_Exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
argc = 1;
|
|
||||||
newArgv[0] = "tclsh";
|
|
||||||
newArgv[1] = NULL;
|
|
||||||
argv = newArgv;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
Tcl_Main(argc, argv, Tcl_AppInit);
|
Tcl_Main(argc, argv, Tcl_AppInit);
|
||||||
return(0);
|
return(0);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -35,11 +35,6 @@ as follows (this should be included in a code-block) :
|
||||||
char *SWIG_RcFileName = "~/.wishrc";
|
char *SWIG_RcFileName = "~/.wishrc";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef MAC_TCL
|
|
||||||
extern int MacintoshInit _ANSI_ARGS_((void));
|
|
||||||
extern int SetupMainInterp _ANSI_ARGS_((Tcl_Interp *interp));
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*----------------------------------------------------------------------
|
*----------------------------------------------------------------------
|
||||||
*
|
*
|
||||||
|
|
@ -61,10 +56,9 @@ extern int SetupMainInterp _ANSI_ARGS_((Tcl_Interp *interp));
|
||||||
|
|
||||||
int Tcl_AppInit(Tcl_Interp *interp)
|
int Tcl_AppInit(Tcl_Interp *interp)
|
||||||
{
|
{
|
||||||
#ifndef MAC_TCL
|
|
||||||
Tk_Window main;
|
Tk_Window main;
|
||||||
main = Tk_MainWindow(interp);
|
main = Tk_MainWindow(interp);
|
||||||
#endif
|
|
||||||
/*
|
/*
|
||||||
* Call the init procedures for included packages. Each call should
|
* Call the init procedures for included packages. Each call should
|
||||||
* look like this:
|
* look like this:
|
||||||
|
|
@ -93,10 +87,6 @@ int Tcl_AppInit(Tcl_Interp *interp)
|
||||||
return TCL_ERROR;
|
return TCL_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef MAC_TCL
|
|
||||||
SetupMainInterp(interp);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Specify a user-specific startup file to invoke if the application
|
* Specify a user-specific startup file to invoke if the application
|
||||||
* is run interactively. Typically the startup file is "~/.apprc"
|
* is run interactively. Typically the startup file is "~/.apprc"
|
||||||
|
|
@ -104,31 +94,12 @@ int Tcl_AppInit(Tcl_Interp *interp)
|
||||||
* then no user-specific startup file will be run under any conditions.
|
* then no user-specific startup file will be run under any conditions.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
Tcl_SetVar(interp, (char *) "tcl_rcFileName",SWIG_RcFileName,TCL_GLOBAL_ONLY);
|
Tcl_SetVar(interp, (char *) "tcl_rcFileName",SWIG_RcFileName,TCL_GLOBAL_ONLY);
|
||||||
|
|
||||||
/* For Macintosh might also want this */
|
|
||||||
|
|
||||||
#ifdef MAC_TCL
|
|
||||||
#ifdef SWIG_RcRsrcName
|
|
||||||
Tcl_SetVar(interp, (char *) "tcl_rcRsrcName",SWIG_RcRsrcName,TCL_GLOBAL_ONLY);
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
return TCL_OK;
|
return TCL_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if TK_MAJOR_VERSION >= 4
|
#if TK_MAJOR_VERSION >= 4
|
||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
|
|
||||||
#ifdef MAC_TCL
|
|
||||||
char *newArgv[2];
|
|
||||||
if (MacintoshInit() != TCL_OK) {
|
|
||||||
Tcl_Exit(1);
|
|
||||||
}
|
|
||||||
argc = 1;
|
|
||||||
newArgv[0] = "Wish";
|
|
||||||
newArgv[1] = NULL;
|
|
||||||
argv = newArgv;
|
|
||||||
#endif
|
|
||||||
Tk_Main(argc, argv, Tcl_AppInit);
|
Tk_Main(argc, argv, Tcl_AppInit);
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -14,9 +14,7 @@
|
||||||
#ifndef SWIG_DOH_H
|
#ifndef SWIG_DOH_H
|
||||||
#define SWIG_DOH_H
|
#define SWIG_DOH_H
|
||||||
|
|
||||||
#ifndef MACSWIG
|
|
||||||
#include "swigconfig.h"
|
#include "swigconfig.h"
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
|
||||||
|
|
@ -84,11 +84,6 @@ static TargetLanguageModule modules[] = {
|
||||||
{NULL, NULL, NULL, Disabled}
|
{NULL, NULL, NULL, Disabled}
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef MACSWIG
|
|
||||||
#include <console.h>
|
|
||||||
#include <SIOUX.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------
|
//-----------------------------------------------------------------
|
||||||
// main()
|
// main()
|
||||||
//
|
//
|
||||||
|
|
@ -222,11 +217,6 @@ int main(int margc, char **margv) {
|
||||||
SWIG_merge_envopt(getenv("SWIG_FEATURES"), margc, margv, &argc, &argv);
|
SWIG_merge_envopt(getenv("SWIG_FEATURES"), margc, margv, &argc, &argv);
|
||||||
merge_options_files(&argc, &argv);
|
merge_options_files(&argc, &argv);
|
||||||
|
|
||||||
#ifdef MACSWIG
|
|
||||||
SIOUXSettings.asktosaveonclose = false;
|
|
||||||
argc = ccommand(&argv);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
Swig_init_args(argc, argv);
|
Swig_init_args(argc, argv);
|
||||||
|
|
||||||
/* Get options */
|
/* Get options */
|
||||||
|
|
|
||||||
|
|
@ -110,11 +110,7 @@ static List *Swig_search_path_any(int syspath) {
|
||||||
assert(slist);
|
assert(slist);
|
||||||
filename = NewStringEmpty();
|
filename = NewStringEmpty();
|
||||||
assert(filename);
|
assert(filename);
|
||||||
#ifdef MACSWIG
|
|
||||||
Printf(filename, "%s", SWIG_FILE_DELIMITER);
|
|
||||||
#else
|
|
||||||
Printf(filename, ".%s", SWIG_FILE_DELIMITER);
|
Printf(filename, ".%s", SWIG_FILE_DELIMITER);
|
||||||
#endif
|
|
||||||
Append(slist, filename);
|
Append(slist, filename);
|
||||||
Delete(filename);
|
Delete(filename);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -218,7 +218,7 @@ void Swig_filename_correct(String *filename) {
|
||||||
if (fname[0] == '/' && fname[1] == '/')
|
if (fname[0] == '/' && fname[1] == '/')
|
||||||
network_path = 1;
|
network_path = 1;
|
||||||
}
|
}
|
||||||
#if defined(_WIN32) || defined(MACSWIG)
|
#if defined(_WIN32)
|
||||||
/* accept Unix path separator on non-Unix systems */
|
/* accept Unix path separator on non-Unix systems */
|
||||||
Replaceall(filename, "/", SWIG_FILE_DELIMITER);
|
Replaceall(filename, "/", SWIG_FILE_DELIMITER);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -14,9 +14,7 @@
|
||||||
#ifndef SWIG_SWIG_H
|
#ifndef SWIG_SWIG_H
|
||||||
#define SWIG_SWIG_H
|
#define SWIG_SWIG_H
|
||||||
|
|
||||||
#ifndef MACSWIG
|
|
||||||
#include "swigconfig.h"
|
#include "swigconfig.h"
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
|
||||||
|
|
@ -34,9 +34,7 @@ extern void Swig_file_debug_set(void);
|
||||||
|
|
||||||
/* Delimiter used in accessing files and directories */
|
/* Delimiter used in accessing files and directories */
|
||||||
|
|
||||||
#if defined(MACSWIG)
|
#if defined(_WIN32)
|
||||||
# define SWIG_FILE_DELIMITER ":"
|
|
||||||
#elif defined(_WIN32)
|
|
||||||
# define SWIG_FILE_DELIMITER "\\"
|
# define SWIG_FILE_DELIMITER "\\"
|
||||||
#else
|
#else
|
||||||
# define SWIG_FILE_DELIMITER "/"
|
# define SWIG_FILE_DELIMITER "/"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue