Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
flatbuffers
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
flatbuffers
Commits
bdd668df
Commit
bdd668df
authored
Jul 21, 2016
by
Wouter van Oortmerssen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed VS2010 build
parent
05b00c50
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
5 deletions
+9
-5
flatc.vcxproj.user
build_ide/VS2010/flatc.vcxproj.user
+1
-1
idl_gen_cpp.cpp
src/idl_gen_cpp.cpp
+7
-3
monster_test_generated.h
tests/monster_test_generated.h
+1
-1
No files found.
build_ide/VS2010/flatc.vcxproj.user
View file @
bdd668df
...
...
@@ -3,7 +3,7 @@
<PropertyGroup
Condition=
"'$(Configuration)|$(Platform)'=='Debug|Win32'"
>
<LocalDebuggerWorkingDirectory>
..\..\tests
</LocalDebuggerWorkingDirectory>
<DebuggerFlavor>
WindowsLocalDebugger
</DebuggerFlavor>
<LocalDebuggerCommandArguments>
-j -c -n -g --php --no-includes --gen-mutable monster_test.fbs
</LocalDebuggerCommandArguments>
<LocalDebuggerCommandArguments>
-j -c -n -g --php --no-includes --gen-mutable
--gen-object-api
monster_test.fbs
</LocalDebuggerCommandArguments>
</PropertyGroup>
<PropertyGroup
Condition=
"'$(Configuration)|$(Platform)'=='Release|Win32'"
>
<LocalDebuggerWorkingDirectory>
..\..
</LocalDebuggerWorkingDirectory>
...
...
src/idl_gen_cpp.cpp
View file @
bdd668df
...
...
@@ -966,7 +966,7 @@ class CppGenerator : public BaseGenerator {
auto
dest
=
deref
+
field
.
name
;
auto
assign
=
prefix
+
dest
+
" = "
;
auto
gen_unpack_val
=
[
&
](
const
Type
&
type
,
const
std
::
string
&
val
,
bool
invector
)
{
bool
invector
)
->
std
::
string
{
switch
(
type
.
base_type
)
{
case
BASE_TYPE_STRING
:
return
val
+
"->str()"
;
...
...
@@ -987,14 +987,18 @@ class CppGenerator : public BaseGenerator {
}
};
switch
(
field
.
value
.
type
.
base_type
)
{
case
BASE_TYPE_VECTOR
:
case
BASE_TYPE_VECTOR
:
{
code
+=
prefix
;
code
+=
"{ for (size_t _i = 0; _i < _e->size(); _i++) { "
;
code
+=
dest
+
".push_back("
;
std
::
string
indexing
=
"_e->Get(_i)"
;
if
(
field
.
value
.
type
.
element
==
BASE_TYPE_BOOL
)
indexing
+=
"!=0"
;
code
+=
gen_unpack_val
(
field
.
value
.
type
.
VectorType
(),
"_e->Get(_i)"
,
true
);
indexing
,
true
);
code
+=
"); } }"
;
break
;
}
case
BASE_TYPE_UTYPE
:
{
auto
&
union_field
=
**
(
it
+
1
);
assert
(
union_field
.
value
.
type
.
base_type
==
BASE_TYPE_UNION
);
...
...
tests/monster_test_generated.h
View file @
bdd668df
...
...
@@ -645,7 +645,7 @@ inline std::unique_ptr<MonsterT> Monster::UnPack() const {
{
auto
_e
=
testhashu32_fnv1a
();
_o
->
testhashu32_fnv1a
=
_e
;
};
{
auto
_e
=
testhashs64_fnv1a
();
_o
->
testhashs64_fnv1a
=
_e
;
};
{
auto
_e
=
testhashu64_fnv1a
();
_o
->
testhashu64_fnv1a
=
_e
;
};
{
auto
_e
=
testarrayofbools
();
if
(
_e
)
{
for
(
size_t
_i
=
0
;
_i
<
_e
->
size
();
_i
++
)
{
_o
->
testarrayofbools
.
push_back
(
_e
->
Get
(
_i
));
}
}
};
{
auto
_e
=
testarrayofbools
();
if
(
_e
)
{
for
(
size_t
_i
=
0
;
_i
<
_e
->
size
();
_i
++
)
{
_o
->
testarrayofbools
.
push_back
(
_e
->
Get
(
_i
)
!=
0
);
}
}
};
{
auto
_e
=
testf
();
_o
->
testf
=
_e
;
};
{
auto
_e
=
testf2
();
_o
->
testf2
=
_e
;
};
{
auto
_e
=
testf3
();
_o
->
testf3
=
_e
;
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment