Skip to content

Commit 00d8e76

Browse files
jer-gentooMylesBorins
authored andcommitted
crypto: Use math.h definitions of isnan and isinf
Unless you specify C++11, std::isnan and std::isinf are not guaranteed to be available. Instead, just use the math.h functions for now. PR-URL: #19196 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Yihong Wang <yh.wang@ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent b86fbb3 commit 00d8e76

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/node_crypto.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@
3636
#include "v8.h"
3737

3838
#include <algorithm>
39+
#include <cmath>
3940
#include <errno.h>
4041
#include <limits.h> // INT_MAX
41-
#include <math.h>
4242
#include <stdlib.h>
4343
#include <string.h>
4444
#include <vector>
@@ -5610,7 +5610,7 @@ void PBKDF2(const FunctionCallbackInfo<Value>& args) {
56105610
}
56115611

56125612
raw_keylen = args[3]->NumberValue();
5613-
if (raw_keylen < 0.0 || std::isnan(raw_keylen) || std::isinf(raw_keylen) ||
5613+
if (raw_keylen < 0.0 || isnan(raw_keylen) || isinf(raw_keylen) ||
56145614
raw_keylen > INT_MAX) {
56155615
type_error = "Bad key length";
56165616
goto err;

0 commit comments

Comments
 (0)