Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

don't emit flatbuffers include in bfbs generated output #7968

Merged
merged 1 commit into from
May 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions src/idl_gen_cpp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -377,10 +377,8 @@ class CppGenerator : public BaseGenerator {
code_ += "#pragma clang system_header\n\n";
}

code_ += "#include \"flatbuffers/flatbuffers.h\"";
code_ += "";
GenFlatbuffersVersionCheck();
code_ += "";
code_ += "#include <cstddef>";
code_ += "#include <cstdint>";

SetNameSpace(struct_def.defined_namespace);
auto name = Name(struct_def);
Expand Down
11 changes: 2 additions & 9 deletions tests/64bit/test_64bit_bfbs_generated.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,8 @@
#ifndef FLATBUFFERS_GENERATED_TEST64BIT_BFBS_H_
#define FLATBUFFERS_GENERATED_TEST64BIT_BFBS_H_

#include "flatbuffers/flatbuffers.h"

// Ensure the included flatbuffers.h is the same version as when this file was
// generated, otherwise it may not be compatible.
static_assert(FLATBUFFERS_VERSION_MAJOR == 23 &&
FLATBUFFERS_VERSION_MINOR == 5 &&
FLATBUFFERS_VERSION_REVISION == 9,
"Non-compatible flatbuffers version included");

#include <cstddef>
#include <cstdint>
struct RootTableBinarySchema {
static const uint8_t *data() {
// Buffer containing the binary schema.
Expand Down
11 changes: 2 additions & 9 deletions tests/monster_test_bfbs_generated.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,8 @@
#ifndef FLATBUFFERS_GENERATED_MONSTERTEST_MYGAME_EXAMPLE_BFBS_H_
#define FLATBUFFERS_GENERATED_MONSTERTEST_MYGAME_EXAMPLE_BFBS_H_

#include "flatbuffers/flatbuffers.h"

// Ensure the included flatbuffers.h is the same version as when this file was
// generated, otherwise it may not be compatible.
static_assert(FLATBUFFERS_VERSION_MAJOR == 23 &&
FLATBUFFERS_VERSION_MINOR == 5 &&
FLATBUFFERS_VERSION_REVISION == 9,
"Non-compatible flatbuffers version included");

#include <cstddef>
#include <cstdint>
namespace MyGame {
namespace Example {

Expand Down