mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-18 21:29:19 +02:00
patch to compile on 9front
This commit is contained in:
parent
bf4760fa46
commit
b85201f81d
3 changed files with 15 additions and 5 deletions
|
@ -709,6 +709,7 @@
|
||||||
|
|
||||||
#ifndef SEXP_POLL_SLEEP_TIME
|
#ifndef SEXP_POLL_SLEEP_TIME
|
||||||
#define SEXP_POLL_SLEEP_TIME 5000
|
#define SEXP_POLL_SLEEP_TIME 5000
|
||||||
|
#define SEXP_POLL_SLEEP_TIME_MS 5
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef SEXP_USE_IMAGE_LOADING
|
#ifndef SEXP_USE_IMAGE_LOADING
|
||||||
|
|
|
@ -35,6 +35,13 @@ extern "C" {
|
||||||
#ifndef PLAN9
|
#ifndef PLAN9
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#define SEXP_USE_POLL_PORT 1
|
||||||
|
#define sexp_poll_input(ctx, port) sexp_poll_port(ctx, port, 1)
|
||||||
|
#define sexp_poll_output(ctx, port) sexp_poll_port(ctx, port, 0)
|
||||||
|
#else
|
||||||
|
#define SEXP_USE_POLL_PORT 0
|
||||||
|
#define sexp_poll_input(ctx, port) sleep(SEXP_POLL_SLEEP_TIME_MS)
|
||||||
|
#define sexp_poll_output(ctx, port) sleep(SEXP_POLL_SLEEP_TIME_MS)
|
||||||
#endif
|
#endif
|
||||||
#if SEXP_USE_GREEN_THREADS
|
#if SEXP_USE_GREEN_THREADS
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
|
@ -47,9 +54,6 @@ extern "C" {
|
||||||
#define sexp_isdigit(x) (isdigit(x))
|
#define sexp_isdigit(x) (isdigit(x))
|
||||||
#define sexp_tolower(x) (tolower(x))
|
#define sexp_tolower(x) (tolower(x))
|
||||||
#define sexp_toupper(x) (toupper(x))
|
#define sexp_toupper(x) (toupper(x))
|
||||||
#define SEXP_USE_POLL_PORT 1
|
|
||||||
#define sexp_poll_input(ctx, port) sexp_poll_port(ctx, port, 1)
|
|
||||||
#define sexp_poll_output(ctx, port) sexp_poll_port(ctx, port, 0)
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if SEXP_USE_GC_FILE_DESCRIPTORS
|
#if SEXP_USE_GC_FILE_DESCRIPTORS
|
||||||
|
@ -71,6 +75,12 @@ extern "C" {
|
||||||
#include <thread.h>
|
#include <thread.h>
|
||||||
#include <9p.h>
|
#include <9p.h>
|
||||||
typedef unsigned long size_t;
|
typedef unsigned long size_t;
|
||||||
|
typedef long long off_t;
|
||||||
|
#define STRINGIFY(x) #x
|
||||||
|
#define TOSTRING(x) STRINGIFY(x)
|
||||||
|
#define exit(x) exits(TOSTRING(x))
|
||||||
|
#define fabsl fabs
|
||||||
|
#define M_LN10 2.30258509299404568402 /* log_e 10 */
|
||||||
#else
|
#else
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
@ -252,7 +262,7 @@ typedef uint32_t sexp_uint32_t;
|
||||||
typedef int32_t sexp_int32_t;
|
typedef int32_t sexp_int32_t;
|
||||||
# endif
|
# endif
|
||||||
#else
|
#else
|
||||||
# include <limits.h>
|
# include <ape/limits.h>
|
||||||
# if UCHAR_MAX == 255
|
# if UCHAR_MAX == 255
|
||||||
# define SEXP_UINT8_DEFINED 1
|
# define SEXP_UINT8_DEFINED 1
|
||||||
typedef unsigned char sexp_uint8_t;
|
typedef unsigned char sexp_uint8_t;
|
||||||
|
|
1
main.c
1
main.c
|
@ -24,7 +24,6 @@
|
||||||
|
|
||||||
#ifdef PLAN9
|
#ifdef PLAN9
|
||||||
#define exit_failure() exits("ERROR")
|
#define exit_failure() exits("ERROR")
|
||||||
#define exit exits
|
|
||||||
#else
|
#else
|
||||||
#define exit_failure() exit(70)
|
#define exit_failure() exit(70)
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Reference in a new issue