femtolisp
femtolisp copied to clipboard
Cygwin `make` gives an "unknown platform" error
I am running on Windows 7 64 bit using Cygwin.
I receive the following error:
gcc -O2 -DNDEBUG -falign-functions -Wall -Wno-strict-aliasing -Illt -DUSE_COMPUTED_GOTO -c flisp.c -o flisp.o
In file included from llt/llt.h:5,
from flisp.c:46:
llt/dtypes.h:29:4: #error "unknown platform"
llt/dtypes.h:42:4: #error "__SIZEOF_POINTER__ undefined"
llt/dtypes.h:49:4: #error "this is one weird machine"
llt/dtypes.h:90:4: #error "unknown platform"
In file included from flisp.c:744:
read.c: In function `nextchar':
read.c:122: warning: array subscript has type `char'
read.c: In function `read_token':
read.c:162: warning: array subscript has type `char'
read.c: In function `peek':
read.c:260: warning: array subscript has type `char'
Makefile:25: recipe for target `flisp.o' failed
make: *** [flisp.o] Error 1
This seems to be because the __SIZEOF_POINTER__
constant is not defined.
I would like to take a stab at making this work, but I'm curious: what I will need to change within the dtypes.h
file?
As an aside, Cygwin's pointer sizes are:
Cygwin Windows Cygwin
Linux x86_64 Linux
Windows x86_64
i686
sizeof(int) 4 4 4
sizeof(long) 4 4 8
sizeof(size_t) 4 8 8
sizeof(void*) 4 8 8
Under Cygwin, gcc defines macros __CYGWIN__
and __unix__
, for use in platform checks. __CYGWIN__
is probably the one to use in the conditional at line 20 here. The ENDIAN macros seem to be defined as __ORDER_LITTLE_ENDIAN__
, etc. on Cygwin. I've made a gist with the output of gcc -dM -E - <<<''
(which lists all predefined macros) here, run on Cygwin 2.10.0 x86_64 with gcc 6.4.0. __SIZEOF_POINTER__
does seem predefined here - perhaps it was introduced in the meantime.