Skip to content

Commit a0cbd67

Browse files
danbevjasnell
authored andcommitted
deps: add defines to nghttp3/ngtcp2 gyp configs
This commit adds two defines to ngtcp2, 'HAVE_ARPA_INET_H' and 'HAVE_NETINET_IN_H', and one define to nghttp3, 'HAVE_ARPA_INET_H' when the operating system in use is linux. The motivation for this is that currently, there are compiler warnings generated for these libraries similar to the following: ../deps/ngtcp2/lib/ngtcp2_conv.c: In function ‘ngtcp2_put_uint16be’: ../deps/ngtcp2/lib/ngtcp2_conv.c:129:7: warning: implicit declaration of function ‘htons’ [-Wimplicit-function-declaration] 129 | n = htons(n); | ^~~~~ The inclusion of 'arpa/inet.h' is guarded by the 'HAVE_ARPA_INET_H' macro (see deps/ngtcp2/lib/ngtcp2_conv.h). These headers are checked by the ngtcp2 and nghttp3 builds using CMake's CheckIncludeFile, and if they are available the above macros are defined. I'm not sure if we need to have something similar to those checks or ifit is alright to add these defines for certain operating systems. Hopefully others will chime in and advice on how to handle this in the best way. PR-URL: #33942 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
1 parent c7d859e commit a0cbd67

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

deps/nghttp3/nghttp3.gyp

+5
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@
2626
},
2727
},
2828
}],
29+
['OS=="linux"', {
30+
'defines': [
31+
'HAVE_ARPA_INET_H',
32+
],
33+
}],
2934
],
3035
'direct_dependent_settings': {
3136
'defines': [ 'NGHTTP3_STATICLIB' ],

deps/ngtcp2/ngtcp2.gyp

+6
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@
3333
},
3434
},
3535
}],
36+
['OS=="linux"', {
37+
'defines': [
38+
'HAVE_ARPA_INET_H',
39+
'HAVE_NETINET_IN_H',
40+
],
41+
}],
3642
],
3743
'direct_dependent_settings': {
3844
'defines': [ 'NGTCP2_STATICLIB' ],

0 commit comments

Comments
 (0)