Skip to content

Commit

Permalink
[build] Add support for Bazel header parsing
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
fhanau committed Dec 29, 2024
1 parent 010d64a commit e143f17
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/workerd/api/node/buffer-string-search.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,11 @@
// found in the LICENSE file.
#pragma once

#include <algorithm>
#include <cstring>
#include <kj/common.h>

#include <cstdint>

using kj::uint;

namespace workerd::api::node {
namespace stringsearch {
Expand Down Expand Up @@ -201,7 +204,7 @@ inline T AlignDown(T value, U alignment) {
}

inline uint8_t GetHighestValueByte(uint16_t character) {
return std::max(static_cast<uint8_t>(character & 0xFF), static_cast<uint8_t>(character >> 8));
return kj::max(static_cast<uint8_t>(character & 0xFF), static_cast<uint8_t>(character >> 8));
}

inline uint8_t GetHighestValueByte(uint8_t character) {
Expand Down
2 changes: 2 additions & 0 deletions src/workerd/jsg/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ wd_cc_library(
"web-idl.h",
"wrappable.h",
],
# Some JSG headers can't be compiled on their own
features = ["-parse_headers"],
visibility = ["//visibility:public"],
deps = [
":exception",
Expand Down
5 changes: 5 additions & 0 deletions src/workerd/util/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ wd_cc_library(
":duration-exceeded-logger",
"@capnp-cpp//src/kj",
"@capnp-cpp//src/kj:kj-async",
# TODO(cleanup): Only for abortable.h, factor out
"@capnp-cpp//src/kj/compat:kj-http",
],
)

Expand Down Expand Up @@ -165,6 +167,9 @@ wd_cc_library(
name = "sentry",
hdrs = ["sentry.h"],
visibility = ["//visibility:public"],
deps = [
"@capnp-cpp//src/kj",
],
)

wd_cc_library(
Expand Down

0 comments on commit e143f17

Please sign in to comment.