Skip to content

Commit

Permalink
Merge pull request #100 from thequux/openbsd
Browse files Browse the repository at this point in the history
Ported to OpenBSD.
  • Loading branch information
Meredith L. Patterson committed Apr 13, 2014
2 parents 2c405f4 + cc4ded8 commit 6cf41c6
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 7 deletions.
2 changes: 2 additions & 0 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ env.MergeFlags("-std=gnu99 -Wall -Wextra -Werror -Wno-unused-parameter -Wno-attr

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

Expand Down
4 changes: 2 additions & 2 deletions src/parsers/action.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ static HParseResult* parse_action(void *env, HParseState *state) {
HParseResult *tmp = h_do_parse(a->p, state);
//HParsedToken *tok = a->action(h_do_parse(a->p, state));
if(tmp) {
const HParsedToken *tok = a->action(tmp, a->user_data);
return make_result(state->arena, (HParsedToken*)tok);
HParsedToken *tok = (HParsedToken*)a->action(tmp, a->user_data);
return make_result(state->arena, tok);
} else
return NULL;
} else // either the parser's missing or the action's missing
Expand Down
3 changes: 2 additions & 1 deletion src/parsers/and.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,6 @@ HParser* h_and(const HParser* p) {
}
HParser* h_and__m(HAllocator* mm__, const HParser* p) {
// zero-width postive lookahead
return h_new_parser(mm__, &and_vt, (void *)p);
void* env = (void*)p;
return h_new_parser(mm__, &and_vt, env);
}
3 changes: 2 additions & 1 deletion src/parsers/ignore.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,6 @@ HParser* h_ignore(const HParser* p) {
return h_ignore__m(&system_allocator, p);
}
HParser* h_ignore__m(HAllocator* mm__, const HParser* p) {
return h_new_parser(mm__, &ignore_vt, (void *)p);
void* env = (void*)p;
return h_new_parser(mm__, &ignore_vt, env);
}
3 changes: 2 additions & 1 deletion src/parsers/not.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,6 @@ HParser* h_not(const HParser* p) {
return h_not__m(&system_allocator, p);
}
HParser* h_not__m(HAllocator* mm__, const HParser* p) {
return h_new_parser(mm__, &not_vt, (void *)p);
void* env = (void*)p;
return h_new_parser(mm__, &not_vt, env);
}
3 changes: 2 additions & 1 deletion src/parsers/optional.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ HParser* h_optional(const HParser* p) {
HParser* h_optional__m(HAllocator* mm__, const HParser* p) {
// TODO: re-add this
//assert_message(p->vtable != &ignore_vt, "Thou shalt ignore an option, rather than the other way 'round.");
return h_new_parser(mm__, &optional_vt, (void *)p);
void* env = (void*)p;
return h_new_parser(mm__, &optional_vt, env);
}

3 changes: 2 additions & 1 deletion src/parsers/whitespace.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,5 +81,6 @@ HParser* h_whitespace(const HParser* p) {
return h_whitespace__m(&system_allocator, p);
}
HParser* h_whitespace__m(HAllocator* mm__, const HParser* p) {
return h_new_parser(mm__, &whitespace_vt, (void *)p);
void* env = (void*)p;
return h_new_parser(mm__, &whitespace_vt, env);
}

0 comments on commit 6cf41c6

Please sign in to comment.