mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 15:48:51 +00:00
Remove if ODIN_OS == .Windows in file that can only be built on Windows
This commit is contained in:
@@ -315,38 +315,36 @@ _is_UNC :: proc(path: string) -> bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_volume_name_len :: proc(path: string) -> int {
|
_volume_name_len :: proc(path: string) -> int {
|
||||||
if ODIN_OS == .Windows {
|
if len(path) < 2 {
|
||||||
if len(path) < 2 {
|
return 0
|
||||||
return 0
|
}
|
||||||
}
|
c := path[0]
|
||||||
c := path[0]
|
if path[1] == ':' {
|
||||||
if path[1] == ':' {
|
switch c {
|
||||||
switch c {
|
case 'a'..='z', 'A'..='Z':
|
||||||
case 'a'..='z', 'A'..='Z':
|
return 2
|
||||||
return 2
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// URL: https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx
|
// URL: https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx
|
||||||
if l := len(path); l >= 5 && _is_path_separator(path[0]) && _is_path_separator(path[1]) &&
|
if l := len(path); l >= 5 && _is_path_separator(path[0]) && _is_path_separator(path[1]) &&
|
||||||
!_is_path_separator(path[2]) && path[2] != '.' {
|
!_is_path_separator(path[2]) && path[2] != '.' {
|
||||||
for n := 3; n < l-1; n += 1 {
|
for n := 3; n < l-1; n += 1 {
|
||||||
if _is_path_separator(path[n]) {
|
if _is_path_separator(path[n]) {
|
||||||
n += 1
|
n += 1
|
||||||
if !_is_path_separator(path[n]) {
|
if !_is_path_separator(path[n]) {
|
||||||
if path[n] == '.' {
|
if path[n] == '.' {
|
||||||
break
|
break
|
||||||
}
|
|
||||||
}
|
}
|
||||||
for ; n < l; n += 1 {
|
|
||||||
if _is_path_separator(path[n]) {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return n
|
|
||||||
}
|
}
|
||||||
break
|
for ; n < l; n += 1 {
|
||||||
|
if _is_path_separator(path[n]) {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return n
|
||||||
}
|
}
|
||||||
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0
|
return 0
|
||||||
|
|||||||
Reference in New Issue
Block a user