mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-15 16:57:29 +00:00
Referring to types from other namespaces in C++ now works correctly.
Previously, it would ignore the fact that the type comes from a different namespace. Now they are pre-declared in their own namespace, and referenced with a qualified name if necessary. Bug: 16851682 Change-Id: I5cb625b86d28e7436b9e93c70a0fa16a600d9884 Tested: on Linux
This commit is contained in:
@@ -1,4 +1,9 @@
|
||||
include "include_test2.fbs"; // should be skipped
|
||||
|
||||
namespace MyGame.OtherNameSpace;
|
||||
|
||||
enum FromInclude:long { IncludeVal }
|
||||
|
||||
struct Unused {}
|
||||
|
||||
|
||||
|
||||
@@ -5,9 +5,19 @@
|
||||
|
||||
#include "flatbuffers/flatbuffers.h"
|
||||
|
||||
namespace MyGame {
|
||||
namespace OtherNameSpace {
|
||||
struct Unused;
|
||||
} // namespace OtherNameSpace
|
||||
} // namespace MyGame
|
||||
|
||||
namespace MyGame {
|
||||
namespace Example {
|
||||
|
||||
struct Test;
|
||||
struct Vec3;
|
||||
struct Monster;
|
||||
|
||||
enum {
|
||||
Color_Red = 1,
|
||||
Color_Green = 2,
|
||||
@@ -35,10 +45,6 @@ inline const char *EnumNameAny(int e) { return EnumNamesAny()[e]; }
|
||||
|
||||
bool VerifyAny(const flatbuffers::Verifier &verifier, const void *union_obj, uint8_t type);
|
||||
|
||||
struct Test;
|
||||
struct Vec3;
|
||||
struct Monster;
|
||||
|
||||
MANUALLY_ALIGNED_STRUCT(2) Test {
|
||||
private:
|
||||
int16_t a_;
|
||||
|
||||
Reference in New Issue
Block a user