suppression du support Mac OS 9

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@6065 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
master
Damien Doligez 2004-01-08 22:28:48 +00:00
parent 5cfb0e6121
commit 794c184571
9 changed files with 5 additions and 106 deletions

View File

@ -19,13 +19,8 @@
/* <include ../config/m.h> */
/* <include ../config/s.h> */
/* <private> */
#if !macintosh
#include "../config/m.h"
#include "../config/s.h"
#else
#include <m.h>
#include <s.h>
#endif
/* </private> */
#ifndef CAML_NAME_SPACE

View File

@ -408,11 +408,7 @@ void caml_init_gc (unsigned long minor_size, unsigned long major_size,
unsigned long major_heap_size = Bsize_wsize (norm_heapincr (major_size));
#ifdef DEBUG
caml_gc_message (-1, "### O'Caml runtime: debug mode "
#ifdef CPU_TYPE_STRING
"(" CPU_TYPE_STRING ") "
#endif
"###\n", 0);
caml_gc_message (-1, "### O'Caml runtime: debug mode ###\n", 0);
#endif
caml_set_minor_heap_size (Bsize_wsize (norm_minsize (minor_size)));

View File

@ -19,9 +19,7 @@
#include <fcntl.h>
#include <limits.h>
#include <string.h>
#if !macintosh
#include <sys/types.h>
#endif
#include "config.h"
#ifdef HAS_UNISTD
#include <unistd.h>
@ -35,9 +33,6 @@
#include "mlvalues.h"
#include "signals.h"
#include "sys.h"
#ifdef HAS_UI
#include "ui.h"
#endif
#ifndef SEEK_SET
#define SEEK_SET 0
@ -147,9 +142,6 @@ static int do_write(int fd, char *p, int n)
int retcode;
Assert(!Is_young((value) p));
#ifdef HAS_UI
retcode = ui_write(fd, p, n);
#else
again:
caml_enter_blocking_section();
retcode = write(fd, p, n);
@ -165,7 +157,6 @@ again:
n = 1; goto again;
}
}
#endif
if (retcode == -1) caml_sys_error(NO_ARG);
return retcode;
}
@ -265,14 +256,10 @@ CAMLexport int caml_do_read(int fd, char *p, unsigned int n)
/*Assert(!Is_young((value) p)); ** Is_young only applies to a true value */
caml_enter_blocking_section();
#ifdef HAS_UI
retcode = ui_read(fd, p, n);
#else
#ifdef EINTR
do { retcode = read(fd, p, n); } while (retcode == -1 && errno == EINTR);
#else
retcode = read(fd, p, n);
#endif
#endif
caml_leave_blocking_section();
if (retcode == -1) caml_sys_error(NO_ARG);

View File

@ -26,20 +26,12 @@ CAMLextern void caml_main (char **);
CAMLextern void caml_expand_command_line (int *, char ***);
#endif
#if macintosh
#include "rotatecursor.h"
#include "signals.h"
#endif
int main(int argc, char **argv)
{
#ifdef _WIN32
/* Expand wildcards and diversions in command line */
caml_expand_command_line(&argc, &argv);
#endif
#if macintosh
rotatecursor_options (&caml_something_to_do, 0, NULL);
#endif /* macintosh */
caml_main(argv);
caml_sys_exit(Val_int(0));
return 0; /* not reached */

View File

@ -17,9 +17,6 @@
#include "config.h"
#include "misc.h"
#include "memory.h"
#ifdef HAS_UI
#include "ui.h"
#endif
#ifdef DEBUG
@ -32,55 +29,35 @@ int caml_failed_assert (char * expr, char * file, int line)
return 1; /* not reached */
}
#endif
#endif /* DEBUG */
unsigned long caml_verb_gc = 0;
void caml_gc_message (int level, char *msg, unsigned long arg)
{
if (level < 0 || (caml_verb_gc & level) != 0){
#ifdef HAS_UI
ui_print_stderr(msg, (void *) arg);
#else
fprintf (stderr, msg, arg);
fflush (stderr);
#endif
}
}
void caml_fatal_error (char *msg)
{
#ifdef HAS_UI
ui_print_stderr("%s", msg);
ui_exit (2);
#else
fprintf (stderr, "%s", msg);
exit(2);
#endif
}
void caml_fatal_error_arg (char *fmt, char *arg)
{
#ifdef HAS_UI
ui_print_stderr(fmt, arg);
ui_exit (2);
#else
fprintf (stderr, fmt, arg);
exit(2);
#endif
}
void caml_fatal_error_arg2 (char *fmt1, char *arg1, char *fmt2, char *arg2)
{
#ifdef HAS_UI
ui_print_stderr(fmt1, arg1);
ui_print_stderr(fmt2, arg2);
ui_exit (2);
#else
fprintf (stderr, fmt1, arg1);
fprintf (stderr, fmt2, arg2);
exit(2);
#endif
}
char *caml_aligned_malloc (asize_t size, int modulo, void **block)

