Skip to content

Commit

Permalink
Fixes kernel macro not working
Browse files Browse the repository at this point in the history
  • Loading branch information
ultimaweapon committed May 26, 2024
1 parent fbed1a8 commit dc23948
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 28 deletions.
16 changes: 0 additions & 16 deletions macros/src/kernel.rs

This file was deleted.

12 changes: 0 additions & 12 deletions macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use proc_macro::TokenStream;
use syn::{parse_macro_input, Error, ItemStruct, LitInt, TraitItem};

mod derive;
mod kernel;
mod offset;

#[proc_macro_derive(MappedKernel)]
Expand All @@ -14,17 +13,6 @@ pub fn derive_mapped_kernel(item: TokenStream) -> TokenStream {
.into()
}

/// Renders kernel type based on `fw` configuration.
///
/// This macro was designed to be used by the application. Use trait bound with `okf::Kernel`
/// instead if you are building a library.
#[proc_macro]
pub fn kernel(_: TokenStream) -> TokenStream {
self::kernel::render()
.unwrap_or_else(Error::into_compile_error)
.into()
}

#[proc_macro_attribute]
pub fn offset(args: TokenStream, item: TokenStream) -> TokenStream {
let args = parse_macro_input!(args as LitInt);
Expand Down
8 changes: 8 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ pub mod thread;
pub mod ucred;
pub mod uio;

#[cfg(fw = "1100")]
#[macro_export]
macro_rules! kernel {
() => {
okf_1100::Kernel
};
}

/// Provides methods to access the PS4 kernel for a specific version.
///
/// Most methods here are a direct call to the kernel so most of them are unsafe and hard to use.
Expand Down

0 comments on commit dc23948

Please sign in to comment.