Skip to content

Commit

Permalink
Patch clisp.
Browse files Browse the repository at this point in the history
  • Loading branch information
daute committed Apr 11, 2024
1 parent 6b19998 commit 8d52504
Show file tree
Hide file tree
Showing 2 changed files with 150 additions and 3 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/compile_cygwin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
uses: cygwin/cygwin-install-action@v4
with:
platform: x86_64
packages: mingw64-i686-gcc-core mingw64-i686-gcc-g++ mingw64-i686-headers mingw64-i686-runtime make wget unzip
packages: mingw64-i686-gcc-core mingw64-i686-gcc-g++ mingw64-i686-headers mingw64-i686-runtime make wget unzip patch
- name: Download_libffcall
run: wget https://ftp.gnu.org/gnu/libffcall/libffcall-2.4.tar.gz
- name: Extract_libffcall
Expand All @@ -40,14 +40,15 @@ jobs:
run: |
wget https://gitlab.com/gnu-clisp/clisp/-/archive/master/clisp-master.zip
unzip clisp-master.zip
- name: configure
- name: configure_clisp
run: |
PATH=/usr/local/mingw32/bin:/usr/i686-w64-mingw32/sys-root/mingw/bin:$PATH
export PATH
pwd
cd clisp-master
patch -p1 <../token-eof-patch
bash ./configure --config --host=i686-w64-mingw32 --with-debug --disable-threads --enable-compatibility --with-libffcall-prefix=/home/runneradmin/libffcall --with-libsigsegv-prefix=/home/runneradmin/libsigsegv build
- name: compile
- name: compile_clisp
run: |
pwd
cd clisp-master/build
Expand Down
146 changes: 146 additions & 0 deletions token-eof-patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
diff --git a/utils/ccmp2c.c b/utils/ccmp2c.c
index ac9a68978..ed0931166 100644
--- a/utils/ccmp2c.c
+++ b/utils/ccmp2c.c
@@ -366,7 +366,7 @@ peek_char (BUFFILE_t *infile)
/* These are the different token types. */
enum token_type_t
{
- eof, /* End of file */
+ token_eof, /* End of file */
eofcomment, /* End of file inside comment */
eol, /* End of line */
ident, /* Identifier */
@@ -447,7 +447,7 @@ nexttoken (BUFFILE_t *infile, tokens_t *tokens,
switch (c)
{
case EOF: /* EOF */
- token->type = eof;
+ token->type = token_eof;
goto done;
case ' ': case '\v': case '\t':
continue;
@@ -526,7 +526,7 @@ nexttoken (BUFFILE_t *infile, tokens_t *tokens,
{
for (;;) {
token_t *subtoken = nexttoken (infile, tokens, FALSE, TRUE);
- if (subtoken->type == eof
+ if (subtoken->type == token_eof
|| subtoken->type == eofcomment
|| subtoken->type == eol)
break;
@@ -640,7 +640,7 @@ tokenify (unsigned char *line,
token_t *next =
nexttoken (&infile, tokens, *within_comment, within_prep_directive);

- if (next->type == eof)
+ if (next->type == token_eof)
{
*within_comment = FALSE;
break;
diff --git a/utils/gctrigger.c b/utils/gctrigger.c
index 99727a1df..d8a807efe 100644
--- a/utils/gctrigger.c
+++ b/utils/gctrigger.c
@@ -502,7 +502,7 @@ static int next_char (void)
- operator/separator
Generalized tokens can be expressions, with balanced parentheses. */
enum token_type {
- eof,
+ token_eof,
eol,
ident,
number,
@@ -605,7 +605,7 @@ static Token nexttoken (boolean within_prep_directive)
{ int c = next_char();
switch (c) {
case EOF:
- token.type = eof; return token;
+ token.type = token_eof; return token;
case ' ': case '\v': case '\t':
/* Ignore whitespace. */
goto restart;
@@ -650,7 +650,7 @@ static Token nexttoken (boolean within_prep_directive)
/* Preprocessor directive. Read until end of line or EOF. */
while (1) {
Token subtoken = nexttoken(TRUE);
- if (subtoken.type == eof || subtoken.type == eol)
+ if (subtoken.type == token_eof || subtoken.type == eol)
break;
Token_delete(&subtoken);
}
@@ -773,7 +773,7 @@ static Token next_balanced_token (Token* start_token, uintL open_braces_start)
while (1) {
/* Here always open_braces.count >= open_braces_start . */
switch (token.type) {
- case eof:
+ case token_eof:
if (open_braces.count > open_braces_start) {
if (open_braces.count <= MAXBRACES)
fprintf(stderr,"unclosed '%c' in line %lu\n",
@@ -854,7 +854,7 @@ static void convert (void)
VectorToken_init(&parameter_declaration);
while (1) {
token = next_balanced_token(NULL,open_braces.count);
- if (token.type == eof)
+ if (token.type == token_eof)
break;
if (token.type == sep && (token.ch == ',' || token.ch == ')'))
break;
@@ -877,14 +877,14 @@ static void convert (void)
}
}
VectorToken_delete(&parameter_declaration);
- if (token.type == eof)
+ if (token.type == token_eof)
break;
if (token.ch == ')') {
handle_closing_token(&token);
break;
}
}
- if (token.type != eof) {
+ if (token.type != token_eof) {
token = next_token();
if (token.type == sep && token.ch == '{') {
/* Here's the point where we insert the GCTRIGGER statement. */
@@ -921,7 +921,7 @@ static void convert (void)
/* Continue the loop with the new token (as it might be a semicolon). */
goto restart;
}
- if (token.type == eof)
+ if (token.type == token_eof)
break;
Token_delete(&token);
}
diff --git a/utils/varbrace.c b/utils/varbrace.c
index cf071b9d6..c5e855766 100644
--- a/utils/varbrace.c
+++ b/utils/varbrace.c
@@ -1152,7 +1152,7 @@ static inline void line_repeat_endif ()
}


-enum token_type { eof, ident, number, charconst, stringconst, sep, expr };
+enum token_type { token_eof, ident, number, charconst, stringconst, sep, expr };
typedef struct {
enum token_type type;
/* if buffered: */
@@ -1174,7 +1174,7 @@ static Token next_token (void)
switch (c) {
case EOF:
/* EOF */
- token.type = eof;
+ token.type = token_eof;
goto done;
case ' ': case '\v': case '\t': case '\n':
/* whitespace, ignore */
@@ -1436,7 +1436,7 @@ static void convert (FILE* infp, FILE* outfp, const char* infilename)
while (1) {
Token token = next_token();
switch (token.type) {
- case eof:
+ case token_eof:
if (open_braces.count > 0) {
if (open_braces.count <= MAXBRACES) {
fprintf(stderr,"Unclosed '%c' in line %lu\n",

0 comments on commit 8d52504

Please sign in to comment.