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