Skip to content

Commit

Permalink
pg_config.h: NetBSD support (#172)
Browse files Browse the repository at this point in the history
NetBSD has strchrnul too but with a slightly different prototype. Without this
change, there is a compiler error for a conflicting declaration.
  • Loading branch information
bsiegert authored Feb 6, 2023
1 parent aac6ca3 commit 4c4f68d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,8 @@ $(PGDIR):
# Avoid CRC extension usage to ensure we are not architecture-dependent
echo "#undef USE_ARMV8_CRC32C" >> $(PGDIR)/src/include/pg_config.h
echo "#undef USE_SSE42_CRC32C_WITH_RUNTIME_CHECK" >> $(PGDIR)/src/include/pg_config.h
# Ensure we don't fail on systems that have strchrnul support (FreeBSD)
echo "#ifdef __FreeBSD__" >> $(PGDIR)/src/include/pg_config.h
# Ensure we don't fail on systems that have strchrnul support (FreeBSD and NetBSD)
echo "#if defined(__FreeBSD__) || defined(__NetBSD__)" >> $(PGDIR)/src/include/pg_config.h
echo "#define HAVE_STRCHRNUL" >> $(PGDIR)/src/include/pg_config.h
echo "#endif" >> $(PGDIR)/src/include/pg_config.h

Expand Down
2 changes: 1 addition & 1 deletion src/postgres/include/pg_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -1032,6 +1032,6 @@
#undef HAVE__GET_CPUID
#undef USE_ARMV8_CRC32C
#undef USE_SSE42_CRC32C_WITH_RUNTIME_CHECK
#ifdef __FreeBSD__
#if defined(__FreeBSD__) || defined(__NetBSD__)
#define HAVE_STRCHRNUL
#endif

0 comments on commit 4c4f68d

Please sign in to comment.