Skip to content

Commit

Permalink
document where seemingly dead-code N_INLINE_PTR is actually used
Browse files Browse the repository at this point in the history
  • Loading branch information
timotheecour committed Mar 5, 2020
1 parent bafa7a1 commit ac0e77d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions compiler/ccgtypes.nim
Original file line number Diff line number Diff line change
Expand Up @@ -764,6 +764,7 @@ proc getTypeDescAux(m: BModule, origTyp: PType, check: var IntSet): Rope =
genProcParams(m, t, rettype, desc, check, true, true)
if not isImportedType(t):
if t.callConv != ccClosure: # procedure vars may need a closure!
# this is where seemingly dead-code `N_INLINE_PTR` is used
m.s[cfsTypes].addf("typedef $1_PTR($2, $3) $4;$n",
[rope(CallingConvToStr[t.callConv]), rettype, result, desc])
else:
Expand Down
2 changes: 2 additions & 0 deletions lib/nimbase.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ __AVR__
# define N_INLINE(rettype, name) rettype __inline name
#endif

#define N_INLINE_PTR(rettype, name) rettype (*name)

#if defined(__POCC__)
# define NIM_CONST /* PCC is really picky with const modifiers */
# undef _MSC_VER /* Yeah, right PCC defines _MSC_VER even if it is
Expand Down

0 comments on commit ac0e77d

Please sign in to comment.