mirror of
https://github.com/Ed94/Odin.git
synced 2026-07-28 18:30:06 +00:00
Require parentheses for #align(N)
This commit is contained in:
@@ -257,7 +257,7 @@ Typeid_Kind :: enum u8 {
|
||||
}
|
||||
#assert(len(Typeid_Kind) < 32)
|
||||
|
||||
// Typeid_Bit_Field :: bit_field #align align_of(uintptr) {
|
||||
// Typeid_Bit_Field :: bit_field #align(align_of(uintptr)) {
|
||||
// index: 8*size_of(uintptr) - 8,
|
||||
// kind: 5, // Typeid_Kind
|
||||
// named: 1,
|
||||
|
||||
@@ -87,7 +87,7 @@ MAP_CACHE_LINE_SIZE :: 1 << MAP_CACHE_LINE_LOG2
|
||||
//
|
||||
// In the optimal case, len(Map_Cell(T){}.data) = 1 so the cell array can be treated
|
||||
// as a regular array of T, which is the case for hashes.
|
||||
Map_Cell :: struct($T: typeid) #align MAP_CACHE_LINE_SIZE {
|
||||
Map_Cell :: struct($T: typeid) #align(MAP_CACHE_LINE_SIZE) {
|
||||
data: [MAP_CACHE_LINE_SIZE / size_of(T) when 0 < size_of(T) && size_of(T) < MAP_CACHE_LINE_SIZE else 1]T,
|
||||
}
|
||||
|
||||
|
||||
@@ -398,9 +398,9 @@ print_type :: proc "contextless" (ti: ^Type_Info) {
|
||||
if info.is_packed { print_string("#packed ") }
|
||||
if info.is_raw_union { print_string("#raw_union ") }
|
||||
if info.custom_align {
|
||||
print_string("#align ")
|
||||
print_string("#align(")
|
||||
print_u64(u64(ti.align))
|
||||
print_byte(' ')
|
||||
print_string(") ")
|
||||
}
|
||||
print_byte('{')
|
||||
for name, i in info.names {
|
||||
@@ -414,8 +414,9 @@ print_type :: proc "contextless" (ti: ^Type_Info) {
|
||||
case Type_Info_Union:
|
||||
print_string("union ")
|
||||
if info.custom_align {
|
||||
print_string("#align ")
|
||||
print_string("#align(")
|
||||
print_u64(u64(ti.align))
|
||||
print_string(") ")
|
||||
}
|
||||
if info.no_nil {
|
||||
print_string("#no_nil ")
|
||||
|
||||
Reference in New Issue
Block a user