do not define __offsetof twice
parent
5cfbc7bab5
commit
749d3ec14d
|
@ -21,8 +21,10 @@ const (
|
|||
#endif
|
||||
|
||||
// for __offset_of
|
||||
#ifndef __offsetof
|
||||
#define __offsetof(s,memb) \\
|
||||
((size_t)((char *)&((s *)0)->memb - (char *)0))
|
||||
#endif
|
||||
|
||||
#define OPTION_CAST(x) (x)
|
||||
'
|
||||
|
|
|
@ -1133,7 +1133,6 @@ pub fn env_vflags_and_os_args() []string {
|
|||
}
|
||||
|
||||
pub fn vfmt(args []string) {
|
||||
println('running vfmt...')
|
||||
file := args.last()
|
||||
if !os.exists(file) {
|
||||
println('"$file" does not exist')
|
||||
|
@ -1147,11 +1146,13 @@ pub fn vfmt(args []string) {
|
|||
// launch_tool('vfmt', '-d vfmt')
|
||||
vroot := os.dir(vexe)
|
||||
os.chdir(vroot)
|
||||
println('building vfmt... (it will be cached soon)')
|
||||
ret := os.system('$vexe -o $vroot/tools/vfmt -d vfmt v.v')
|
||||
if ret != 0 {
|
||||
println('err')
|
||||
return
|
||||
}
|
||||
println('running vfmt...')
|
||||
os.exec('$vroot/tools/vfmt $file')or{
|
||||
panic(err)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue