瀏覽代碼

added IS_SUPPORTED to core:sys/posix

RaphGL 1 月之前
父節點
當前提交
e374ace10d
共有 3 個文件被更改,包括 17 次插入0 次删除
  1. 2 0
      core/sys/posix/posix.odin
  2. 10 0
      core/sys/posix/posix_other.odin
  3. 5 0
      core/sys/posix/posix_unix.odin

+ 2 - 0
core/sys/posix/posix.odin

@@ -53,6 +53,8 @@ import "base:intrinsics"
 
 import "core:c"
 
+IS_SUPPORTED :: _IS_SUPPORTED
+
 result :: enum c.int {
  	// Use `errno` and `strerror` for more information.
 	FAIL = -1,

+ 10 - 0
core/sys/posix/posix_other.odin

@@ -0,0 +1,10 @@
+#+build !linux
+#+build !darwin
+#+build !netbsd
+#+build !openbsd
+#+build !freebsd
+#+build !haiku
+package posix
+
+_IS_SUPPORTED :: false
+

+ 5 - 0
core/sys/posix/posix_unix.odin

@@ -0,0 +1,5 @@
+#+build linux, darwin, netbsd, openbsd, freebsd, haiku
+package posix
+
+_IS_SUPPORTED :: true
+