Skip to content

fix: include climits to fix build - #50

Closed
ndossche wants to merge 1 commit into
nodejs:mainfrom
ndossche:fix-build-1
Closed

fix: include climits to fix build#50
ndossche wants to merge 1 commit into
nodejs:mainfrom
ndossche:fix-build-1

Conversation

@ndossche

@ndossche ndossche commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Fixes the following build failure:

/home/nora/ncrypto/src/ncrypto.cpp: In function ‘bool ncrypto::CSPRNG(void*, size_t)’:
/home/nora/ncrypto/src/ncrypto.cpp:602:23: error: ‘INT_MAX’ was not declared in this scope
  602 |       while (length > INT_MAX && 1 == RAND_bytes(buf, INT_MAX)) {
      |                       ^~~~~~~

On g++ (GCC) 16.1.1 20260728 on Linux

@ndossche ndossche changed the title fix: include cstdint to fix build fix: include climits to fix build Aug 9, 2026
Fixes the following build failure:
```
/home/nora/ncrypto/src/ncrypto.cpp: In function ‘bool ncrypto::CSPRNG(void*, size_t)’:
/home/nora/ncrypto/src/ncrypto.cpp:602:23: error: ‘INT_MAX’ was not declared in this scope
  602 |       while (length > INT_MAX && 1 == RAND_bytes(buf, INT_MAX)) {
      |                       ^~~~~~~
```
@panva

panva commented Aug 10, 2026

Copy link
Copy Markdown
Member

I think these changes out to land on the Node.js side of things first.

@ndossche

Copy link
Copy Markdown
Contributor Author

Okay I will, but it's confusing as I'm pretty sure in the past I've been told to send them here first

@panva

panva commented Aug 10, 2026

Copy link
Copy Markdown
Member

Right, we are now simply syncing the ncrypto state from nodejs/node in here. So if the change is only relevant to downstream consumers of this repo it's fine for it to be here directly, otherwise it should go to nodejs/node.

The source for nodejs/node remains there.

@ndossche

Copy link
Copy Markdown
Contributor Author

Seems like this particular fix is already included in #51

@ndossche ndossche closed this Aug 10, 2026
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.

2 participants