summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Doligez <damien.doligez-inria.fr>2001-03-13 16:37:33 +0000
committerDamien Doligez <damien.doligez-inria.fr>2001-03-13 16:37:33 +0000
commitf2bcd946bf87aa94475cb45b2b36c327da638c94 (patch)
treee5ff67a921803553509449c7d860e105d32c9cb5
parentd00e87e4ccaa7dc27d087a39c5208c1f9472991e (diff)
downloadocaml-f2bcd946bf87aa94475cb45b2b36c327da638c94.tar.gz
macos9: suppression GUSI (PR#307)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@3466 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
-rw-r--r--maccaml/Makefile.Mac98
-rw-r--r--maccaml/appli.r11
-rw-r--r--maccaml/errors.c3
-rw-r--r--maccaml/events.c3
-rw-r--r--maccaml/glue.c139
-rw-r--r--maccaml/graph.c15
-rw-r--r--maccaml/main.c9
-rw-r--r--maccaml/main.h6
-rw-r--r--maccaml/menus.c5
-rw-r--r--maccaml/ocamlconstants.h1
-rw-r--r--maccaml/ocamlmkappli2
11 files changed, 94 insertions, 198 deletions
diff --git a/maccaml/Makefile.Mac b/maccaml/Makefile.Mac
index 513429f0b7..0b275eac51 100644
--- a/maccaml/Makefile.Mac
+++ b/maccaml/Makefile.Mac
@@ -12,10 +12,6 @@
# $Id$
-#FIXME Disabled the 68k stuff because GUSI seems to hang during
-# initialisation. I don't have the time to debug this. Let's see if
-# there's anyone left who wants O'Caml on 68k Macs.
-
VERSIONSTR = ¶
"¶"{OCAMLMAJOR}.{OCAMLMINOR}/Mac{MAJOR}.{MINOR}.{BUGFIX}{STAGE}{REV}¶""
@@ -23,35 +19,7 @@ COPYRIGHTSTR = "¶"Copyright 1991-2001 INRIA¶""
XIncludes = -i ::byterun:,::config: ¶
-i ":WASTE:WASTE 1.3 Distribution:WASTE C/C++ Headers:" ¶
- -includes unix -i "{GUSI}include:"
-
-C = sc
-cplus = scpp
-COptions = {XIncludes} {cdbgflag} -model far -mbg full
-LinkOptions = -model far -compact -pad 0 -state nouse -br 68k -msg nodup
-CamlrunLibs = ::otherlibs:num:libnums.o ¶
- ::otherlibs:bigarray:libbigarray.o ¶
- ::otherlibs:systhreads:libthreads.o ¶
- ::otherlibs:macosunix:libcamlrun-unix.o ¶
- ::otherlibs:str:libstr.o
-WELibs = ":WASTE:WASTE 1.3 Distribution:WASTELib.o"
-gusilibs = "{gusi}lib:gusi_mpw.sc.lib" ¶
- "{gusi}lib:gusi_sfio.sc.lib" ¶
- "{gusi}lib:gusi_core.sc.lib" ¶
- "{sfio}lib:sfio.sc.lib"
-SysLibs = "{libraries}sio.far.o" ¶
- "{CLibraries}CPlusLib.o" ¶
- "{CLibraries}StdCLib.far.o" ¶
- "{Libraries}MacRuntime.o" ¶
- "{Libraries}Interface.o" ¶
- "{Libraries}IntEnv.far.o" ¶
- "{Libraries}MathLib.far.o" ¶
- "{Libraries}ToolLibs.o" ¶
- "{CLibraries}IOStreams.far.o" ¶
- "{Libraries}OpenTransport.o" ¶
- "{Libraries}OpenTransportApp.o" ¶
- "{Libraries}OpenTptInet.o"
-Libs = {camlrunlibs} {welibs} {gusilibs} {syslibs}
+# -includes unix -i "{GUSI}include:"
PPCC = mrc -proto strict -w 6
PPCCplus = mrcpp
@@ -59,58 +27,52 @@ PPCCOptions = {XIncludes} {cdbgflag}
PPCLinkOptions = -d {ldbgflag}
PPCCamlrunLibs = ::otherlibs:num:libnums.x ¶
::otherlibs:bigarray:libbigarray.x ¶
- ::otherlibs:systhreads:libthreads.x ¶
- ::otherlibs:macosunix:libcamlrun-unix.x ¶
+# ::otherlibs:systhreads:libthreads.x ¶
+ ::byterun:libcamlrun-gui.x ¶
::otherlibs:str:libstr.x
PPCWELibs = ":WASTE:WASTE 1.3 Distribution:WASTELib.x"
-ppcgusilibs = "{gusi}lib:gusi_mpw.mrc.lib" ¶
- "{gusi}lib:gusi_sfio.mrc.lib" ¶
- "{gusi}lib:gusi_core.mrc.lib" ¶
- "{sfio}lib:sfio.mrc.lib"
-PPCSysLibs = "{ppclibraries}ppcsio.o" ¶
+#ppcgusilibs = "{gusi}lib:gusi_mpw.mrc.lib" ¶
+# "{gusi}lib:gusi_sfio.mrc.lib" ¶
+# "{gusi}lib:gusi_core.mrc.lib" ¶
+# "{sfio}lib:sfio.mrc.lib"
+PPCSysLibs = #"{ppclibraries}ppcsio.o" ¶
"{PPCLibraries}MrCPlusLib.o" ¶
"{PPCLibraries}PPCStdCLib.o" ¶
"{PPCLibraries}StdCRuntime.o" ¶
"{PPCLibraries}PPCCRuntime.o" ¶
"{PPCLibraries}PPCToolLibs.o" ¶
"{SharedLibraries}InterfaceLib" ¶
- "{SharedLibraries}ThreadsLib" ¶
- "{PPCLibraries}MrCIOStreams.o" ¶
+# "{SharedLibraries}ThreadsLib" ¶
+# "{PPCLibraries}MrCIOStreams.o" ¶
"{SharedLibraries}StdCLib" ¶
- "{SharedLibraries}OpenTransportLib" ¶
- "{SharedLibraries}OpenTptInternetLib" ¶
- "{PPCLibraries}OpenTransportAppPPC.o" ¶
- "{PPCLibraries}OpenTptInetPPC.o" ¶
+# "{SharedLibraries}OpenTransportLib" ¶
+# "{SharedLibraries}OpenTptInternetLib" ¶
+# "{PPCLibraries}OpenTransportAppPPC.o" ¶
+# "{PPCLibraries}OpenTptInetPPC.o" ¶
"{sharedlibraries}MathLib" ¶
"{sharedlibraries}DragLib"
-PPCLibs = {ppccamlrunlibs} {ppcwelibs} {ppcgusilibs} {ppcsyslibs}
-
+PPCLibs = {ppccamlrunlibs} {ppcwelibs} {ppcsyslibs}
+# {ppcgusilibs}
+
camllibs = ::otherlibs:graph:graphics.cma ¶
::otherlibs:num:nums.cma ¶
- ::otherlibs:macosunix:unix.cma ¶
+# ::otherlibs:macosunix:unix.cma ¶
::otherlibs:bigarray:bigarray.cma ¶
- ::otherlibs:systhreads:threads.cma
+# ::otherlibs:systhreads:threads.cma
-primfiles = ::byterun:primitives ::otherlibs:macosunix:unix-primitives ¶
- prim_bigarray prim_graph prim_num prim_str prim_systhreads
+primfiles = ::byterun:primitives prim_bigarray prim_graph prim_num prim_str
+# prim_systhreads ::otherlibs:macosunix:unix-primitives
RezDefs = -d MAJORVNUM={MAJOR} -d MINORVNUM=0x{MINOR}{BUGFIX} ¶
-d STAGE={STAGE} -d DEVVNUM={REV} ¶
-d VERSIONSTR={VERSIONSTR} -d COPYRIGHTSTR={COPYRIGHTSTR}
-OBJS = aboutbox.c.o appleevents.c.o clipboard.c.o ¶
- drag.c.o errors.c.o ¶
- events.c.o files.c.o glue.c.o ¶
- graph.c.o lcontrols.c.o lib.c.o main.c.o mcmemory.c.o ¶
- menus.c.o mcmisc.c.o modalfilter.c.o prefs.c.o prims.c.o ¶
- print.c.o scroll.c.o windows.c.o gusistuff.cp.o
-
PPCOBJS = aboutbox.c.x appleevents.c.x clipboard.c.x ¶
drag.c.x errors.c.x ¶
events.c.x files.c.x glue.c.x ¶
graph.c.x lcontrols.c.x lib.c.x main.c.x mcmemory.c.x ¶
menus.c.x mcmisc.c.x modalfilter.c.x prefs.c.x prims.c.x ¶
- print.c.x scroll.c.x windows.c.x gusistuff.cp.x
+ print.c.x scroll.c.x windows.c.x #gusistuff.cp.x
all Ä appli appliprims ocamlconstants.h appli.r "Objective Caml"
set status 0
@@ -131,27 +93,15 @@ prims.c Ä appliprims
echo '0 };'
end > prims.c
-gusistuff.cp.x Ä gusistuff.cp
- {ppccplus} {ppccoptions} -bool on -includes unix -i "{gusi}include" ¶
- gusistuff.cp -o gusistuff.cp.x -w 2
-
-gusistuff.cp.o Ä gusistuff.cp
- {cplus} {coptions} -bool on -includes unix -i "{gusi}include" ¶
- gusistuff.cp -w 2
-
OCaml.PPC Ä {PPCOBJS} {ppccamlrunlibs}
ppclink -o OCaml.PPC {ppclinkoptions} {PPCOBJS} {ppclibs}
rename -y OCaml.PPC.xcoff "Objective Caml.xcoff" || set status 0
-OCaml.68k Ä {OBJS} {camlrunlibs}
- ilink -o OCaml.68k {linkoptions} {OBJS} {libs}
-
dummy_fragment Ä dummy_fragment.c.x
ppclink -xm l -o dummy_fragment {ppclinkoptions} dummy_fragment.c.x
-appli ÄÄ OCaml.PPC dummy_fragment #FIXME OCaml.68k
- #FIXME duplicate -y OCaml.68k appli
- delete -i appli #FIXME
+appli ÄÄ OCaml.PPC dummy_fragment
+ delete -i appli
mergefragment -a OCaml.PPC appli
mergefragment dummy_fragment appli
diff --git a/maccaml/appli.r b/maccaml/appli.r
index ac0be1a2dd..d032cdba6f 100644
--- a/maccaml/appli.r
+++ b/maccaml/appli.r
@@ -126,12 +126,10 @@ data 'ICON' (1000) { /* kApplicationIcon */
data 'TEXT' (kAboutText2, purgeable) {
"Includes (parts of) Objective Caml, MPW libraries,"
- " the WASTE text engine, GUSI, and SFIO.\n"
+ "and the WASTE text engine.\n"
"\n"
- "GUSI Copyright (C) 1992-1999 Matthias Neeracher\n"
- "MPW © 1983-1999 by Apple Computer, Inc., all rights reserved\n"
- "Objective Caml Copyright 1991-2000 INRIA, all rights reserved.\n"
- "SFIO Copyright (c) 1991, 1996 by AT&T Labs - Research.\n"
+ "Objective Caml Copyright 1991-2001 INRIA, all rights reserved.\n"
+ "MPW © 1983-2001 by Apple Computer, Inc., all rights reserved\n"
"WASTE text engine © 1993-1998 Marco Piovanelli\n"
};
@@ -311,7 +309,7 @@ resource 'DITL' (kAlertExit) {
{10, 70, 95, 328},
StaticText {
disabled,
- "The " APPLNAME " toplevel loop has terminated.\n\n"
+ "The " APPLNAME " toplevel loop has terminated^0^1.\n\n"
"Any further input in the toplevel window will be ignored."
},
}
@@ -512,6 +510,7 @@ resource 'STR#' (kMiscStrings, purgeable) {
"Save file as:",
"",
"Unable to write to \"",
+ " with error code ",
}
};
diff --git a/maccaml/errors.c b/maccaml/errors.c
index 7545c0acda..9847a9773d 100644
--- a/maccaml/errors.c
+++ b/maccaml/errors.c
@@ -27,8 +27,7 @@ void assert_failure (char *condition, char *file, int line)
InitCursor ();
modalkeys = kKeysOK;
StopAlert (kAlertBug, myModalFilterUPP);
- quit_requested = 1;
- exit (0);
+ FinaliseAndQuit ();
}
void XXX (void)
diff --git a/maccaml/events.c b/maccaml/events.c
index 41d5ca594c..8fb5fb6b56 100644
--- a/maccaml/events.c
+++ b/maccaml/events.c
@@ -14,9 +14,6 @@
#include "main.h"
-/* [quit_requested] becomes true when the user chooses File:Quit */
-int quit_requested = 0;
-
/* [intr_requested] is true if the user typed command-period and the
SIGINT signal was not yet delivered.
*/
diff --git a/maccaml/glue.c b/maccaml/glue.c
index 14860352b4..4822625fbc 100644
--- a/maccaml/glue.c
+++ b/maccaml/glue.c
@@ -16,7 +16,6 @@
#include <fcntl.h>
#include <signal.h>
#include <stdlib.h>
-#include <unistd.h>
#include "alloc.h"
#include "mlvalues.h"
@@ -33,16 +32,11 @@ Handle macos_getfullpathname (short vrefnum, long dirid);
/* This pointer contains the environment variables. */
char *envPtr = NULL;
-
-/* The last time that O'Caml was seen doing some compute-bound work,
- as returned by [TickCount]. */
-static UInt32 caml_working_date;
-
-/* The number of threads that are blocked reading from the console. */
+/* True if the Caml program is reading from the console. */
static int caml_reading_console = 0;
/* [Caml_working] is used to manage the processor idle state on
- PowerBooks. [Caml_working (1)] disable the idle state, and
+ PowerBooks. [Caml_working (1)] disables the idle state, and
[Caml_working (0)] enables it.
*/
static int caml_at_work = 0;
@@ -118,9 +112,8 @@ int AdjustRotatingCursor (void)
static pascal void interp_yield (long counter)
{
- caml_working_date = TickCount ();
RotateCursor (counter);
- sched_yield ();
+ GetAndProcessEvents (noWait, 0, 0);
if (intr_requested){
intr_requested = 0;
raise (SIGINT);
@@ -197,12 +190,6 @@ static OSErr expand_escapes (Handle s)
return err;
}
-static void caml_main_then_exit (char **argv)
-{
- caml_main (argv);
- exit (0);
-}
-
/* [build_command_line] creates the array of strings that represents
the command line according to the template found in
the 'Line'(kCommandLineTemplate) resource and the environment
@@ -276,11 +263,7 @@ static OSErr build_command_line (char ***p_argv)
OSErr launch_caml_main (void)
{
char **argv;
- pthread_t topthread;
- pthread_attr_t attr;
OSErr err;
- int res;
- sigset_t mask;
rotatecursor_options (&something_to_do, 0, &interp_yield);
err = WinOpenToplevel ();
@@ -288,54 +271,22 @@ OSErr launch_caml_main (void)
err = build_command_line (&argv);
if (err) goto failed;
- pthread_attr_init (&attr);
- pthread_attr_setstacksize (&attr, 256 * 1024);
- res = pthread_create (&topthread, &attr, (void *) caml_main_then_exit,
- (void *) argv);
- pthread_attr_destroy (&attr);
- if (res != 0){
- err = -1;
- goto failed;
- }
-
- /* Block all signals in this thread. */
- sigfillset(&mask);
- pthread_sigmask(SIG_BLOCK, &mask, NULL);
- caml_working_date = TickCount ();
Caml_working (1);
- while (!quit_requested){
- int towait = waitEvent;
- if (motion_requested) towait = waitMove;
- if (TickCount () < caml_working_date + 120){
- towait = noWait;
- Caml_working (1);
- }else{
- Caml_working (0);
- }
- GetAndProcessEvents (towait, motion_oldx, motion_oldy);
- sched_yield ();
- }
- return noErr;
+ caml_main (argv);
+ ui_exit (0);
failed:
return err;
}
-/* SIO stubs */
+/* console I/O functions */
/* Management of error highlighting. */
static int erroring = 0;
static long error_curpos;
static long error_anchor = -1;
-
-static pascal void caml_sio_init (int *mainArgc, char ***mainArgv)
-{
-#pragma unused (mainArgc, mainArgv)
-}
-pascal void (*__sioInit) (int *, char ***) = &caml_sio_init;
-
void FlushUnreadInput (void)
{
WEReference we;
@@ -355,10 +306,8 @@ void FlushUnreadInput (void)
WEFeatureFlag (weFOutlineHilite, weBitSet, we);
}
-static pascal void caml_sio_read (char *buffer, SInt32 nCharsDesired,
- SInt32 *nCharsUsed, SInt16 *eofFlag)
+int ui_read (int fd, char *buffer, unsigned int nCharsDesired)
{
-#pragma unused (eofFlag)
long len, i;
char **htext;
WEReference we;
@@ -367,10 +316,14 @@ static pascal void caml_sio_read (char *buffer, SInt32 nCharsDesired,
short readonly, autoscroll;
int atend;
+ if (fd != 0) return read (fd, buffer, nCharsDesired);
+
we = WinGetWE (winToplevel);
Assert (we != NULL);
htext = (char **) WEGetText (we);
+ ++ caml_reading_console;
+
while (1){
char *p;
@@ -379,17 +332,7 @@ static pascal void caml_sio_read (char *buffer, SInt32 nCharsDesired,
for (i = wintopfrontier; i < len; i++){
if (p[i] == '\n') goto gotit;
}
- ++ caml_reading_console;
- sched_yield ();
- -- caml_reading_console;
- if (pending_signal != 0 && pending_signal != SIGVTALRM){
- /* handle signals, but not the tick thread stuff because:
- 1. We don't hold the master lock so it is not needed.
- 2. It would execute some Caml code and prevent processor idle.
- */
- leave_blocking_section ();
- enter_blocking_section ();
- }
+ GetAndProcessEvents (waitEvent, 0, 0);
}
gotit:
@@ -423,29 +366,29 @@ static pascal void caml_sio_read (char *buffer, SInt32 nCharsDesired,
if (atend) ScrollToEnd (winToplevel);
WinAdvanceTopFrontier (len);
- *nCharsUsed = len;
- caml_working_date = TickCount ();
- return;
+ -- caml_reading_console;
+ return len;
}
-pascal void (*__sioRead) (char *, SInt32, SInt32 *, SInt16 *) = &caml_sio_read;
-static pascal void caml_sio_write (SInt16 filenum, char *buffer, SInt32 nChars)
+int ui_write (int fd, char *buffer, unsigned int nChars)
{
-#pragma unused (filenum)
long selstart, selend;
- WEReference we = WinGetWE (winToplevel);
+ WEReference we;
OSErr err;
short readonly, autoscroll;
int atend;
+ if (fd != 1 && fd != 2) return write (fd, buffer, nChars);
+
Assert (nChars >= 0);
+ we = WinGetWE (winToplevel);
Assert (we != NULL);
if (erroring){ /* overwrite mode to display errors; see terminfo_* */
error_curpos += nChars;
if (error_curpos > wintopfrontier) error_curpos = wintopfrontier;
- return;
+ return nChars;
}
atend = ScrollAtEnd (winToplevel);
@@ -460,7 +403,7 @@ static pascal void caml_sio_write (SInt16 filenum, char *buffer, SInt32 nChars)
err = WEInsert (buffer, nChars, NULL, NULL, we);
if (err != noErr){
WESetSelection (selstart, selend, we);
- return; /* FIXME raise an exception ? */
+ return nChars;
}
if (selstart >= wintopfrontier){
selstart += nChars;
@@ -475,26 +418,44 @@ static pascal void caml_sio_write (SInt16 filenum, char *buffer, SInt32 nChars)
WinAdvanceTopFrontier (nChars);
- caml_working_date = TickCount ();
- return;
+ return nChars;
}
-pascal void (*__sioWrite) (SInt16, char *, SInt32) = &caml_sio_write;
-static pascal void caml_sio_exit (void)
+void ui_print_stderr (char *msg, void *arg)
{
+ char buf [1000];
+
+ sprintf (buf, msg, arg);
+ ui_write (2, buf, strlen (buf));
+}
+
+void ui_exit (int return_code)
+{
+#pragma unused (return_code)
+ Str255 buf0;
+ Str255 buf1;
+
caml_reading_console = 1; /* hack: don't display rotating cursor */
- if (!quit_requested){
- modalkeys = kKeysOK;
- InitCursor ();
- NoteAlert (kAlertExit, myModalFilterUPP);
+
+ if (return_code != 0){
+ GetIndString (buf0, kMiscStrings, kWithErrorCodeIdx);
+ NumToString ((long) return_code, buf1);
+ }else{
+ buf0[0] = 0;
+ buf1[0] = 0;
}
- while (!quit_requested) GetAndProcessEvents (waitEvent, 0, 0);
+ ParamText (buf0, buf1, NULL, NULL);
+ InitCursor ();
+ modalkeys = kKeysOK;
+ NoteAlert (kAlertExit, myModalFilterUPP);
+
+ while (1) GetAndProcessEvents (waitEvent, 0, 0);
+
if (winGraphics != NULL) WinCloseGraphics ();
WinCloseToplevel ();
rotatecursor_final ();
- Finalise ();
+ FinaliseAndQuit ();
}
-pascal void (*__sioExit) (void) = &caml_sio_exit;
/*
diff --git a/maccaml/graph.c b/maccaml/graph.c
index 47678f18d1..3d87b4695e 100644
--- a/maccaml/graph.c
+++ b/maccaml/graph.c
@@ -1096,19 +1096,8 @@ value gr_wait_event (value veventlist)
motion_oldx = pt.h;
motion_oldy = pt.v;
}
- sched_yield ();
- if (pending_signal != 0 && pending_signal != SIGVTALRM){
- /* handle signals, but not the tick thread stuff because:
- 1. We don't hold the master lock so it is not needed.
- 2. It would execute some Caml code and prevent processor idle.
- */
- PopPort;
- intr_requested = 0;
- raise (SIGINT);
- leave_blocking_section ();
- enter_blocking_section ();
- PushWindowPort (winGraphics);
- }
+ GetAndProcessEvents (askmotion ? waitMove : waitEvent,
+ motion_oldx, motion_oldy);
}
gotevent:
diff --git a/maccaml/main.c b/maccaml/main.c
index 992cabe26b..e066d3127e 100644
--- a/maccaml/main.c
+++ b/maccaml/main.c
@@ -99,10 +99,11 @@ static OSErr Initialise (void)
problem: return err;
}
-void Finalise (void)
+void FinaliseAndQuit (void)
{
if (gHasDragAndDrop) RemoveDragHandlers ();
WritePrefs ();
+ ExitToShell ();
}
int main (void)
@@ -111,15 +112,13 @@ int main (void)
err = Initialise ();
if (err != noErr){
- quit_requested = 1;
- exit (0);
+ FinaliseAndQuit ();
}
while (!launch_toplevel_requested){
GetAndProcessEvents (waitEvent, 0, 0);
- if (quit_requested) exit (0);
}
err = launch_caml_main (); /* launch bytecode interp and event loop */
if (err != noErr) ErrorAlertGeneric (err);
- exit (0);
+ FinaliseAndQuit ();
return 0; /* not reached */
}
diff --git a/maccaml/main.h b/maccaml/main.h
index 0a9c6cacee..314e801a5b 100644
--- a/maccaml/main.h
+++ b/maccaml/main.h
@@ -13,7 +13,6 @@
/* $Id$ */
#include <limits.h>
-#include <sched.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
@@ -53,7 +52,7 @@
#include "WASTE.h"
-#include "../byterun/signals.h"
+#include "::byterun:rotatecursor.h"
#include "ocamlconstants.h"
@@ -136,7 +135,6 @@ void ErrorAlertGeneric (OSErr err);
OSErr InitialiseErrors (void);
/* events.c */
-extern int quit_requested;
extern int intr_requested;
extern UInt32 last_event_date;
extern UInt32 evtSleep;
@@ -184,7 +182,7 @@ void LCSynch( ControlRef );
extern int gHasDragAndDrop;
extern int gHasPowerManager;
extern int launch_toplevel_requested;
-void Finalise (void);
+void FinaliseAndQuit (void);
/* memory.c */
OSErr AllocHandle (Size size, Handle *result);
diff --git a/maccaml/menus.c b/maccaml/menus.c
index 87ab67cc40..1dbdabe282 100644
--- a/maccaml/menus.c
+++ b/maccaml/menus.c
@@ -42,7 +42,10 @@ OSErr DoQuit ()
if (err != noErr) return err;
}
done:
- quit_requested = 1;
+ if (winGraphics != NULL) WinCloseGraphics ();
+ WinCloseToplevel ();
+ rotatecursor_final ();
+ FinaliseAndQuit ();
return noErr;
}
diff --git a/maccaml/ocamlconstants.h b/maccaml/ocamlconstants.h
index 417ababbf1..b974806e4b 100644
--- a/maccaml/ocamlconstants.h
+++ b/maccaml/ocamlconstants.h
@@ -105,6 +105,7 @@
#define kSaveAsPromptIdx 7
#define kEmptyIdx 8
#define kCannotWriteIdx 9
+#define kWithErrorCodeIdx 10
#define kErrorStrings 1002
#define kMemFull 1
diff --git a/maccaml/ocamlmkappli b/maccaml/ocamlmkappli
index f048dbd915..c300c16a6c 100644
--- a/maccaml/ocamlmkappli
+++ b/maccaml/ocamlmkappli
@@ -20,7 +20,7 @@
# -creator <code> use this creator code (default '????')
# -ocamlc <command> use <command> as O'Caml compiler (default ocamlc)
# -d <def> pass "-d <def>" option to Rez
-# -prefsize <int> set preferred memory size (megabytes, default 4000)
+# -prefsize <int> set preferred memory size (kilobytes, default 4000)
# -lib <folder> use library files from <folder> (default {CAMLLIB})
# -minsize <int> set minimum memory size (megabytes, default 2000)
# -name <name> set the name of the application (default a.out)