Skip to content

Add MsAbi and SysvAbi function attributes #45

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "gccjit"
version = "2.4.0"
version = "2.5.0"
authors = ["Sean Gillespie <[email protected]>", "Antoni Boucher <[email protected]>"]
description = "Higher-level Rust bindings for libgccjit."
keywords = ["compiler", "jit", "gcc"]
Expand All @@ -13,4 +13,4 @@ readme = "README.md"
master = ["gccjit_sys/master"]

[dependencies]
gccjit_sys = { version = "0.5.0", path = "gccjit_sys" }
gccjit_sys = { version = "0.6.0", path = "gccjit_sys" }
2 changes: 1 addition & 1 deletion gccjit_sys/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "gccjit_sys"
version = "0.5.0"
version = "0.6.0"
authors = ["Sean Gillespie <[email protected]>", "Antoni Boucher <[email protected]>"]
#links = "gccjit"
description = "Raw bindings to libgccjit. Companion to the gccjit crate."
Expand Down
2 changes: 2 additions & 0 deletions gccjit_sys/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,8 @@ pub enum gcc_jit_fn_attribute
GCC_JIT_FN_ATTRIBUTE_CONST,
GCC_JIT_FN_ATTRIBUTE_WEAK,
GCC_JIT_FN_ATTRIBUTE_NONNULL,
GCC_JIT_FN_ATTRIBUTE_MS_ABI,
GCC_JIT_FN_ATTRIBUTE_SYSV_ABI,
}

#[cfg(feature="master")]
Expand Down
8 changes: 7 additions & 1 deletion src/function.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ pub enum FnAttribute<'a> {
Const,
Weak,
NonNull(Vec<std::ffi::c_int>),
MsAbi,
SysvAbi,
}

#[cfg(feature="master")]
Expand All @@ -76,7 +78,9 @@ impl<'a> FnAttribute<'a> {
| FnAttribute::ReturnsTwice
| FnAttribute::Pure
| FnAttribute::Const
| FnAttribute::Weak => AttributeValue::None,
| FnAttribute::Weak
| FnAttribute::MsAbi
| FnAttribute::SysvAbi => AttributeValue::None,
FnAttribute::NonNull(ref value) => {
debug_assert!(
value.iter().all(|attr| *attr > 0),
Expand All @@ -102,6 +106,8 @@ impl<'a> FnAttribute<'a> {
FnAttribute::Const => gccjit_sys::gcc_jit_fn_attribute::GCC_JIT_FN_ATTRIBUTE_CONST,
FnAttribute::Weak => gccjit_sys::gcc_jit_fn_attribute::GCC_JIT_FN_ATTRIBUTE_WEAK,
FnAttribute::NonNull(_) => gccjit_sys::gcc_jit_fn_attribute::GCC_JIT_FN_ATTRIBUTE_NONNULL,
FnAttribute::MsAbi => gccjit_sys::gcc_jit_fn_attribute::GCC_JIT_FN_ATTRIBUTE_MS_ABI,
FnAttribute::SysvAbi => gccjit_sys::gcc_jit_fn_attribute::GCC_JIT_FN_ATTRIBUTE_SYSV_ABI,
}
}
}
Expand Down
Loading