Skip to content

Commit

Permalink
Fix build for OSX
Browse files Browse the repository at this point in the history
  • Loading branch information
ibuclaw committed Nov 4, 2018
1 parent 3aa6251 commit 392e8b0
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/objc_glue.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,9 @@ Symbol *objc_getMethVarName(const char *s, size_t len)

Symbol *objc_getMethVarName(Identifier *ident)
{
return objc_getMethVarName(ident->string, ident->len);
const char *id = ident->toChars();
size_t id_length = strlen(id);
return objc_getMethVarName(id, id_length);
}

Symbol *objc_getMsgSend(Type *ret, bool hasHiddenArg)
Expand Down Expand Up @@ -257,16 +259,18 @@ Symbol *objc_getMethVarRef(const char *s, size_t len)

Symbol *objc_getMethVarRef(Identifier *ident)
{
return objc_getMethVarRef(ident->string, ident->len);
const char *id = ident->toChars();
size_t id_length = strlen(id);
return objc_getMethVarRef(id, id_length);
}

// MARK: callfunc

void objc_callfunc_setupMethodSelector(Type *tret, FuncDeclaration *fd, Type *t, elem *ehidden, elem **esel)
{
if (fd && fd->objc.selector && !*esel)
if (fd && fd->selector && !*esel)
{
*esel = el_var(objc_getMethVarRef(fd->objc.selector->stringvalue, fd->objc.selector->stringlen));
*esel = el_var(objc_getMethVarRef(fd->selector->stringvalue, fd->selector->stringlen));
}
}

Expand Down

0 comments on commit 392e8b0

Please sign in to comment.