Skip to content

Commit

Permalink
libuv: update to 1.46.0 on Neovim 0.9 and nightly
Browse files Browse the repository at this point in the history
  • Loading branch information
noib3 committed Oct 9, 2023
1 parent 392b419 commit 9bca193
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 13 deletions.
8 changes: 3 additions & 5 deletions crates/nvim-oxi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,16 @@ features = ["neovim-0-9", "libuv", "mlua", "test"]
rustdoc-args = ["--cfg", "docsrs"]

[features]
neovim-0-8 = ["oxi-api/neovim-0-8"]
neovim-0-9 = ["oxi-api/neovim-0-9"]
neovim-nightly = ["oxi-api/neovim-nightly"]
neovim-0-8 = ["oxi-api/neovim-0-8", "oxi-libuv/use-1-44"]
neovim-0-9 = ["oxi-api/neovim-0-9", "oxi-libuv/use-1-46"]
neovim-nightly = ["oxi-api/neovim-nightly", "oxi-libuv/use-1-46"]

# diagnostic = ["oxi-diagnostic"]
libuv = ["oxi-libuv"]
mlua = ["dep:mlua"]
test = ["oxi-macros/test", "miniserde"]

[dependencies]
oxi-api = { workspace = true }
# oxi-diagnostic = { workspace = true }
oxi-libuv = { version = "0.3.0", path = "../oxi-libuv", optional = true }
oxi-luajit = { workspace = true }
oxi-macros = { workspace = true }
Expand Down
7 changes: 6 additions & 1 deletion crates/oxi-libuv/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,14 @@ repository.workspace = true
documentation.workspace = true
license.workspace = true

[features]
use-1-44 = ["libuv-sys2-1-44"]
use-1-46 = ["libuv-sys2-1-46"]

[dependencies]
oxi-luajit = { workspace = true }

libuv-sys2 = "1.44"
libuv-sys2-1-44 = { package = "libuv-sys2", version = "1.44.2", optional = true }
libuv-sys2-1-46 = { package = "libuv-sys2", version = "1.46.0", optional = true }
once_cell = "1.17"
thiserror = "1.0"
3 changes: 1 addition & 2 deletions crates/oxi-libuv/src/async.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use std::error::Error as StdError;

use libuv_sys2::{self as ffi, uv_async_t};

use crate::libuv_sys2::{self as ffi, uv_async_t};
use crate::{Error, Handle};

type Callback = Box<dyn FnMut() -> Result<(), Box<dyn StdError>> + 'static>;
Expand Down
3 changes: 1 addition & 2 deletions crates/oxi-libuv/src/handle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ use std::alloc::{self, Layout};
use std::ffi::c_void;
use std::marker::PhantomData;

use libuv_sys2::{self as ffi, uv_handle_t, uv_loop_t};

use crate::libuv_sys2::{self as ffi, uv_handle_t, uv_loop_t};
use crate::{Error, Result};

/// TODO: docs
Expand Down
4 changes: 4 additions & 0 deletions crates/oxi-libuv/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ mod timer;
pub use error::Error;
use error::Result;
use handle::Handle;
#[cfg(feature = "use-1-44")]
use libuv_sys2_1_44 as libuv_sys2;
#[cfg(feature = "use-1-46")]
use libuv_sys2_1_46 as libuv_sys2;
pub use r#async::AsyncHandle;
pub use r#loop::init;
use r#loop::with_loop;
Expand Down
3 changes: 2 additions & 1 deletion crates/oxi-libuv/src/loop.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
use libuv_sys2::uv_loop_t;
use once_cell::unsync::OnceCell;
use oxi_luajit::ffi::lua_State;

use crate::libuv_sys2::uv_loop_t;

thread_local! {
static LOOP: OnceCell<*mut uv_loop_t> = OnceCell::new();
}
Expand Down
3 changes: 1 addition & 2 deletions crates/oxi-libuv/src/timer.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
use std::error::Error as StdError;
use std::time::Duration;

use libuv_sys2::{self as ffi, uv_timer_t};

use crate::libuv_sys2::{self as ffi, uv_timer_t};
use crate::{Error, Handle};

pub(crate) type Callback = Box<
Expand Down

0 comments on commit 9bca193

Please sign in to comment.