implemented alignas pragma (#12643)
* implemented alignas pragma * fix bootstrap * generate c++ compatible syntax for alignas * Make it work. * Multiple alignof expressions. Implement top level alignof.
This commit is contained in:
parent
84861eb48a
commit
0496a666e2
13 changed files with 153 additions and 19 deletions
|
|
@ -549,6 +549,8 @@ proc genRecordFieldsAux(m: BModule, n: PNode,
|
|||
#assert(field.ast == nil)
|
||||
let sname = mangleRecFieldName(m, field)
|
||||
fillLoc(field.loc, locField, n, sname, OnUnknown)
|
||||
if field.alignment > 0:
|
||||
result.addf "alignas($1) ", [rope(field.alignment)]
|
||||
# for importcpp'ed objects, we only need to set field.loc, but don't
|
||||
# have to recurse via 'getTypeDescAux'. And not doing so prevents problems
|
||||
# with heavily templatized C++ code:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue