Skip to content

Commit 6cf41c6

Browse files
author
Meredith L. Patterson
committed
Merge pull request #100 from thequux/openbsd
Ported to OpenBSD.
2 parents 2c405f4 + cc4ded8 commit 6cf41c6

File tree

7 files changed

+14
-7
lines changed

7 files changed

+14
-7
lines changed

SConstruct

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ env.MergeFlags("-std=gnu99 -Wall -Wextra -Werror -Wno-unused-parameter -Wno-attr
4848

4949
if env['PLATFORM'] == 'darwin':
5050
env.Append(SHLINKFLAGS = '-install_name ' + env["libpath"] + '/${TARGET.file}')
51+
elif os.uname()[0] == "OpenBSD":
52+
pass
5153
else:
5254
env.MergeFlags("-lrt")
5355

src/parsers/action.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ static HParseResult* parse_action(void *env, HParseState *state) {
1313
HParseResult *tmp = h_do_parse(a->p, state);
1414
//HParsedToken *tok = a->action(h_do_parse(a->p, state));
1515
if(tmp) {
16-
const HParsedToken *tok = a->action(tmp, a->user_data);
17-
return make_result(state->arena, (HParsedToken*)tok);
16+
HParsedToken *tok = (HParsedToken*)a->action(tmp, a->user_data);
17+
return make_result(state->arena, tok);
1818
} else
1919
return NULL;
2020
} else // either the parser's missing or the action's missing

src/parsers/and.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,6 @@ HParser* h_and(const HParser* p) {
2525
}
2626
HParser* h_and__m(HAllocator* mm__, const HParser* p) {
2727
// zero-width postive lookahead
28-
return h_new_parser(mm__, &and_vt, (void *)p);
28+
void* env = (void*)p;
29+
return h_new_parser(mm__, &and_vt, env);
2930
}

src/parsers/ignore.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,6 @@ HParser* h_ignore(const HParser* p) {
5555
return h_ignore__m(&system_allocator, p);
5656
}
5757
HParser* h_ignore__m(HAllocator* mm__, const HParser* p) {
58-
return h_new_parser(mm__, &ignore_vt, (void *)p);
58+
void* env = (void*)p;
59+
return h_new_parser(mm__, &ignore_vt, env);
5960
}

src/parsers/not.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,6 @@ HParser* h_not(const HParser* p) {
2121
return h_not__m(&system_allocator, p);
2222
}
2323
HParser* h_not__m(HAllocator* mm__, const HParser* p) {
24-
return h_new_parser(mm__, &not_vt, (void *)p);
24+
void* env = (void*)p;
25+
return h_new_parser(mm__, &not_vt, env);
2526
}

src/parsers/optional.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ HParser* h_optional(const HParser* p) {
9292
HParser* h_optional__m(HAllocator* mm__, const HParser* p) {
9393
// TODO: re-add this
9494
//assert_message(p->vtable != &ignore_vt, "Thou shalt ignore an option, rather than the other way 'round.");
95-
return h_new_parser(mm__, &optional_vt, (void *)p);
95+
void* env = (void*)p;
96+
return h_new_parser(mm__, &optional_vt, env);
9697
}
9798

src/parsers/whitespace.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,5 +81,6 @@ HParser* h_whitespace(const HParser* p) {
8181
return h_whitespace__m(&system_allocator, p);
8282
}
8383
HParser* h_whitespace__m(HAllocator* mm__, const HParser* p) {
84-
return h_new_parser(mm__, &whitespace_vt, (void *)p);
84+
void* env = (void*)p;
85+
return h_new_parser(mm__, &whitespace_vt, env);
8586
}

0 commit comments

Comments
 (0)