Skip to content

Fix: Make include of libpq-fe.h work on Enterprise Linux too#2888

Open
qha wants to merge 1 commit into
greenbone:mainfrom
qha:tweak-libpq-fe-include
Open

Fix: Make include of libpq-fe.h work on Enterprise Linux too#2888
qha wants to merge 1 commit into
greenbone:mainfrom
qha:tweak-libpq-fe-include

Conversation

@qha
Copy link
Copy Markdown
Contributor

@qha qha commented Apr 22, 2026

What

Make include of libpq-fe.h work on Enterprise Linux too
using __has_include.

Why

On Enterprise Linux libpq-fe.h is not installed under postgresql so the include fails. Check for the expected location and fall back to looking directly on the include path.

References

Gcc supports __has_include since at least version 9.5: https://gcc.gnu.org/onlinedocs/gcc-9.5.0/cpp/_005f_005fhas_005finclude.html

Clang supports __has_include since at least 5.0.0: https://releases.llvm.org/5.0.0/tools/clang/docs/LanguageExtensions.html#include-file-checking-macros

I considered adding a version requirement on Gcc in the install instructions but as i don't know what version is required for other features used i decided against it. Please let me know if i should reconsider.

@qha qha requested review from a team as code owners April 22, 2026 16:14
@greenbonebot greenbonebot enabled auto-merge (rebase) April 22, 2026 16:14
auto-merge was automatically disabled April 23, 2026 06:37

Head branch was pushed to by a user without write access

@qha qha force-pushed the tweak-libpq-fe-include branch from f7af846 to 3065aeb Compare April 23, 2026 06:37
@greenbonebot greenbonebot enabled auto-merge (rebase) April 23, 2026 06:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant