From ac0e77dbc91d4f6af25d825076a6fdec12833f45 Mon Sep 17 00:00:00 2001 From: Timothee Cour Date: Thu, 5 Mar 2020 01:05:31 -0800 Subject: [PATCH] document where seemingly dead-code N_INLINE_PTR is actually used --- compiler/ccgtypes.nim | 1 + lib/nimbase.h | 2 ++ 2 files changed, 3 insertions(+) diff --git a/compiler/ccgtypes.nim b/compiler/ccgtypes.nim index 759330a3ebe0..713ac9f3dc89 100644 --- a/compiler/ccgtypes.nim +++ b/compiler/ccgtypes.nim @@ -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: diff --git a/lib/nimbase.h b/lib/nimbase.h index 605992d3c6f1..004ba170b1b5 100644 --- a/lib/nimbase.h +++ b/lib/nimbase.h @@ -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