Skip to content
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: 4 additions & 0 deletions pgrx-macros/src/rewriter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ pub fn item_fn_without_rewrite(mut func: ItemFn) -> syn::Result<proc_macro2::Tok
let attrs = mem::take(&mut func.attrs);
let generics = func.sig.generics.clone();

if !sig.abi.clone().and_then(|abi| abi.name).is_some_and(|name| name.value() == "C-unwind") {
panic!("#[pg_guard] must be combined with extern \"C-unwind\"");
}

if attrs.iter().any(|attr| attr.path().is_ident("no_mangle"))
&& generics.params.iter().any(|p| match p {
GenericParam::Type(_) => true,
Expand Down
2 changes: 0 additions & 2 deletions pgrx/src/datum/datetime_support/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -401,10 +401,8 @@ const DATE_EXTRACT: unsafe fn(fcinfo: pg_sys::FunctionCallInfo) -> pg_sys::Datum

#[cfg(any(feature = "pg12", feature = "pg13"))]
mod pg12_13 {
use crate as pgrx; // for [pg_guard]
use crate::prelude::*;

#[pg_guard]
pub(super) unsafe fn date_part(fcinfo: pg_sys::FunctionCallInfo) -> pg_sys::Datum {
// we need to first convert the `date` value into a `timestamp` value
// then call the `timestamp_part` function.
Expand Down
Loading