Add missing header guards (flutter/engine#41322)

These keep turning up, so I did a little bash-fu to find them all.
```bash
grep -lL "#pragma once" $(grep -lL "#ifndef .*_H_" $(find . | grep "\.h$")) | cut -c 3-
```
This commit is contained in:
Brandon DeRosier
2023-04-19 14:20:21 -07:00
committed by GitHub
parent 90138c2003
commit b4271c24de
21 changed files with 80 additions and 6 deletions

View File

@@ -2,6 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef FLUTTER_COMMON_CONSTANTS_H_
#define FLUTTER_COMMON_CONSTANTS_H_
namespace flutter {
constexpr double kMegaByteSizeInBytes = (1 << 20);
} // namespace flutter
#endif // FLUTTER_COMMON_CONSTANTS_H_

View File

@@ -2,6 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef FLUTTER_FLOW_TEST_UTILS_H_
#define FLUTTER_FLOW_TEST_UTILS_H_
#include <string>
namespace flutter {
@@ -15,3 +18,5 @@ const std::string& GetFontFile();
void SetFontFile(const std::string& dir);
} // namespace flutter
#endif // FLUTTER_FLOW_TEST_UTILS_H_

View File

@@ -2,6 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef FLUTTER_FLOW_PAINT_REGION_H_
#define FLUTTER_FLOW_PAINT_REGION_H_
#include <vector>
#include "flutter/fml/logging.h"
#include "third_party/skia/include/core/SkRect.h"
@@ -65,3 +68,5 @@ class PaintRegion {
};
} // namespace flutter
#endif // FLUTTER_FLOW_PAINT_REGION_H_

View File

@@ -2,6 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef FLUTTER_SHELL_DIFF_CONTEXT_TEST_H_
#define FLUTTER_SHELL_DIFF_CONTEXT_TEST_H_
#include "flutter/flow/layers/container_layer.h"
#include "flutter/flow/layers/display_list_layer.h"
#include "flutter/flow/layers/opacity_layer.h"
@@ -66,3 +69,5 @@ class DiffContextTest : public LayerTest {
} // namespace testing
} // namespace flutter
#endif // FLUTTER_SHELL_DIFF_CONTEXT_TEST_H_

View File

@@ -2,6 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef FLOW_TESTING_MOCK_TEXTURE_H_
#define FLOW_TESTING_MOCK_TEXTURE_H_
#include <ostream>
#include <vector>
@@ -57,3 +60,5 @@ extern std::ostream& operator<<(std::ostream& os,
} // namespace testing
} // namespace flutter
#endif // FLOW_TESTING_MOCK_TEXTURE_H_

View File

@@ -2,6 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef FLUTTER_FML_MATH_H_
#define FLUTTER_FML_MATH_H_
namespace flutter {
namespace math {
@@ -46,3 +49,5 @@ constexpr float k1OverSqrt2 = 0.70710678118654752440;
} // namespace math
} // namespace flutter
#endif // FLUTTER_FML_MATH_H_

View File

@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#pragma once
#include <map>
#include <optional>

View File

@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#pragma once
#include <memory>
#include "impeller/entity/contents/color_source_contents.h"

View File

@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#pragma once
#include <vector>
#include "impeller/geometry/path_component.h"

View File

@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#pragma once
struct Uniforms {
mat4 model;
mat4 view;

View File

@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#pragma once
#include <array>
#include <iostream>

View File

@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#pragma once
#include <optional>
#include "flutter/fml/logging.h"

View File

@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#pragma once
#include <Metal/Metal.h>
#include <set>

View File

@@ -2,6 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef FLUTTER_LIB_SNAPSHOT_SNAPSHOT_H_
#define FLUTTER_LIB_SNAPSHOT_SNAPSHOT_H_
#include <inttypes.h>
#include <stddef.h>
#include <stdint.h>
@@ -12,3 +15,5 @@ extern const uint8_t kDartVmSnapshotInstructions[];
extern const uint8_t kDartIsolateSnapshotData[];
extern const uint8_t kDartIsolateSnapshotInstructions[];
}
#endif // FLUTTER_LIB_SNAPSHOT_SNAPSHOT_H_

View File

