Skip to content

Commit

Permalink
quic: add shared openssl build guard
Browse files Browse the repository at this point in the history
  • Loading branch information
jasnell committed Mar 28, 2023
1 parent 70695c3 commit 7d8e349
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/quic/cid.cc
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if HAVE_OPENSSL && NODE_OPENSSL_HAS_QUIC
#include "cid.h"
#include <crypto/crypto_util.h>
#include <memory_tracker-inl.h>
Expand Down Expand Up @@ -148,3 +149,4 @@ const CID::Factory& CID::Factory::random() {

} // namespace quic
} // namespace node
#endif // HAVE_OPENSSL && NODE_OPENSSL_HAS_QUIC
3 changes: 2 additions & 1 deletion src/quic/cid.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once

#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS

#if HAVE_OPENSSL && NODE_OPENSSL_HAS_QUIC
#include <memory_tracker.h>
#include <ngtcp2/ngtcp2.h>
#include <string>
Expand Down Expand Up @@ -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
4 changes: 4 additions & 0 deletions src/quic/data.cc
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#if HAVE_OPENSSL && NODE_OPENSSL_HAS_QUIC

#include "data.h"
#include <env-inl.h>
#include <memory_tracker-inl.h>
Expand Down Expand Up @@ -253,3 +255,5 @@ QuicError QuicError::INTERNAL_ERROR =

} // namespace quic
} // namespace node

#endif // HAVE_OPENSSL && NODE_OPENSSL_HAS_QUIC
2 changes: 2 additions & 0 deletions src/quic/data.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#pragma once

#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
#if HAVE_OPENSSL && NODE_OPENSSL_HAS_QUIC

#include <memory_tracker.h>
#include <nghttp3/nghttp3.h>
Expand Down Expand Up @@ -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
4 changes: 4 additions & 0 deletions src/quic/preferredaddress.cc
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#if HAVE_OPENSSL && NODE_OPENSSL_HAS_QUIC

#include "preferredaddress.h"
#include <env-inl.h>
#include <ngtcp2/ngtcp2.h>
Expand Down Expand Up @@ -153,3 +155,5 @@ void PreferredAddress::Set(ngtcp2_transport_params* params,

} // namespace quic
} // namespace node

#endif // HAVE_OPENSSL && NODE_OPENSSL_HAS_QUIC
2 changes: 2 additions & 0 deletions src/quic/preferredaddress.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#pragma once

#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
#if HAVE_OPENSSL && NODE_OPENSSL_HAS_QUIC

#include <env.h>
#include <ngtcp2/ngtcp2.h>
Expand Down Expand Up @@ -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
2 changes: 2 additions & 0 deletions test/cctest/test_quic_cid.cc
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if HAVE_OPENSSL && NODE_OPENSSL_HAS_QUIC
#include <gtest/gtest.h>
#include <ngtcp2/ngtcp2.h>
#include <quic/cid.h>
Expand Down Expand Up @@ -91,3 +92,4 @@ TEST(CID, Basic) {
}
}
}
#endif // HAVE_OPENSSL && NODE_OPENSSL_HAS_QUIC

0 comments on commit 7d8e349

Please sign in to comment.