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
d7787780
Commit
d7787780
authored
Dec 05, 2014
by
Feng Xiao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix thread local annotatoin and add back type traits is_convertable for MSVC
parent
6a949cda
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
4 deletions
+10
-4
arena.h
src/google/protobuf/arena.h
+1
-1
common.h
src/google/protobuf/stubs/common.h
+6
-0
type_traits.h
src/google/protobuf/stubs/type_traits.h
+2
-2
type_traits_unittest.cc
src/google/protobuf/stubs/type_traits_unittest.cc
+1
-1
No files found.
src/google/protobuf/arena.h
View file @
d7787780
...
...
@@ -312,7 +312,7 @@ class LIBPROTOBUF_EXPORT Arena {
static
const
size_t
kHeaderSize
=
sizeof
(
Block
);
static
google
::
protobuf
::
internal
::
SequenceNumber
lifecycle_id_generator_
;
static
__thread
ThreadCache
thread_cache_
;
static
GOOGLE_THREAD_LOCAL
ThreadCache
thread_cache_
;
// SFINAE for skipping addition to delete list for a Type. This is mainly to
// skip proto2/proto1 message objects with cc_enable_arenas=true from being
...
...
src/google/protobuf/stubs/common.h
View file @
d7787780
...
...
@@ -314,6 +314,12 @@ inline void GOOGLE_UNALIGNED_STORE64(void *p, uint64 v) {
}
#endif
#if defined(_MSC_VER)
#define GOOGLE_THREAD_LOCAL __declspec(thread)
#else
#define GOOGLE_THREAD_LOCAL __thread
#endif
// ===================================================================
// from google3/base/basictypes.h
...
...
src/google/protobuf/stubs/type_traits.h
View file @
d7787780
...
...
@@ -103,7 +103,7 @@ template <class T> struct remove_reference;
template
<
class
T
>
struct
add_reference
;
template
<
class
T
>
struct
remove_pointer
;
template
<
class
T
,
class
U
>
struct
is_same
;
#if !
defined(_MSC_VER) && !
(defined(__GNUC__) && __GNUC__ <= 3)
#if !(defined(__GNUC__) && __GNUC__ <= 3)
template
<
class
From
,
class
To
>
struct
is_convertible
;
#endif
...
...
@@ -322,7 +322,7 @@ template<typename T, typename U> struct is_same : public false_type { };
template
<
typename
T
>
struct
is_same
<
T
,
T
>
:
public
true_type
{
};
// Specified by TR1 [4.6] Relationships between types
#if !
defined(_MSC_VER) && !
(defined(__GNUC__) && __GNUC__ <= 3)
#if !(defined(__GNUC__) && __GNUC__ <= 3)
namespace
type_traits_internal
{
// This class is an implementation detail for is_convertible, and you
...
...
src/google/protobuf/stubs/type_traits_unittest.cc
View file @
d7787780
...
...
@@ -610,7 +610,7 @@ TEST(TypeTraitsTest, TestIsSame) {
}
TEST
(
TypeTraitsTest
,
TestConvertible
)
{
#if !
defined(_MSC_VER) && !
(defined(__GNUC__) && __GNUC__ <= 3)
#if !(defined(__GNUC__) && __GNUC__ <= 3)
EXPECT_TRUE
((
is_convertible
<
int
,
int
>::
value
));
EXPECT_TRUE
((
is_convertible
<
int
,
long
>::
value
));
EXPECT_TRUE
((
is_convertible
<
long
,
int
>::
value
));
...
...
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