aboutsummaryrefslogtreecommitdiff
path: root/core/c/libc
diff options
context:
space:
mode:
authorSébastien Marie <semarie@online.fr>2022-03-13 11:42:42 +0000
committerSébastien Marie <semarie@online.fr>2022-03-13 11:42:42 +0000
commitca67cf032c5a8e0c0fe711fe668cf4d77b080a62 (patch)
tree84bda0a4fd28eb6ef515247089b5c311d6148180 /core/c/libc
parentf907516cbd0078b69996929d02742d0c1a48c226 (diff)
freebsd_amd64 support
Diffstat (limited to 'core/c/libc')
-rw-r--r--core/c/libc/stdio.odin25
-rw-r--r--core/c/libc/wctype.odin14
2 files changed, 33 insertions, 6 deletions
diff --git a/core/c/libc/stdio.odin b/core/c/libc/stdio.odin
index fc65b954a..004b923e8 100644
--- a/core/c/libc/stdio.odin
+++ b/core/c/libc/stdio.odin
@@ -103,6 +103,31 @@ when ODIN_OS == .OpenBSD {
}
}
+when ODIN_OS == .FreeBSD {
+ fpos_t :: distinct i64
+
+ _IOFBF :: 0
+ _IOLBF :: 1
+ _IONBF :: 1
+
+ BUFSIZ :: 1024
+
+ EOF :: int(-1)
+
+ FOPEN_MAX :: 20
+ FILENAME_MAX :: 1024
+
+ SEEK_SET :: 0
+ SEEK_CUR :: 1
+ SEEK_END :: 2
+
+ foreign libc {
+ stderr: ^FILE
+ stdin: ^FILE
+ stdout: ^FILE
+ }
+}
+
when ODIN_OS == .Darwin {
fpos_t :: distinct i64
diff --git a/core/c/libc/wctype.odin b/core/c/libc/wctype.odin
index f833af51f..43aee9dc6 100644
--- a/core/c/libc/wctype.odin
+++ b/core/c/libc/wctype.odin
@@ -13,21 +13,23 @@ when ODIN_OS == .Windows {
when ODIN_OS == .Windows {
wctrans_t :: distinct wchar_t
wctype_t :: distinct ushort
-}
-when ODIN_OS == .Linux {
+} else when ODIN_OS == .Linux {
wctrans_t :: distinct intptr_t
wctype_t :: distinct ulong
-}
-when ODIN_OS == .Darwin {
+} else when ODIN_OS == .Darwin {
wctrans_t :: distinct int
wctype_t :: distinct u32
-}
-when ODIN_OS == .OpenBSD {
+} else when ODIN_OS == .OpenBSD {
wctrans_t :: distinct rawptr
wctype_t :: distinct rawptr
+
+} else when ODIN_OS == .FreeBSD {
+ wctrans_t :: distinct int
+ wctype_t :: distinct ulong
+
}
@(default_calling_convention="c")