pgrx_pg_sys/
lib.rs

1//LICENSE Portions Copyright 2019-2021 ZomboDB, LLC.
2//LICENSE
3//LICENSE Portions Copyright 2021-2023 Technology Concepts & Design, Inc.
4//LICENSE
5//LICENSE Portions Copyright 2023-2023 PgCentral Foundation, Inc. <contact@pgcentral.org>
6//LICENSE
7//LICENSE All rights reserved.
8//LICENSE
9//LICENSE Use of this source code is governed by the MIT license that can be found in the LICENSE file.
10#![allow(clippy::missing_safety_doc)] // sorry, Jubilee
11
12#[cfg(
13    // no features at all will cause problems
14    not(any(feature = "pg13", feature = "pg14", feature = "pg15", feature = "pg16", feature = "pg17", feature = "pg18"))
15)]
16std::compile_error!("exactly one feature must be provided (pg13, pg14, pg15, pg16, pg17, pg18)");
17
18mod cshim;
19mod cstr;
20mod include;
21mod node;
22mod port;
23pub mod submodules;
24
25#[cfg(feature = "cshim")]
26pub use cshim::*;
27
28pub use cstr::AsPgCStr;
29pub use include::*;
30pub use node::PgNode;
31pub use port::*;
32
33// For postgres 18+, some functions will reexport when enabling `cshim` feature
34#[allow(ambiguous_glob_reexports)]
35pub use submodules::*;
36
37mod seal {
38    pub trait Sealed {}
39}
40
41// Hack to fix linker errors that we get under amazonlinux2 on some PG versions
42// due to our wrappers for various system library functions. Should be fairly
43// harmless, but ideally we would not wrap these functions
44// (https://github.com/pgcentralfoundation/pgrx/issues/730).
45#[cfg(target_os = "linux")]
46#[link(name = "resolv")]
47unsafe extern "C" {}