mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-21 22:59:16 +02:00
more windows updates, library compiles in VC++ now
This commit is contained in:
parent
a44ec2a883
commit
e3f4d51ef7
7 changed files with 250 additions and 13 deletions
206
chibi-scheme.vcproj
Normal file
206
chibi-scheme.vcproj
Normal file
|
@ -0,0 +1,206 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<VisualStudioProject
|
||||||
|
ProjectType="Visual C++"
|
||||||
|
Version="9.00"
|
||||||
|
Name="chibi-scheme"
|
||||||
|
ProjectGUID="{38DC39DA-5328-4FFE-84E2-E16FF1864945}"
|
||||||
|
RootNamespace="chibi-scheme"
|
||||||
|
Keyword="Win32Proj"
|
||||||
|
TargetFrameworkVersion="0"
|
||||||
|
>
|
||||||
|
<Platforms>
|
||||||
|
<Platform
|
||||||
|
Name="Win32"
|
||||||
|
/>
|
||||||
|
</Platforms>
|
||||||
|
<ToolFiles>
|
||||||
|
</ToolFiles>
|
||||||
|
<Configurations>
|
||||||
|
<Configuration
|
||||||
|
Name="Debug|Win32"
|
||||||
|
OutputDirectory="Debug"
|
||||||
|
IntermediateDirectory="Debug"
|
||||||
|
ConfigurationType="2"
|
||||||
|
>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreBuildEventTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCustomBuildTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCXMLDataGeneratorTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCWebServiceProxyGeneratorTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCMIDLTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
Optimization="0"
|
||||||
|
AdditionalIncludeDirectories="include"
|
||||||
|
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;CHIBISCHEME_EXPORTS"
|
||||||
|
MinimalRebuild="true"
|
||||||
|
BasicRuntimeChecks="3"
|
||||||
|
RuntimeLibrary="3"
|
||||||
|
UsePrecompiledHeader="0"
|
||||||
|
WarningLevel="3"
|
||||||
|
Detect64BitPortabilityProblems="true"
|
||||||
|
DebugInformationFormat="4"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCManagedResourceCompilerTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCResourceCompilerTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreLinkEventTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCLinkerTool"
|
||||||
|
LinkIncremental="2"
|
||||||
|
GenerateDebugInformation="true"
|
||||||
|
SubSystem="2"
|
||||||
|
TargetMachine="1"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCALinkTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCManifestTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCXDCMakeTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCBscMakeTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCFxCopTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCAppVerifierTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPostBuildEventTool"
|
||||||
|
/>
|
||||||
|
</Configuration>
|
||||||
|
<Configuration
|
||||||
|
Name="Release|Win32"
|
||||||
|
OutputDirectory="Release"
|
||||||
|
IntermediateDirectory="Release"
|
||||||
|
ConfigurationType="2"
|
||||||
|
>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreBuildEventTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCustomBuildTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCXMLDataGeneratorTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCWebServiceProxyGeneratorTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCMIDLTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;CHIBISCHEME_EXPORTS;"
|
||||||
|
RuntimeLibrary="2"
|
||||||
|
UsePrecompiledHeader="0"
|
||||||
|
WarningLevel="3"
|
||||||
|
Detect64BitPortabilityProblems="true"
|
||||||
|
DebugInformationFormat="3"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCManagedResourceCompilerTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCResourceCompilerTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreLinkEventTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCLinkerTool"
|
||||||
|
LinkIncremental="2"
|
||||||
|
GenerateDebugInformation="true"
|
||||||
|
SubSystem="2"
|
||||||
|
OptimizeReferences="2"
|
||||||
|
EnableCOMDATFolding="2"
|
||||||
|
TargetMachine="1"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCALinkTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCManifestTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCXDCMakeTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCBscMakeTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCFxCopTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCAppVerifierTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPostBuildEventTool"
|
||||||
|
/>
|
||||||
|
</Configuration>
|
||||||
|
</Configurations>
|
||||||
|
<References>
|
||||||
|
</References>
|
||||||
|
<Files>
|
||||||
|
<Filter
|
||||||
|
Name="Header Files"
|
||||||
|
Filter="h;hpp;hxx;hm;inl;inc;xsd"
|
||||||
|
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
|
||||||
|
>
|
||||||
|
</Filter>
|
||||||
|
<Filter
|
||||||
|
Name="Resource Files"
|
||||||
|
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
|
||||||
|
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
|
||||||
|
>
|
||||||
|
</Filter>
|
||||||
|
<Filter
|
||||||
|
Name="Source Files"
|
||||||
|
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
|
||||||
|
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
|
||||||
|
>
|
||||||
|
<File
|
||||||
|
RelativePath=".\eval.c"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\main.c"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\sexp.c"
|
||||||
|
>
|
||||||
|
<FileConfiguration
|
||||||
|
Name="Debug|Win32"
|
||||||
|
>
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
PreprocessorDefinitions="-DPLATFORM=mingw;-DSEXP_USE_STRING_STREAMS=0;-DSEXP_USE_DEBUG=0;-DSEXP_USE_DL=0;-DBUILDING_DLL"
|
||||||
|
/>
|
||||||
|
</FileConfiguration>
|
||||||
|
</File>
|
||||||
|
</Filter>
|
||||||
|
</Files>
|
||||||
|
<Globals>
|
||||||
|
</Globals>
|
||||||
|
</VisualStudioProject>
|
2
eval.c
2
eval.c
|
@ -1334,9 +1334,9 @@ sexp sexp_make_foreign (sexp ctx, const char *name, int num_args,
|
||||||
|
|
||||||
sexp sexp_define_foreign_aux (sexp ctx, sexp env, const char *name, int num_args,
|
sexp sexp_define_foreign_aux (sexp ctx, sexp env, const char *name, int num_args,
|
||||||
int flags, sexp_proc1 f, sexp data) {
|
int flags, sexp_proc1 f, sexp data) {
|
||||||
|
sexp res = SEXP_VOID;
|
||||||
sexp_gc_var1(op);
|
sexp_gc_var1(op);
|
||||||
sexp_gc_preserve1(ctx, op);
|
sexp_gc_preserve1(ctx, op);
|
||||||
sexp res = SEXP_VOID;
|
|
||||||
op = sexp_make_foreign(ctx, name, num_args, flags, f, data);
|
op = sexp_make_foreign(ctx, name, num_args, flags, f, data);
|
||||||
if (sexp_exceptionp(op))
|
if (sexp_exceptionp(op))
|
||||||
res = op;
|
res = op;
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
#ifndef SEXP_BIGNUM_H
|
#ifndef SEXP_BIGNUM_H
|
||||||
#define SEXP_BIGNUM_H
|
#define SEXP_BIGNUM_H
|
||||||
|
|
||||||
#if (SEXP_64_BIT)
|
#if (SEXP_64_BIT) && defined(__GNUC__)
|
||||||
typedef unsigned int uint128_t __attribute__((mode(TI)));
|
typedef unsigned int uint128_t __attribute__((mode(TI)));
|
||||||
typedef int sint128_t __attribute__((mode(TI)));
|
typedef int sint128_t __attribute__((mode(TI)));
|
||||||
typedef uint128_t sexp_luint_t;
|
typedef uint128_t sexp_luint_t;
|
||||||
|
|
|
@ -230,7 +230,7 @@
|
||||||
#define SEXP_BSD 1
|
#define SEXP_BSD 1
|
||||||
#else
|
#else
|
||||||
#define SEXP_BSD 0
|
#define SEXP_BSD 0
|
||||||
#ifndef _GNU_SOURCE
|
#if ! defined(_GNU_SOURCE) && ! defined(_WIN32) && ! defined(PLAN9)
|
||||||
#define _GNU_SOURCE
|
#define _GNU_SOURCE
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
@ -260,7 +260,7 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef SEXP_USE_DL
|
#ifndef SEXP_USE_DL
|
||||||
#ifdef PLAN9
|
#if defined(PLAN9) || defined(_WIN32)
|
||||||
#define SEXP_USE_DL 0
|
#define SEXP_USE_DL 0
|
||||||
#else
|
#else
|
||||||
#define SEXP_USE_DL ! SEXP_USE_NO_FEATURES
|
#define SEXP_USE_DL ! SEXP_USE_NO_FEATURES
|
||||||
|
@ -387,8 +387,12 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef SEXP_USE_STRING_STREAMS
|
#ifndef SEXP_USE_STRING_STREAMS
|
||||||
|
#ifdef _WIN32
|
||||||
|
#define SEXP_USE_STRING_STREAMS 0
|
||||||
|
#else
|
||||||
#define SEXP_USE_STRING_STREAMS ! SEXP_USE_NO_FEATURES
|
#define SEXP_USE_STRING_STREAMS ! SEXP_USE_NO_FEATURES
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef SEXP_USE_AUTOCLOSE_PORTS
|
#ifndef SEXP_USE_AUTOCLOSE_PORTS
|
||||||
#define SEXP_USE_AUTOCLOSE_PORTS ! SEXP_USE_NO_FEATURES
|
#define SEXP_USE_AUTOCLOSE_PORTS ! SEXP_USE_NO_FEATURES
|
||||||
|
@ -434,6 +438,24 @@
|
||||||
#define strncasecmp cistrncmp
|
#define strncasecmp cistrncmp
|
||||||
#define round(x) floor((x)+0.5)
|
#define round(x) floor((x)+0.5)
|
||||||
#define trunc(x) floor((x)+0.5*(((x)<0)?1:0))
|
#define trunc(x) floor((x)+0.5*(((x)<0)?1:0))
|
||||||
|
#elif defined(_WIN32)
|
||||||
|
#define snprintf(buf, len, fmt, val) sprintf(buf, fmt, val)
|
||||||
|
#define strcasecmp lstrcmpi
|
||||||
|
#define strncasecmp(s1, s2, n) lstrcmpi(s1, s2)
|
||||||
|
#define round(x) floor((x)+0.5)
|
||||||
|
#define trunc(x) floor((x)+0.5*(((x)<0)?1:0))
|
||||||
|
#define isnan(x) (x!=x)
|
||||||
|
#define isinf(x) (x > DBL_MAX || x < -DBL_MAX)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
#define sexp_pos_infinity (DBL_MAX*DBL_MAX)
|
||||||
|
#define sexp_neg_infinity -sexp_pos_infinity
|
||||||
|
#define sexp_nan log(-2)
|
||||||
|
#else
|
||||||
|
#define sexp_pos_infinity (1.0/0.0)
|
||||||
|
#define sexp_neg_infinity -sexp_pos_infinity
|
||||||
|
#define sexp_nan (0.0/0.0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __MINGW32__
|
#ifdef __MINGW32__
|
||||||
|
|
|
@ -40,6 +40,10 @@ typedef unsigned long size_t;
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
#if SEXP_USE_FLONUMS
|
||||||
|
#include <float.h>
|
||||||
|
#include <limits.h>
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
@ -115,7 +119,12 @@ enum sexp_types {
|
||||||
SEXP_NUM_CORE_TYPES
|
SEXP_NUM_CORE_TYPES
|
||||||
};
|
};
|
||||||
|
|
||||||
#if SEXP_64_BIT
|
#ifdef _WIN32
|
||||||
|
typedef unsigned short sexp_tag_t;
|
||||||
|
typedef SIZE_T sexp_uint_t;
|
||||||
|
typedef SSIZE_T sexp_sint_t;
|
||||||
|
#define sexp_heap_align(n) sexp_align(n, 5)
|
||||||
|
#elif SEXP_64_BIT
|
||||||
typedef unsigned int sexp_tag_t;
|
typedef unsigned int sexp_tag_t;
|
||||||
typedef unsigned long sexp_uint_t;
|
typedef unsigned long sexp_uint_t;
|
||||||
typedef long sexp_sint_t;
|
typedef long sexp_sint_t;
|
||||||
|
|
12
sexp.c
12
sexp.c
|
@ -851,9 +851,8 @@ sexp sexp_make_vector_op (sexp ctx sexp_api_params(self, n), sexp len, sexp dflt
|
||||||
}
|
}
|
||||||
|
|
||||||
sexp sexp_list_to_vector_op (sexp ctx sexp_api_params(self, n), sexp ls) {
|
sexp sexp_list_to_vector_op (sexp ctx sexp_api_params(self, n), sexp ls) {
|
||||||
sexp x, vec = sexp_make_vector(ctx, sexp_length(ctx, ls), SEXP_VOID);
|
|
||||||
sexp *elts;
|
|
||||||
int i;
|
int i;
|
||||||
|
sexp x, *elts, vec = sexp_make_vector(ctx, sexp_length(ctx, ls), SEXP_VOID);
|
||||||
if (sexp_exceptionp(vec)) return vec;
|
if (sexp_exceptionp(vec)) return vec;
|
||||||
elts = sexp_vector_data(vec);
|
elts = sexp_vector_data(vec);
|
||||||
for (i=0, x=ls; sexp_pairp(x); i++, x=sexp_cdr(x))
|
for (i=0, x=ls; sexp_pairp(x); i++, x=sexp_cdr(x))
|
||||||
|
@ -1054,7 +1053,8 @@ sexp sexp_buffered_write_string (sexp ctx, const char *str, sexp p) {
|
||||||
|
|
||||||
sexp sexp_buffered_flush (sexp ctx, sexp p) {
|
sexp sexp_buffered_flush (sexp ctx, sexp p) {
|
||||||
sexp_gc_var1(tmp);
|
sexp_gc_var1(tmp);
|
||||||
sexp_assert_type(ctx, sexp_oportp, SEXP_OPORT, p);
|
if (! sexp_oportp(p))
|
||||||
|
return sexp_type_exception(ctx, NULL, SEXP_OPORT, p);
|
||||||
if (! sexp_port_openp(p))
|
if (! sexp_port_openp(p))
|
||||||
return sexp_user_exception(ctx, SEXP_FALSE, "port is closed", p);
|
return sexp_user_exception(ctx, SEXP_FALSE, "port is closed", p);
|
||||||
else {
|
else {
|
||||||
|
@ -1722,11 +1722,11 @@ sexp sexp_read_raw (sexp ctx, sexp in) {
|
||||||
res = sexp_read_symbol(ctx, in, c1, 1);
|
res = sexp_read_symbol(ctx, in, c1, 1);
|
||||||
#if SEXP_USE_INFINITIES
|
#if SEXP_USE_INFINITIES
|
||||||
if (res == sexp_intern(ctx, "+inf.0", -1))
|
if (res == sexp_intern(ctx, "+inf.0", -1))
|
||||||
res = sexp_make_flonum(ctx, 1.0/0.0);
|
res = sexp_make_flonum(ctx, sexp_pos_infinity);
|
||||||
else if (res == sexp_intern(ctx, "-inf.0", -1))
|
else if (res == sexp_intern(ctx, "-inf.0", -1))
|
||||||
res = sexp_make_flonum(ctx, -1.0/0.0);
|
res = sexp_make_flonum(ctx, sexp_neg_infinity);
|
||||||
else if (res == sexp_intern(ctx, "+nan.0", -1))
|
else if (res == sexp_intern(ctx, "+nan.0", -1))
|
||||||
res = sexp_make_flonum(ctx, 0.0/0.0);
|
res = sexp_make_flonum(ctx, sexp_nan);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
4
vm.c
4
vm.c
|
@ -28,7 +28,7 @@ void sexp_stack_trace (sexp ctx, sexp out) {
|
||||||
if (sexp_truep(sexp_bytecode_name(bc)))
|
if (sexp_truep(sexp_bytecode_name(bc)))
|
||||||
sexp_write(ctx, sexp_bytecode_name(bc), out);
|
sexp_write(ctx, sexp_bytecode_name(bc), out);
|
||||||
else
|
else
|
||||||
sexp_printf(ctx, out, "anon: %p", bc);
|
sexp_write_string(ctx, "<anonymous>", out);
|
||||||
if ((ls=sexp_bytecode_source(bc)) && sexp_pairp(ls)) {
|
if ((ls=sexp_bytecode_source(bc)) && sexp_pairp(ls)) {
|
||||||
if (sexp_fixnump(sexp_cdr(ls)) && (sexp_cdr(ls) >= SEXP_ZERO)) {
|
if (sexp_fixnump(sexp_cdr(ls)) && (sexp_cdr(ls) >= SEXP_ZERO)) {
|
||||||
sexp_write_string(ctx, " on line ", out);
|
sexp_write_string(ctx, " on line ", out);
|
||||||
|
@ -1071,7 +1071,7 @@ sexp sexp_vm (sexp ctx, sexp proc) {
|
||||||
if (tmp2 == SEXP_ZERO) {
|
if (tmp2 == SEXP_ZERO) {
|
||||||
#if SEXP_USE_FLONUMS
|
#if SEXP_USE_FLONUMS
|
||||||
if (sexp_flonump(tmp1) && sexp_flonum_value(tmp1) == 0.0)
|
if (sexp_flonump(tmp1) && sexp_flonum_value(tmp1) == 0.0)
|
||||||
_ARG1 = sexp_make_flonum(ctx, 0.0/0.0);
|
_ARG1 = sexp_make_flonum(ctx, 0.0);
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
sexp_raise("divide by zero", SEXP_NULL);
|
sexp_raise("divide by zero", SEXP_NULL);
|
||||||
|
|
Loading…
Add table
Reference in a new issue