Browse Source

More std lib fixes

Just selecting the same codepath as other BSD's for the most part.
Andreas T Jonsson 1 year ago
parent
commit
dd95a8d11d
4 changed files with 6 additions and 6 deletions
  1. 1 1
      core/c/libc/stdio.odin
  2. 2 2
      core/net/dns.odin
  3. 1 1
      core/prof/spall/spall_unix.odin
  4. 2 2
      core/sys/info/cpu_intel.odin

+ 1 - 1
core/c/libc/stdio.odin

@@ -83,7 +83,7 @@ when ODIN_OS == .Linux {
 	}
 	}
 }
 }
 
 
-when ODIN_OS == .OpenBSD {
+when ODIN_OS == .OpenBSD || ODIN_OS == .NetBSD {
 	fpos_t :: distinct i64
 	fpos_t :: distinct i64
 
 
 	_IOFBF :: 0
 	_IOFBF :: 0

+ 2 - 2
core/net/dns.odin

@@ -30,7 +30,7 @@ when ODIN_OS == .Windows {
 		resolv_conf        = "",
 		resolv_conf        = "",
 		hosts_file         = "%WINDIR%\\system32\\drivers\\etc\\hosts",
 		hosts_file         = "%WINDIR%\\system32\\drivers\\etc\\hosts",
 	}
 	}
-} else when ODIN_OS == .Linux || ODIN_OS == .Darwin || ODIN_OS == .OpenBSD {
+} else when ODIN_OS == .Linux || ODIN_OS == .Darwin || ODIN_OS == .OpenBSD || ODIN_OS == .NetBSD {
 	DEFAULT_DNS_CONFIGURATION :: DNS_Configuration{
 	DEFAULT_DNS_CONFIGURATION :: DNS_Configuration{
 		resolv_conf        = "/etc/resolv.conf",
 		resolv_conf        = "/etc/resolv.conf",
 		hosts_file         = "/etc/hosts",
 		hosts_file         = "/etc/hosts",
@@ -854,4 +854,4 @@ parse_response :: proc(response: []u8, filter: DNS_Record_Type = nil, allocator
 	}
 	}
 
 
 	return _records[:], true
 	return _records[:], true
-}
+}

+ 1 - 1
core/prof/spall/spall_unix.odin

@@ -1,5 +1,5 @@
 //+private
 //+private
-//+build darwin, freebsd, openbsd
+//+build darwin, freebsd, openbsd, netbsd
 package spall
 package spall
 
 
 // Only for types.
 // Only for types.

+ 2 - 2
core/sys/info/cpu_intel.odin

@@ -67,7 +67,7 @@ init_cpu_features :: proc "c" () {
 	try_set(&set, .os_xsave,  27, ecx1)
 	try_set(&set, .os_xsave,  27, ecx1)
 	try_set(&set, .rdrand,    30, ecx1)
 	try_set(&set, .rdrand,    30, ecx1)
 
 
-	when ODIN_OS == .FreeBSD || ODIN_OS == .OpenBSD {
+	when ODIN_OS == .FreeBSD || ODIN_OS == .OpenBSD || ODIN_OS == .NetBSD {
 		// xgetbv is an illegal instruction under FreeBSD 13 & OpenBSD 7.1
 		// xgetbv is an illegal instruction under FreeBSD 13 & OpenBSD 7.1
 		// return before probing further
 		// return before probing further
 		cpu_features = set
 		cpu_features = set
@@ -133,4 +133,4 @@ init_cpu_name :: proc "c" () {
 		brand = brand[:len(brand) - 1]
 		brand = brand[:len(brand) - 1]
 	}
 	}
 	cpu_name = brand
 	cpu_name = brand
-}
+}