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", feature = "pg19"))
15)]
16std::compile_error!(
17 "exactly one feature must be provided (pg13, pg14, pg15, pg16, pg17, pg18, pg19)"
18);
19
20mod cshim;
21mod cstr;
22mod include;
23mod node;
24mod port;
25
26pub mod libpq;
27pub mod submodules;
28
29// on pg19, `cshim` currently has nothing to re-export, so the glob import is "unused"
30#[allow(unused_imports)]
31#[cfg(feature = "cshim")]
32pub use cshim::*;
33
34pub use cstr::AsPgCStr;
35pub use include::*;
36pub use node::PgNode;
37pub use port::*;
38
39// For postgres 18+, some functions will reexport when enabling `cshim` feature
40#[allow(ambiguous_glob_reexports)]
41pub use submodules::*;
42
43mod seal {
44 pub trait Sealed {}
45}
46
47// Hack to fix linker errors that we get under amazonlinux2 on some PG versions
48// due to our wrappers for various system library functions. Should be fairly
49// harmless, but ideally we would not wrap these functions
50// (https://github.com/pgcentralfoundation/pgrx/issues/730).
51#[cfg(target_os = "linux")]
52#[link(name = "resolv")]
53unsafe extern "C" {}