1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

compiler: support for custom flags

[if custom]fn..{} , #flag custom, $if custom {}
This commit is contained in:
Delyan Angelov
2019-12-23 12:09:00 +02:00
committed by Alexander Medvednikov
parent 42b1660c7e
commit 6e130cd446
7 changed files with 107 additions and 21 deletions

View File

@@ -351,7 +351,11 @@ fn os_name_to_ifdef(name string) string {
return ''
}
fn platform_postfix_to_ifdefguard(name string) string {
fn (v &V) platform_postfix_to_ifdefguard(name string) string {
if name.starts_with('custom '){
cdefine := name.replace('custom ','')
return '#ifdef CUSTOM_DEFINE_${cdefine}'
}
s := match name {
'.v'{
''