Closed StarSugar closed 9 months ago
I am sad to say even these errors are solved, eisl can not runs well on MacOS.
I appreciate the report. By the way, I do not own a Mac. It would be very helpful if someone could contribute to error fixing.
I added "#include
Yes it works, but it still can't be compiled unless i let worker_count = 2;
as mentioned above.
And I got a segmentation fault when running echo '(load "library/compiler.lsp") (compile-file "$<")' | ./eisl -r
.
In syntax.c queue
out of bound at line 2549, loading null pointer at line 2601.
I have understood the situation. I will carefully review the code.
I fixed. Will it work? sysconf(_SC_NPROCESSORS_CONF) may operate correctly depending on the OS, and in such cases, it could potentially result in a negative number. It is assumed that the current CPU has at least 4 cores. Therefore, in the event of a negative number, we set it to 4 - 1 = 3.
No, it won't, because there is no macro _SC_NPROCESSORS_CONF
's definition unless the words -D_XOPEN_SOURCE=700 -D_XOPEN_SOURCE_EXTENDED
in makefile are deleted. There is a condition in MacOS's
#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
#define _SC_NPROCESSORS_CONF 57
#define _SC_NPROCESSORS_ONLN 58
#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */
Although do so will make addwstr
no longer valid.
How about just define -D_XOPEN_SOURCE=700 -D_XOPEN_SOURCE_EXTENDED
when including
#define _XOPEN_SOURCE=700
#define _XOPEN_SOURCE_EXTENDED
#include <ncurse.h>
#undef _XOPEN_SOURCE
#undef _XOPEN_SOURCE_EXTENDED
I pulled a request. The changes allows the c files can be compiled on MacOS.
Thank you for the pull request. I have made modifications to make it work on Linux. Please accept them.
I closed this issue, for c codes compiling error had been solved.
It seems like
_SC_NPROCESSORS_CONF
isn't exist in MacOS, please trysysctlbyname("hw.logicalcpu", ...)
. Also, please adding a line#include <pthread.h>
in eisl.h to get identifiers likepthread_cond_t
, it is important for clang.