From a2cb01e16aa25e841f5cd085ea93178c57f4e8f1 Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Sat, 11 Jul 2020 19:03:59 +0200 Subject: [PATCH] parser: parse _x64.v files only with -x64 --- vlib/builtin/float.v | 3 +-- vlib/builtin/float_x64.v | 7 +++++++ vlib/v/pref/should_compile.v | 3 +++ 3 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 vlib/builtin/float_x64.v diff --git a/vlib/builtin/float.v b/vlib/builtin/float.v index 2726b14e50..f9faae9854 100644 --- a/vlib/builtin/float.v +++ b/vlib/builtin/float.v @@ -1,6 +1,5 @@ // Copyright (c) 2019-2020 Alexander Medvednikov. All rights reserved. -// Use of this source code is governed by an MIT license -// that can be found in the LICENSE file. +// Use of this source code is governed by an MIT license that can be found in the LICENSE file. module builtin import strconv.ftoa diff --git a/vlib/builtin/float_x64.v b/vlib/builtin/float_x64.v new file mode 100644 index 0000000000..717c77aeae --- /dev/null +++ b/vlib/builtin/float_x64.v @@ -0,0 +1,7 @@ +// Copyright (c) 2019-2020 Alexander Medvednikov. All rights reserved. +// Use of this source code is governed by an MIT license that can be found in the LICENSE file. +module builtin + +fn float_test() { +} + diff --git a/vlib/v/pref/should_compile.v b/vlib/v/pref/should_compile.v index eb4cdf1c02..87e4316177 100644 --- a/vlib/v/pref/should_compile.v +++ b/vlib/v/pref/should_compile.v @@ -72,6 +72,9 @@ pub fn (prefs &Preferences) should_compile_c(file string) bool { if file.ends_with('_solaris.c.v') && prefs.os != .solaris { return false } + if file.ends_with('_x64.v') && prefs.backend != .x64 { + return false + } return true }