View File

@ -24,9 +24,6 @@
#include "fail.h"
#include "misc.h"
#include "mlvalues.h"
#ifdef HAS_UI
#include "ui.h"
#endif
#include "printexc.h"
struct stringbuf {
@ -119,11 +116,7 @@ void caml_fatal_uncaught_exception(value exn)
caml_backtrace_pos = saved_backtrace_pos;
#endif
/* Display the uncaught exception */
#ifdef HAS_UI
ui_print_stderr("Fatal error: exception %s\n", msg);
#else
fprintf(stderr, "Fatal error: exception %s\n", msg);
#endif
free(msg);
/* Display the backtrace if available */
#ifndef NATIVE_CODE
@ -132,9 +125,5 @@ void caml_fatal_uncaught_exception(value exn)
}
#endif
/* Terminate the process */
#ifdef HAS_UI
ui_exit(2);
#else
exit(2);
#endif
}

View File

@ -25,10 +25,6 @@
#include "signals.h"
#include "sys.h"
#if macintosh
#include "rotatecursor.h"
#endif /* macintosh */
#ifdef _WIN32
typedef void (*sighandler)(int sig);
extern sighandler caml_win32_signal(int sig, sighandler action);
@ -61,9 +57,6 @@ void caml_process_event(void)
async_action = caml_async_action_hook;
caml_async_action_hook = NULL;
if (async_action != NULL) (*async_action)();
#if macintosh
ROTATECURSOR_MAGIC ();
#endif
}
static int rev_convert_signal_number(int signo);

View File

@ -22,16 +22,11 @@
#include <stdio.h>
#include <string.h>
#include <time.h>
#if !macintosh
#include <sys/types.h>
#include <sys/stat.h>
#endif
#if !macintosh && !_WIN32
#if !_WIN32
#include <sys/wait.h>
#endif
#if macintosh
#include "macintosh.h"
#endif
#include "config.h"
#ifdef HAS_UNISTD
#include <unistd.h>
@ -51,9 +46,6 @@
#include "signals.h"
#include "stacks.h"
#include "sys.h"
#ifdef HAS_UI
#include "ui.h"
#endif
#ifndef _WIN32
extern int errno;
@ -121,11 +113,7 @@ CAMLprim value caml_sys_exit(value retcode)
#ifndef NATIVE_CODE
caml_debugger(PROGRAM_EXIT);
#endif
#ifdef HAS_UI
ui_exit(Int_val(retcode));
#else
exit(Int_val(retcode));
#endif
return Val_unit;
}
@ -158,11 +146,7 @@ CAMLprim value caml_sys_open(value path, value flags, value perm)
strcpy(p, String_val(path));
/* open on a named FIFO can block (PR#1533) */
caml_enter_blocking_section();
fd = open(p, caml_convert_flag_list(flags, sys_open_flags)
#if !macintosh
, Int_val(perm)
#endif
);
fd = open(p, caml_convert_flag_list(flags, sys_open_flags), Int_val(perm));
caml_leave_blocking_section();
caml_stat_free(p);
if (fd == -1) caml_sys_error(path);
@ -180,16 +164,8 @@ CAMLprim value caml_sys_close(value fd)
CAMLprim value caml_sys_file_exists(value name)
{
#if macintosh
int f;
f = open (String_val (name), O_RDONLY);
if (f == -1) return (Val_bool (0));
close (f);
return (Val_bool (1));
#else
struct stat st;
return Val_bool(stat(String_val(name), &st) == 0);
#endif
}
CAMLprim value caml_sys_remove(value name)

View File

@ -18,9 +18,7 @@
#include <windows.h>
#include <stdlib.h>
#include <stdio.h>
#ifndef HAS_UI
#include <io.h>
#endif
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
@ -191,8 +189,6 @@ sighandler caml_win32_signal(int sig, sighandler action)
/* Expansion of @responsefile and *? file patterns in the command line */
#ifndef HAS_UI
static int argc;
static char ** argv;
static int argvsize;
@ -330,8 +326,6 @@ CAMLexport void caml_expand_command_line(int * argcp, char *** argvp)
*argvp = argv;
}
#endif
/* Add to [contents] the (short) names of the files contained in
the directory named [dirname]. No entries are added for [.] and [..].
Return 0 on success, -1 on error; set errno in the case of error. */
@ -389,4 +383,4 @@ void caml_signal_thread(void * lpParam)
}
}
#endif
#endif /* NATIVE_CODE */