Skip to content

Define HAVE_LIMITS_H in options.h rather than config.h.#10097

Open
kareem-wolfssl wants to merge 1 commit intowolfSSL:masterfrom
kareem-wolfssl:gh9936
Open

Define HAVE_LIMITS_H in options.h rather than config.h.#10097
kareem-wolfssl wants to merge 1 commit intowolfSSL:masterfrom
kareem-wolfssl:gh9936

Conversation

@kareem-wolfssl
Copy link
Copy Markdown
Contributor

Description

Required since types.h depends on this definition and config.h isn't consistently available at runtime.
Fixes #9936.

Testing

Tested build and confirmed HAVE_LIMITS_H definition moved as expected.

Checklist

  • added tests
  • updated/added doxygen
  • updated appropriate READMEs
  • Updated manual and documentation

…depends on this definition and config.h isn't consistently available at runtime.

Fixes wolfSSL#9936.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR moves HAVE_LIMITS_H definition out of generated config.h and into wolfssl/options.h, because types.h depends on HAVE_LIMITS_H while config.h is not reliably available/used by downstream consumers (e.g., Android/arm32 builds).

Changes:

  • Autotools: stop generating HAVE_LIMITS_H via AC_CHECK_HEADERS(...) and instead emit it into options.h by appending -DHAVE_LIMITS_H=1 to AM_CPPFLAGS when <limits.h> is present.
  • CMake: define HAVE_LIMITS_H in cmake/options.h.in and remove it from cmake/config.in.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
configure.ac Moves <limits.h> detection to an AM_CPPFLAGS define so it is captured in the generated wolfssl/options.h for consumers.
cmake/options.h.in Adds HAVE_LIMITS_H to the generated wolfssl/options.h for CMake builds.
cmake/config.in Removes HAVE_LIMITS_H from CMake-generated config.h to avoid relying on it at consumer compile time.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 35 to +38
#ifndef WOLFSSL_OPTIONS_IGNORE_SYS
/* Since types.h depends on HAVE_LIMITS_H, we must define it in options.h. */
#undef HAVE_LIMITS_H
#cmakedefine HAVE_LIMITS_H @HAVE_LIMITS_H@
Copy link

Copilot AI Mar 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the autotools-generated options.h, WOLFSSL_OPTIONS_IGNORE_SYS only gates macros that start with '_' (see configure.ac generation logic). Putting HAVE_LIMITS_H under this guard in the CMake options.h template means builds that define WOLFSSL_OPTIONS_IGNORE_SYS will not get HAVE_LIMITS_H, which can reintroduce the types.h sizing failure this PR is trying to fix. Consider moving HAVE_LIMITS_H outside the WOLFSSL_OPTIONS_IGNORE_SYS block (or otherwise aligning the gating behavior with configure’s options.h generation).

Suggested change
#ifndef WOLFSSL_OPTIONS_IGNORE_SYS
/* Since types.h depends on HAVE_LIMITS_H, we must define it in options.h. */
#undef HAVE_LIMITS_H
#cmakedefine HAVE_LIMITS_H @HAVE_LIMITS_H@
/* Since types.h depends on HAVE_LIMITS_H, we must define it in options.h. */
#undef HAVE_LIMITS_H
#cmakedefine HAVE_LIMITS_H @HAVE_LIMITS_H@
#ifndef WOLFSSL_OPTIONS_IGNORE_SYS

Copilot uses AI. Check for mistakes.
@kareem-wolfssl kareem-wolfssl added the Not For This Release Not for release 5.9.1 label Mar 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Not For This Release Not for release 5.9.1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: "bad math long / long long settings" when consuming wolfssl on arm32 android

2 participants