From 7d8e349534ca95fbb7645f44a995840f413ed4ff Mon Sep 17 00:00:00 2001 From: James M Snell Date: Mon, 27 Mar 2023 15:13:22 -0700 Subject: [PATCH] quic: add shared openssl build guard --- src/quic/cid.cc | 2 ++ src/quic/cid.h | 3 ++- src/quic/data.cc | 4 ++++ src/quic/data.h | 2 ++ src/quic/preferredaddress.cc | 4 ++++ src/quic/preferredaddress.h | 2 ++ test/cctest/test_quic_cid.cc | 2 ++ 7 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/quic/cid.cc b/src/quic/cid.cc index 06c12ca4c182d9..103fed860d40e1 100644 --- a/src/quic/cid.cc +++ b/src/quic/cid.cc @@ -1,3 +1,4 @@ +#if HAVE_OPENSSL && NODE_OPENSSL_HAS_QUIC #include "cid.h" #include #include @@ -148,3 +149,4 @@ const CID::Factory& CID::Factory::random() { } // namespace quic } // namespace node +#endif // HAVE_OPENSSL && NODE_OPENSSL_HAS_QUIC diff --git a/src/quic/cid.h b/src/quic/cid.h index c67d5405507d91..bfd6eb47c9ff9b 100644 --- a/src/quic/cid.h +++ b/src/quic/cid.h @@ -1,7 +1,7 @@ #pragma once #if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS - +#if HAVE_OPENSSL && NODE_OPENSSL_HAS_QUIC #include #include #include @@ -122,4 +122,5 @@ class CID::Factory { } // namespace quic } // namespace node +#endif // HAVE_OPENSSL && NODE_OPENSSL_HAS_QUIC #endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS diff --git a/src/quic/data.cc b/src/quic/data.cc index 809f84b51e92b5..fcc2335db7adb9 100644 --- a/src/quic/data.cc +++ b/src/quic/data.cc @@ -1,3 +1,5 @@ +#if HAVE_OPENSSL && NODE_OPENSSL_HAS_QUIC + #include "data.h" #include #include @@ -253,3 +255,5 @@ QuicError QuicError::INTERNAL_ERROR = } // namespace quic } // namespace node + +#endif // HAVE_OPENSSL && NODE_OPENSSL_HAS_QUIC diff --git a/src/quic/data.h b/src/quic/data.h index c4106316c7b689..14a613df69196b 100644 --- a/src/quic/data.h +++ b/src/quic/data.h @@ -1,6 +1,7 @@ #pragma once #if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS +#if HAVE_OPENSSL && NODE_OPENSSL_HAS_QUIC #include #include @@ -132,4 +133,5 @@ class QuicError final : public MemoryRetainer { } // namespace quic } // namespace node +#endif // HAVE_OPENSSL && NODE_OPENSSL_HAS_QUIC #endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS diff --git a/src/quic/preferredaddress.cc b/src/quic/preferredaddress.cc index 76dd7d1436c0e9..180241cf272aa8 100644 --- a/src/quic/preferredaddress.cc +++ b/src/quic/preferredaddress.cc @@ -1,3 +1,5 @@ +#if HAVE_OPENSSL && NODE_OPENSSL_HAS_QUIC + #include "preferredaddress.h" #include #include @@ -153,3 +155,5 @@ void PreferredAddress::Set(ngtcp2_transport_params* params, } // namespace quic } // namespace node + +#endif // HAVE_OPENSSL && NODE_OPENSSL_HAS_QUIC diff --git a/src/quic/preferredaddress.h b/src/quic/preferredaddress.h index 5914ac600ca1a4..6be468fac2cd08 100644 --- a/src/quic/preferredaddress.h +++ b/src/quic/preferredaddress.h @@ -1,6 +1,7 @@ #pragma once #if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS +#if HAVE_OPENSSL && NODE_OPENSSL_HAS_QUIC #include #include @@ -67,4 +68,5 @@ class PreferredAddress final { } // namespace quic } // namespace node +#endif // HAVE_OPENSSL && NODE_OPENSSL_HAS_QUIC #endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS diff --git a/test/cctest/test_quic_cid.cc b/test/cctest/test_quic_cid.cc index ae5779ccafc77b..44e4e5d7b998e7 100644 --- a/test/cctest/test_quic_cid.cc +++ b/test/cctest/test_quic_cid.cc @@ -1,3 +1,4 @@ +#if HAVE_OPENSSL && NODE_OPENSSL_HAS_QUIC #include #include #include @@ -91,3 +92,4 @@ TEST(CID, Basic) { } } } +#endif // HAVE_OPENSSL && NODE_OPENSSL_HAS_QUIC