Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deps: add defines to nghttp3/ngtcp2 gyp configs #33942

Closed

Conversation

danbev
Copy link
Contributor

@danbev danbev commented Jun 18, 2020

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
if it 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.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines

@danbev danbev added experimental Issues and PRs related to experimental features. quic Issues and PRs related to the QUIC implementation / HTTP/3. labels Jun 18, 2020
@danbev danbev requested a review from jasnell June 18, 2020 13:12
@richardlau
Copy link
Member

deps/ngtcp2/.ngtcp2.gyp.swp shouldn't have been checked in 😀.

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.
@danbev danbev force-pushed the deps-ngtcp2-nghttp3-compiler-warnings branch from bf96b65 to db858fc Compare June 18, 2020 13:20
@danbev
Copy link
Contributor Author

danbev commented Jun 18, 2020

@richardlau Thanks!

@jasnell
Copy link
Member

jasnell commented Jun 19, 2020

@danbev ... just checking, can this be moved out of draft yet?

@danbev
Copy link
Contributor Author

danbev commented Jun 19, 2020 via email

@jasnell jasnell marked this pull request as ready for review June 19, 2020 18:04
@nodejs-github-bot
Copy link
Collaborator

jasnell pushed a commit that referenced this pull request Jun 22, 2020
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>
jasnell pushed a commit that referenced this pull request Jun 22, 2020
PR-URL: #33942
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
@jasnell
Copy link
Member

jasnell commented Jun 22, 2020

Landed in a0cbd67 and a041723

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
experimental Issues and PRs related to experimental features. quic Issues and PRs related to the QUIC implementation / HTTP/3.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants