From 3c5d39ddbd028d570a5bf3f6f3b0074cc64fb528 Mon Sep 17 00:00:00 2001 From: ElonGates <59313695+VilotStar@users.noreply.github.com> Date: Wed, 16 Aug 2023 23:41:06 +0100 Subject: [PATCH 1/4] fix: remove feature requirement for thiscall abi_thiscall is now considered stable by rust https://github.com/rust-lang/rust/commit/06daa9e263db87b3c5d4d80110938130db846183 --- src/macros.rs | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/macros.rs b/src/macros.rs index 4a1d6cdd..09353a43 100644 --- a/src/macros.rs +++ b/src/macros.rs @@ -184,9 +184,6 @@ macro_rules! impl_hookable { impl_hookable!(@impl_pair ($($nm : $ty),*) (extern "win64" fn($($ty),*) -> Ret)); impl_hookable!(@impl_pair ($($nm : $ty),*) (extern "C" fn($($ty),*) -> Ret)); impl_hookable!(@impl_pair ($($nm : $ty),*) (extern "system" fn($($ty),*) -> Ret)); - - #[cfg(feature = "thiscall-abi")] - #[cfg_attr(docsrs, doc(cfg(feature = "thiscall-abi")))] impl_hookable!(@impl_pair ($($nm : $ty),*) (extern "thiscall" fn($($ty),*) -> Ret)); }; From 979a75bc3d41adc5ba954952f5273d2bb4cd8e94 Mon Sep 17 00:00:00 2001 From: ElonGates <59313695+VilotStar@users.noreply.github.com> Date: Fri, 18 Aug 2023 13:28:57 +0100 Subject: [PATCH 2/4] fix: remove feature attribute definition --- src/lib.rs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 73c61ca4..3a6f80d6 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -8,10 +8,6 @@ all(feature = "static-detour", test), feature(naked_functions) )] -#![cfg_attr( - feature = "thiscall-abi", - feature(abi_thiscall) -)] //! A cross-platform detour library written in Rust. //! From fbcf30a491c7a0ede08fe13fdf93f032666a7d36 Mon Sep 17 00:00:00 2001 From: Mason Ginter Date: Sun, 15 Oct 2023 10:54:19 -0400 Subject: [PATCH 3/4] Keep thiscall-abi feature gate for back compat --- src/macros.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/macros.rs b/src/macros.rs index 09353a43..4a1d6cdd 100644 --- a/src/macros.rs +++ b/src/macros.rs @@ -184,6 +184,9 @@ macro_rules! impl_hookable { impl_hookable!(@impl_pair ($($nm : $ty),*) (extern "win64" fn($($ty),*) -> Ret)); impl_hookable!(@impl_pair ($($nm : $ty),*) (extern "C" fn($($ty),*) -> Ret)); impl_hookable!(@impl_pair ($($nm : $ty),*) (extern "system" fn($($ty),*) -> Ret)); + + #[cfg(feature = "thiscall-abi")] + #[cfg_attr(docsrs, doc(cfg(feature = "thiscall-abi")))] impl_hookable!(@impl_pair ($($nm : $ty),*) (extern "thiscall" fn($($ty),*) -> Ret)); }; From 183b6d52afba390d6156f906ef47c0a70e7e6bf3 Mon Sep 17 00:00:00 2001 From: Mason Ginter Date: Sun, 15 Oct 2023 10:58:04 -0400 Subject: [PATCH 4/4] Update docs for required thiscall-abi version --- README.md | 3 +-- src/lib.rs | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index c1ee764f..6afdf2c0 100644 --- a/README.md +++ b/README.md @@ -71,8 +71,7 @@ nightly compiler will always target the newest version. Feature versions: - `static-detour`: nightly -- `thiscall-abi`: nightly (will be [stabilized in 1.73.0](https://releases.rs/docs/1.73.0/)) - +- `thiscall-abi`: 1.73.0 or newer ## Example diff --git a/src/lib.rs b/src/lib.rs index c5096a1c..00fdc7f5 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -55,8 +55,7 @@ //! - **static-detour**: Required for static detours, due to usage //! of *unboxed_closures* and *tuple_trait*. The feature also enables a more //! extensive test suite. *Requires nightly compiler* -//! - **thiscall-abi**: Required for hooking functions that use the "thiscall" ABI, which is -//! nightly only. *Requires nightly compiler* +//! - **thiscall-abi**: Required for hooking functions that use the "thiscall" ABI. *Requires 1.73.0 or greater* //! //! ## Platforms //!