diff --git a/Makefile b/Makefile index 79d6aae4..ac5e7c9b 100644 --- a/Makefile +++ b/Makefile @@ -36,10 +36,16 @@ PLATFORM=mingw SOLIBDIR = $(BINDIR) DIFFOPTS = -b else +ifeq ($(shell uname -o),Cygwin) +PLATFORM=cygwin +SOLIBDIR = $(BINDIR) +DIFFOPTS = -b +else PLATFORM=unix endif endif endif +endif ifeq ($(PLATFORM),macosx) SO = .dylib @@ -57,12 +63,20 @@ LDFLAGS += -Wl,--out-implib,libchibi-scheme$(SO).a STATICFLAGS = -DSEXP_USE_DL=0 LIBDL = else +ifeq ($(PLATFORM),cygwin) +SO = .dll +EXE = .exe +CC = gcc +CLIBFLAGS = -shared +LDFLAGS += -Wl,--out-implib,libchibi-scheme$(SO).a +else SO = .so EXE = CLIBFLAGS = -fPIC -shared STATICFLAGS = -static -DSEXP_USE_DL=0 endif endif +endif ifeq ($(USE_BOEHM),1) SEXP_USE_BOEHM = 1 diff --git a/include/chibi/sexp.h b/include/chibi/sexp.h index dd3de98d..39a3ea58 100644 --- a/include/chibi/sexp.h +++ b/include/chibi/sexp.h @@ -129,6 +129,11 @@ typedef unsigned int sexp_tag_t; typedef unsigned long sexp_uint_t; typedef long sexp_sint_t; #define sexp_heap_align(n) sexp_align(n, 5) +#elif __CYGWIN__ +typedef unsigned short sexp_tag_t; +typedef unsigned int sexp_uint_t; +typedef int sexp_sint_t; +#define sexp_heap_align(n) sexp_align(n, 5) #else typedef unsigned short sexp_tag_t; typedef unsigned int sexp_uint_t; diff --git a/lib/srfi/69/hash.c b/lib/srfi/69/hash.c index e739ff1c..42d1e864 100644 --- a/lib/srfi/69/hash.c +++ b/lib/srfi/69/hash.c @@ -34,7 +34,7 @@ static sexp sexp_string_hash (sexp ctx sexp_api_params(self, n), sexp str, sexp static sexp_uint_t string_ci_hash (char *str, sexp_uint_t bound) { sexp_uint_t acc = FNV_OFFSET_BASIS; - while (*str) {acc *= FNV_PRIME; acc ^= tolower(*str++);} + while (*str) {acc *= FNV_PRIME; acc ^= (tolower)(*str++);} return acc % bound; } diff --git a/main.c b/main.c index 03caf762..d07a9767 100644 --- a/main.c +++ b/main.c @@ -163,8 +163,8 @@ void run_main (int argc, char **argv) { check_nonull_arg('h', arg); heap_size = atol(arg); len = strlen(arg); - if (heap_size && isalpha(arg[len-1])) { - switch (tolower(arg[len-1])) { + if (heap_size && (isalpha)(arg[len-1])) { + switch ((tolower)(arg[len-1])) { case 'k': heap_size *= 1024; break; case 'm': heap_size *= (1024*1024); break; } diff --git a/sexp.c b/sexp.c index 5f38669a..8a6f0079 100644 --- a/sexp.c +++ b/sexp.c @@ -1659,7 +1659,7 @@ sexp sexp_read_raw (sexp ctx, sexp in) { if (sexp_string_length(res) == 1) { res = sexp_make_character(c1); } else if ((c1 == 'x' || c1 == 'X') && - isxdigit(str[1]) && isxdigit(str[2]) && str[3] == '\0') { + (isxdigit)(str[1]) && (isxdigit)(str[2]) && str[3] == '\0') { res = sexp_make_character(16 * digit_value(str[1]) + digit_value(str[2])); } else {