@@ -2,6 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef FLUTTER_LIB_UI_PAINTING_IMAGE_GENERATOR_APNG_H_
#define FLUTTER_LIB_UI_PAINTING_IMAGE_GENERATOR_APNG_H_
#include "image_generator.h"
#include "flutter/fml/endianness.h"
@@ -214,3 +217,5 @@ class APNGImageGenerator : public ImageGenerator {
};
} // namespace flutter
#endif // FLUTTER_LIB_UI_PAINTING_IMAGE_GENERATOR_APNG_H_

View File

@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef FLUTTER_SHELL_COMMON_RESOURCE_CACHE_LIMIT_CALCULATOR_
#define FLUTTER_SHELL_COMMON_RESOURCE_CACHE_LIMIT_CALCULATOR_
#ifndef FLUTTER_SHELL_COMMON_RESOURCE_CACHE_LIMIT_CALCULATOR_H_
#define FLUTTER_SHELL_COMMON_RESOURCE_CACHE_LIMIT_CALCULATOR_H_
#include <cstdint>
#include <unordered_map>
@@ -45,4 +45,4 @@ class ResourceCacheLimitCalculator {
};
} // namespace flutter
#endif // FLUTTER_SHELL_COMMON_RESOURCE_CACHE_LIMIT_CALCULATOR_
#endif // FLUTTER_SHELL_COMMON_RESOURCE_CACHE_LIMIT_CALCULATOR_H_

View File

@@ -2,6 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef FLUTTER_SHELL_PLATFORM_COMMON_TESTING_PROC_TABLE_REPLACEMENT_H_
#define FLUTTER_SHELL_PLATFORM_COMMON_TESTING_PROC_TABLE_REPLACEMENT_H_
#include "flutter/shell/platform/embedder/embedder.h"
// Wraps capturing lambas with non-capturing version that can be assigned to
@@ -22,3 +25,5 @@
static auto non_capturing = [](auto... args) { return closure(args...); }; \
return non_capturing; \
})()
#endif // FLUTTER_SHELL_PLATFORM_COMMON_TESTING_PROC_TABLE_REPLACEMENT_H_

View File

@@ -2,6 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef FLUTTER_SHELL_PLATFORM_FUCHSIA_DART_RUNNER_EMBEDDER_SNAPSHOT_H_
#define FLUTTER_SHELL_PLATFORM_FUCHSIA_DART_RUNNER_EMBEDDER_SNAPSHOT_H_
#include <cstdint>
namespace dart_runner {
@@ -10,3 +13,5 @@ extern uint8_t const* const vm_isolate_snapshot_buffer;
extern uint8_t const* const isolate_snapshot_buffer;
} // namespace dart_runner
#endif // FLUTTER_SHELL_PLATFORM_FUCHSIA_DART_RUNNER_EMBEDDER_SNAPSHOT_H_

View File

@@ -2,6 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef UI_ACCESSIBILITY_AX_CONSTANTS_H_
#define UI_ACCESSIBILITY_AX_CONSTANTS_H_
#include <cstdint>
namespace ax {
@@ -19,3 +22,5 @@ const int32_t kUnknownAriaColumnOrRowCount = -1;
} // namespace mojom
} // namespace ax
#endif // UI_ACCESSIBILITY_AX_CONSTANTS_H_

View File

@@ -5,8 +5,8 @@
// This file contains defines and typedefs that allow popular Windows types to
// be used without the overhead of including windows.h.
#ifndef BASE_WIN_WINDOWS_TYPES_H
#define BASE_WIN_WINDOWS_TYPES_H
#ifndef BASE_WIN_WINDOWS_TYPES_H_
#define BASE_WIN_WINDOWS_TYPES_H_
// Needed for function prototypes.
#include <concurrencysal.h>
@@ -273,4 +273,4 @@ WINBASEAPI VOID WINAPI SetLastError(_In_ DWORD dwErrCode);
#define StartService StartServiceW
#define UpdateResource UpdateResourceW
#endif // BASE_WIN_WINDOWS_TYPES_H
#endif // BASE_WIN_WINDOWS_TYPES_H_

View File

@@ -14,6 +14,9 @@
* limitations under the License.
*/
#ifndef LIB_TXT_TESTS_TXT_TEST_UTILS_H_
#define LIB_TXT_TESTS_TXT_TEST_UTILS_H_
#include <string>
namespace txt {
@@ -23,3 +26,5 @@ const std::string& GetFontDir();
void SetFontDir(const std::string& dir);
} // namespace txt
#endif // LIB_TXT_TESTS_TXT_TEST_UTILS_H_