Include string.h for strlen with cpp backend

This commit is contained in:
def
2014-08-07 21:32:17 +02:00
parent 0db99beecb
commit a41be8021b

View File

@@ -1286,6 +1286,7 @@ proc genArrayLen(p: BProc, e: PNode, d: var TLoc, op: TMagic) =
if op == mHigh: unaryExpr(p, e, d, "($1Len0-1)")
else: unaryExpr(p, e, d, "$1Len0")
of tyCString:
if gCmd == cmdCompileToCpp: useStringh(p.module)
if op == mHigh: unaryExpr(p, e, d, "(strlen($1)-1)")
else: unaryExpr(p, e, d, "strlen($1)")
of tyString, tySequence: