mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
compiler: add support for $if x32, x64, big_endian, little_endian
This commit is contained in:
committed by
Alexander Medvednikov
parent
751a89ccc8
commit
e577b40743
@@ -62,18 +62,27 @@ fn (p mut Parser) comp_time() {
|
||||
p.genln('#endif')
|
||||
}
|
||||
}
|
||||
else if name == 'x64' {
|
||||
p.comptime_if_block('TARGET_IS_64BIT')
|
||||
}
|
||||
else if name == 'x32' {
|
||||
p.comptime_if_block('TARGET_IS_32BIT')
|
||||
}
|
||||
else if name == 'big_endian' {
|
||||
p.comptime_if_block('TARGET_ORDER_IS_BIG')
|
||||
}
|
||||
else if name == 'little_endian' {
|
||||
p.comptime_if_block('TARGET_ORDER_IS_LITTLE')
|
||||
}
|
||||
else if name == 'debug' {
|
||||
p.genln('#ifdef VDEBUG')
|
||||
p.check(.lcbr)
|
||||
p.statements_no_rcbr()
|
||||
p.genln('#endif')
|
||||
p.comptime_if_block('VDEBUG')
|
||||
}
|
||||
else if name == 'tinyc' {
|
||||
p.comptime_if_block('__TINYC__')
|
||||
}
|
||||
else if name == 'glibc' {
|
||||
p.comptime_if_block('__GLIBC__')
|
||||
}
|
||||
}
|
||||
else if name == 'mingw' {
|
||||
p.comptime_if_block('__MINGW32__')
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user