aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgingerBill <gingerBill@users.noreply.github.com>2022-10-21 15:48:43 +0100
committerGitHub <noreply@github.com>2022-10-21 15:48:43 +0100
commitd5047e621dd27cff15dec42bca21f7b93d12e802 (patch)
treec463621aba68efe97b4eb86e724fb9685d3022a6
parent8fbdef01d69f565fb6285851d9a18224a33d3d0a (diff)
parent9f55404845adb10a933cc725c019faa140efb202 (diff)
Merge pull request #2134 from jrfondren/errno-linkfix
fix core:c/libc.errno link_name for Linux and FreeBSD
-rw-r--r--core/c/libc/errno.odin17
1 files changed, 15 insertions, 2 deletions
diff --git a/core/c/libc/errno.odin b/core/c/libc/errno.odin
index 53437f42f..fe6fbb073 100644
--- a/core/c/libc/errno.odin
+++ b/core/c/libc/errno.odin
@@ -14,11 +14,24 @@ when ODIN_OS == .Windows {
// EDOM,
// EILSEQ
// ERANGE
-when ODIN_OS == .Linux || ODIN_OS == .FreeBSD {
+when ODIN_OS == .Linux {
@(private="file")
@(default_calling_convention="c")
foreign libc {
- @(link_name="__libc_errno_location")
+ @(link_name="__errno_location")
+ _get_errno :: proc() -> ^int ---
+ }
+
+ EDOM :: 33
+ EILSEQ :: 84
+ ERANGE :: 34
+}
+
+when ODIN_OS == .FreeBSD {
+ @(private="file")
+ @(default_calling_convention="c")
+ foreign libc {
+ @(link_name="__error")
_get_errno :: proc() -> ^int ---
}