Skip to content

Commit 0d82262

Browse files
committed
Remove cfg-if since it causes issues with rust-analyzer
1 parent 1aa4b44 commit 0d82262

File tree

3 files changed

+4
-15
lines changed

3 files changed

+4
-15
lines changed

Cargo.lock

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ bench = false
1212
[dependencies]
1313
libc = "0.2"
1414
rand = "0.8.5"
15-
cfg-if = "1.0.0"
1615

1716
[build-dependencies]
1817
cc = "1.0"

src/lauxlib.rs

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,10 @@ use libc::{
1212
};
1313

1414
// Cross platform retrieval of errno
15-
cfg_if::cfg_if! {
16-
if #[cfg(any(target_os = "netbsd", target_os = "openbsd", target_os = "android"))] {
17-
use libc::__errno as errno_location;
18-
} else if #[cfg(any(target_os = "linux", target_os = "emscripten", target_os = "redox"))] {
19-
use libc::__errno_location as errno_location;
20-
} else if #[cfg(any(target_os = "solaris", target_os = "illumos"))] {
21-
use libc::___errno as errno_location;
22-
} else if #[cfg(any(target_os = "macos", target_os = "freebsd"))] {
23-
use libc::__error as errno_location;
24-
} else if #[cfg(target_os = "haiku")] {
25-
use libc::_errnop as errno_location;
26-
}
27-
}
15+
#[cfg(target_os = "linux")]
16+
use libc::__errno_location as errno_location;
17+
#[cfg(target_os = "macos")]
18+
use libc::__error as errno_location;
2819

2920
use crate::lapi::{
3021
lua_absindex, lua_atpanic, lua_call, lua_checkstack, lua_concat, lua_copy, lua_createtable,

0 commit comments

Comments
 (0)