From 449fd372f9184f7ffa59015eb49bee8207012654 Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Mon, 15 Jul 2019 19:19:53 +0200 Subject: [PATCH] *_nix.v support --- compiler/main.v | 21 +++++--------------- vlib/http/{download_mac.v => download_nix.v} | 0 vlib/http/{http_mac.v => http_nix.v} | 0 vlib/net/{socket_mac.v => socket_nix.v} | 0 vlib/os/os_mac.v | 3 --- vlib/os/{os_lin.v => os_nix.v} | 0 vlib/sync/{sync_mac.v => sync_nix.v} | 0 7 files changed, 5 insertions(+), 19 deletions(-) rename vlib/http/{download_mac.v => download_nix.v} (100%) rename vlib/http/{http_mac.v => http_nix.v} (100%) rename vlib/net/{socket_mac.v => socket_nix.v} (100%) delete mode 100644 vlib/os/os_mac.v rename vlib/os/{os_lin.v => os_nix.v} (100%) rename vlib/sync/{sync_mac.v => sync_nix.v} (100%) diff --git a/compiler/main.v b/compiler/main.v index 638405fea2..0a99aec2a3 100644 --- a/compiler/main.v +++ b/compiler/main.v @@ -669,11 +669,8 @@ fn (v &V) v_files_from_dir(dir string) []string { if v.pref.is_verbose { println('v_files_from_dir ("$dir")') } - // println(files.len) - // println(files) files.sort() for file in files { - v.log('F=$file') if !file.ends_with('.v') && !file.ends_with('.vh') { continue } @@ -687,19 +684,11 @@ fn (v &V) v_files_from_dir(dir string) []string { continue } if file.ends_with('_mac.v') && v.os != .mac { - lin_file := file.replace('_mac.v', '_lin.v') - // println('lin_file="$lin_file"') - // If there are both _mac.v and _lin.v, don't use _mav.v - if os.file_exists('$dir/$lin_file') { - continue - } - else if v.os == .windows { - continue - } - else { - // If there's only _mav.v, then it can be used on Linux too - } - } + continue + } + if file.ends_with('_nix.v') && v.os == .windows { + continue + } res << '$dir/$file' } return res diff --git a/vlib/http/download_mac.v b/vlib/http/download_nix.v similarity index 100% rename from vlib/http/download_mac.v rename to vlib/http/download_nix.v diff --git a/vlib/http/http_mac.v b/vlib/http/http_nix.v similarity index 100% rename from vlib/http/http_mac.v rename to vlib/http/http_nix.v diff --git a/vlib/net/socket_mac.v b/vlib/net/socket_nix.v similarity index 100% rename from vlib/net/socket_mac.v rename to vlib/net/socket_nix.v diff --git a/vlib/os/os_mac.v b/vlib/os/os_mac.v deleted file mode 100644 index 3d553e42d7..0000000000 --- a/vlib/os/os_mac.v +++ /dev/null @@ -1,3 +0,0 @@ -module os - -#include diff --git a/vlib/os/os_lin.v b/vlib/os/os_nix.v similarity index 100% rename from vlib/os/os_lin.v rename to vlib/os/os_nix.v diff --git a/vlib/sync/sync_mac.v b/vlib/sync/sync_nix.v similarity index 100% rename from vlib/sync/sync_mac.v rename to vlib/sync/sync_nix.v