Skip to content

Fix build on OpenBSD#1162

Merged
gittiver merged 4 commits into
CrowCpp:masterfrom
Wisdurm:master
Mar 17, 2026
Merged

Fix build on OpenBSD#1162
gittiver merged 4 commits into
CrowCpp:masterfrom
Wisdurm:master

Conversation

@Wisdurm
Copy link
Copy Markdown
Contributor

@Wisdurm Wisdurm commented Mar 15, 2026

OpenBSD uses a <C11 version of the C standard in some places, with the lack of DBL_DECIMAL_DIG being a problem in regards to CrowCPP.
The fix for this is is just defining it as 17, which while certainly not perfect, is as good as you can get. 17 is the value it has on x86, ARM, i386, PowerPC and RISC-V, at least. Suffice to say, it should not cause problems expect possibly with some obscure embedded architectures.
It's value is not directly tied to any other constants, so there are no fully portable fixes for this issue.
The location in code is a bit ugly and could be changed, but I am unsure as to where it should be located.

@giacomini
Copy link
Copy Markdown

I don't have access to an OpenBSD box, but what about using std::numeric_limits<T>::max_digits10 instead of DBL_DECIMAL_DIG?

@Wisdurm
Copy link
Copy Markdown
Contributor Author

Wisdurm commented Mar 16, 2026

Yeah, that would probably actually do it. I'll take a look at this today.

@Wisdurm
Copy link
Copy Markdown
Contributor Author

Wisdurm commented Mar 17, 2026

Should be good now

@gittiver gittiver merged commit 70a72f7 into CrowCpp:master Mar 17, 2026
20 checks passed
gittiver added a commit that referenced this pull request Mar 29, 2026
…gfix release

* master: (22 commits)
  fix#1165: sanitize header values to prevent injection and add helloworld_inject example (#1167)
  Handle headers for HTTPMethod::Options
  Fix build on OpenBSD (#1162)
  Enable compiler sanitizers for test builds (Fixes #1137)
  Enable compiler sanitizers for test builds (Fixes #1137)
  Enable compiler sanitizers for test builds (Fixes #1137)
  Feature#1129-CMake Error: ALIAS target "Boost::system" name collision when using vcpkg and FetchContent (#1133)
  Fix heap-buffer-overflow in query_string when parsing malformed '%'Fix heap-buffer-overflow in query_string for malformed '%' (#1134)
  Minor features to crow::json::wvalue (#1143)
  ...

# Conflicts:
#	.github/workflows/build_and_test.yml
gittiver added a commit that referenced this pull request Mar 29, 2026
…gfix release

* master: (22 commits)
  fix#1165: sanitize header values to prevent injection and add helloworld_inject example (#1167)
  Handle headers for HTTPMethod::Options
  Fix build on OpenBSD (#1162)
  Enable compiler sanitizers for test builds (Fixes #1137)
  Enable compiler sanitizers for test builds (Fixes #1137)
  Enable compiler sanitizers for test builds (Fixes #1137)
  Feature#1129-CMake Error: ALIAS target "Boost::system" name collision when using vcpkg and FetchContent (#1133)
  Fix heap-buffer-overflow in query_string when parsing malformed '%'Fix heap-buffer-overflow in query_string for malformed '%' (#1134)
  Minor features to crow::json::wvalue (#1143)
  ...

# Conflicts:
#	.github/workflows/build_and_test.yml
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.

3 participants