Skip to content

Commit e143f17

Browse files
committed
[build] Add support for Bazel header parsing
Header parsing will be part of the downstream lint checks, I hope to add it to the workerd lint job in a follow-up PR too.
1 parent 010d64a commit e143f17

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

src/workerd/api/node/buffer-string-search.h

+6-3
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,11 @@
2828
// found in the LICENSE file.
2929
#pragma once
3030

31-
#include <algorithm>
32-
#include <cstring>
31+
#include <kj/common.h>
32+
33+
#include <cstdint>
34+
35+
using kj::uint;
3336

3437
namespace workerd::api::node {
3538
namespace stringsearch {
@@ -201,7 +204,7 @@ inline T AlignDown(T value, U alignment) {
201204
}
202205

203206
inline uint8_t GetHighestValueByte(uint16_t character) {
204-
return std::max(static_cast<uint8_t>(character & 0xFF), static_cast<uint8_t>(character >> 8));
207+
return kj::max(static_cast<uint8_t>(character & 0xFF), static_cast<uint8_t>(character >> 8));
205208
}
206209

207210
inline uint8_t GetHighestValueByte(uint8_t character) {

src/workerd/jsg/BUILD.bazel

+2
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ wd_cc_library(
5454
"web-idl.h",
5555
"wrappable.h",
5656
],
57+
# Some JSG headers can't be compiled on their own
58+
features = ["-parse_headers"],
5759
visibility = ["//visibility:public"],
5860
deps = [
5961
":exception",

src/workerd/util/BUILD.bazel

+5
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ wd_cc_library(
6363
":duration-exceeded-logger",
6464
"@capnp-cpp//src/kj",
6565
"@capnp-cpp//src/kj:kj-async",
66+
# TODO(cleanup): Only for abortable.h, factor out
67+
"@capnp-cpp//src/kj/compat:kj-http",
6668
],
6769
)
6870

@@ -165,6 +167,9 @@ wd_cc_library(
165167
name = "sentry",
166168
hdrs = ["sentry.h"],
167169
visibility = ["//visibility:public"],
170+
deps = [
171+
"@capnp-cpp//src/kj",
172+
],
168173
)
169174

170175
wd_cc_library(

0 commit comments

Comments
 (0)