From f47b27d5320ce76757dc67936da9580f94ede293 Mon Sep 17 00:00:00 2001 From: heterodoxic <122719743+heterodoxic@users.noreply.github.com> Date: Mon, 29 May 2023 14:55:04 +0200 Subject: [PATCH] prevent spamming of thread local forward declarations in C/C++ output (#21955) --- compiler/cgen.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/cgen.nim b/compiler/cgen.nim index b332c6cd76..985af4bbe7 100644 --- a/compiler/cgen.nim +++ b/compiler/cgen.nim @@ -1387,10 +1387,10 @@ proc genVarPrototype(m: BModule, n: PNode) = if sym.owner.id != m.module.id: # else we already have the symbol generated! assert(sym.loc.r != "") + incl(m.declaredThings, sym.id) if sfThread in sym.flags: declareThreadVar(m, sym, true) else: - incl(m.declaredThings, sym.id) if sym.kind in {skLet, skVar, skField, skForVar} and sym.alignment > 0: m.s[cfsVars].addf "NIM_ALIGN($1) ", [rope(sym.alignment)] m.s[cfsVars].add(if m.hcrOn: "static " else: "extern ")