Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
protobuf
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
protobuf
Commits
ca1c2529
Commit
ca1c2529
authored
May 27, 2015
by
unknown
Committed by
Bo Yang
May 28, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes on visual studio 2008
parent
b11d6fe5
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
25 additions
and
12 deletions
+25
-12
arena_unittest.cc
src/google/protobuf/arena_unittest.cc
+0
-2
objectivec_field.cc
src/google/protobuf/compiler/objectivec/objectivec_field.cc
+3
-3
lite_unittest.cc
src/google/protobuf/lite_unittest.cc
+1
-1
map.h
src/google/protobuf/map.h
+6
-0
map_field_test.cc
src/google/protobuf/map_field_test.cc
+1
-1
map_test.cc
src/google/protobuf/map_test.cc
+1
-1
hash.h
src/google/protobuf/stubs/hash.h
+2
-3
pbconfig.h
vsprojects/google/protobuf/stubs/pbconfig.h
+11
-1
No files found.
src/google/protobuf/arena_unittest.cc
View file @
ca1c2529
...
...
@@ -30,8 +30,6 @@
#include <google/protobuf/arena.h>
#include <stdint.h>
#include <algorithm>
#include <cstring>
#include <memory>
...
...
src/google/protobuf/compiler/objectivec/objectivec_field.cc
View file @
ca1c2529
...
...
@@ -256,7 +256,7 @@ void FieldGenerator::GenerateFieldDescription(
// " .typeSpecific.value* = [something],"
GenerateFieldDescriptionTypeSpecific
(
printer
);
const
string
&
field_options
(
variables_
.
at
(
"fieldoptions"
)
);
const
string
&
field_options
(
variables_
.
find
(
"fieldoptions"
)
->
second
);
if
(
field_options
.
empty
())
{
printer
->
Print
(
" .fieldOptions = NULL,
\n
"
);
}
else
{
...
...
@@ -379,7 +379,7 @@ void ObjCObjFieldGenerator::GeneratePropertyDeclaration(
printer
->
Print
(
variables_
,
"@property(nonatomic, readwrite, $property_storage_attribute$) $property_type$ *$name$$storage_attribute$;
\n
"
);
if
(
IsInitName
(
variables_
.
at
(
"name"
)
))
{
if
(
IsInitName
(
variables_
.
find
(
"name"
)
->
second
))
{
// If property name starts with init we need to annotate it to get past ARC.
// http://stackoverflow.com/questions/18723226/how-do-i-annotate-an-objective-c-property-with-an-objc-method-family/18723227#18723227
printer
->
Print
(
variables_
,
...
...
@@ -426,7 +426,7 @@ void RepeatedFieldGenerator::GeneratePropertyDeclaration(
"$comments$"
"$array_comment$"
"@property(nonatomic, readwrite, strong) $array_storage_type$ *$name$$storage_attribute$;
\n
"
);
if
(
IsInitName
(
variables_
.
at
(
"name"
)
))
{
if
(
IsInitName
(
variables_
.
find
(
"name"
)
->
second
))
{
// If property name starts with init we need to annotate it to get past ARC.
// http://stackoverflow.com/questions/18723226/how-do-i-annotate-an-objective-c-property-with-an-objc-method-family/18723227#18723227
printer
->
Print
(
variables_
,
...
...
src/google/protobuf/lite_unittest.cc
View file @
ca1c2529
...
...
@@ -700,7 +700,7 @@ int main(int argc, char* argv[]) {
// Allocate a large initial block to avoid mallocs during hooked test.
std
::
vector
<
char
>
arena_block
(
128
*
1024
);
google
::
protobuf
::
ArenaOptions
options
;
options
.
initial_block
=
arena_block
.
data
()
;
options
.
initial_block
=
&
arena_block
[
0
]
;
options
.
initial_block_size
=
arena_block
.
size
();
google
::
protobuf
::
Arena
arena
(
options
);
string
data
;
...
...
src/google/protobuf/map.h
View file @
ca1c2529
...
...
@@ -33,6 +33,7 @@
#include <iterator>
#include <google/protobuf/stubs/hash.h>
#include <limits> // To support Visual Studio 2008
#include <google/protobuf/arena.h>
#include <google/protobuf/generated_enum_util.h>
...
...
@@ -200,6 +201,11 @@ class Map {
return
arena_
!=
other
.
arena_
;
}
// To support Visual Studio 2008
size_type
max_size
()
const
{
return
std
::
numeric_limits
<
size_type
>::
max
();
}
private
:
Arena
*
arena_
;
...
...
src/google/protobuf/map_field_test.cc
View file @
ca1c2529
...
...
@@ -145,7 +145,7 @@ TEST_F(MapFieldBasePrimitiveTest, Arena) {
// Allocate a large initial block to avoid mallocs during hooked test.
std
::
vector
<
char
>
arena_block
(
128
*
1024
);
ArenaOptions
options
;
options
.
initial_block
=
arena_block
.
data
()
;
options
.
initial_block
=
&
arena_block
[
0
]
;
options
.
initial_block_size
=
arena_block
.
size
();
Arena
arena
(
options
);
...
...
src/google/protobuf/map_test.cc
View file @
ca1c2529
...
...
@@ -2285,7 +2285,7 @@ TEST(ArenaTest, ParsingAndSerializingNoHeapAllocation) {
// Allocate a large initial block to avoid mallocs during hooked test.
std
::
vector
<
char
>
arena_block
(
128
*
1024
);
ArenaOptions
options
;
options
.
initial_block
=
arena_block
.
data
()
;
options
.
initial_block
=
&
arena_block
[
0
]
;
options
.
initial_block_size
=
arena_block
.
size
();
Arena
arena
(
options
);
string
data
;
...
...
src/google/protobuf/stubs/hash.h
View file @
ca1c2529
...
...
@@ -112,7 +112,7 @@ class hash_set : public std::set<Key, HashFcn> {
#elif defined(_MSC_VER) && !defined(_STLPORT_VERSION)
template
<
typename
Key
>
struct
hash
:
public
GOOGLE_PROTOBUF_HASH_
NAMESPACE
::
hash_compare
<
Key
>
{
struct
hash
:
public
GOOGLE_PROTOBUF_HASH_
COMPARE
<
Key
>
{
};
// MSVC's hash_compare<const char*> hashes based on the string contents but
...
...
@@ -126,8 +126,7 @@ class CstringLess {
template
<>
struct
hash
<
const
char
*>
:
public
GOOGLE_PROTOBUF_HASH_NAMESPACE
::
hash_compare
<
const
char
*
,
CstringLess
>
{};
:
public
GOOGLE_PROTOBUF_HASH_COMPARE
<
const
char
*
,
CstringLess
>
{};
template
<
typename
Key
,
typename
Data
,
typename
HashFcn
=
hash
<
Key
>
,
...
...
vsprojects/google/protobuf/stubs/pbconfig.h
View file @
ca1c2529
...
...
@@ -10,24 +10,34 @@
// http://blogs.msdn.com/vcblog/archive/2009/05/25/stl-breaking-changes-in-visual-studio-2010-beta-1.aspx
// And.. they are moved back to stdext in MSVC 2013 (haven't checked 2012). That
// said, use unordered_map for MSVC 2010 and beyond is our safest bet.
#if _MSC_VER >= 1600
#if _MSC_VER >= 1600
// Since Visual Studio 2010
#define GOOGLE_PROTOBUF_HASH_NAMESPACE std
#define GOOGLE_PROTOBUF_HASH_MAP_H <unordered_map>
#define GOOGLE_PROTOBUF_HASH_MAP_CLASS unordered_map
#define GOOGLE_PROTOBUF_HASH_SET_H <unordered_set>
#define GOOGLE_PROTOBUF_HASH_SET_CLASS unordered_set
#define GOOGLE_PROTOBUF_HASH_COMPARE std::hash_compare
#elif _MSC_VER >= 1500 // Since Visual Studio 2008
#define GOOGLE_PROTOBUF_HASH_NAMESPACE std::tr1
#define GOOGLE_PROTOBUF_HASH_MAP_H <unordered_map>
#define GOOGLE_PROTOBUF_HASH_MAP_CLASS unordered_map
#define GOOGLE_PROTOBUF_HASH_SET_H <unordered_set>
#define GOOGLE_PROTOBUF_HASH_SET_CLASS unordered_set
#define GOOGLE_PROTOBUF_HASH_COMPARE stdext::hash_compare
#elif _MSC_VER >= 1310
#define GOOGLE_PROTOBUF_HASH_NAMESPACE stdext
#define GOOGLE_PROTOBUF_HASH_MAP_H <hash_map>
#define GOOGLE_PROTOBUF_HASH_MAP_CLASS hash_map
#define GOOGLE_PROTOBUF_HASH_SET_H <hash_set>
#define GOOGLE_PROTOBUF_HASH_SET_CLASS hash_set
#define GOOGLE_PROTOBUF_HASH_COMPARE stdext::hash_compare
#else
#define GOOGLE_PROTOBUF_HASH_NAMESPACE std
#define GOOGLE_PROTOBUF_HASH_MAP_H <hash_map>
#define GOOGLE_PROTOBUF_HASH_MAP_CLASS hash_map
#define GOOGLE_PROTOBUF_HASH_SET_H <hash_set>
#define GOOGLE_PROTOBUF_HASH_SET_CLASS hash_set
#define GOOGLE_PROTOBUF_HASH_COMPARE stdext::hash_compare
#endif
/* the location of <hash_set> */
...
...
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