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
a4491ea1
Commit
a4491ea1
authored
Nov 14, 2012
by
xiaofeng@google.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix issue 412: update protobuf for 64-bit compatibility on Mac OS X - patch from Mark Mentovai
parent
a058718f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
8 deletions
+9
-8
atomicops_internals_atomicword_compat.h
...le/protobuf/stubs/atomicops_internals_atomicword_compat.h
+2
-2
atomicops_internals_macosx.h
src/google/protobuf/stubs/atomicops_internals_macosx.h
+7
-6
No files found.
src/google/protobuf/stubs/atomicops_internals_atomicword_compat.h
View file @
a4491ea1
...
...
@@ -44,7 +44,7 @@
// On LP64 platforms, AtomicWord and Atomic64 are both always long,
// so this problem doesn't occur.
#if !defined(GOOGLE_PROTOBUF_
HOST_
ARCH_64_BIT)
#if !defined(GOOGLE_PROTOBUF_ARCH_64_BIT)
namespace
google
{
namespace
protobuf
{
...
...
@@ -117,6 +117,6 @@ inline AtomicWord Release_Load(volatile const AtomicWord* ptr) {
}
// namespace protobuf
}
// namespace google
#endif // !defined(GOOGLE_PROTOBUF_
HOST_
ARCH_64_BIT)
#endif // !defined(GOOGLE_PROTOBUF_ARCH_64_BIT)
#endif // GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_ATOMICWORD_COMPAT_H_
src/google/protobuf/stubs/atomicops_internals_macosx.h
View file @
a4491ea1
...
...
@@ -136,7 +136,7 @@ inline Atomic64 NoBarrier_CompareAndSwap(volatile Atomic64* ptr,
Atomic64
prev_value
;
do
{
if
(
OSAtomicCompareAndSwap64
(
old_value
,
new_value
,
const_cast
<
Atomic64
*>
(
ptr
)))
{
reinterpret_cast
<
volatile
int64_t
*>
(
ptr
)))
{
return
old_value
;
}
prev_value
=
*
ptr
;
...
...
@@ -150,18 +150,19 @@ inline Atomic64 NoBarrier_AtomicExchange(volatile Atomic64* ptr,
do
{
old_value
=
*
ptr
;
}
while
(
!
OSAtomicCompareAndSwap64
(
old_value
,
new_value
,
const_cast
<
Atomic64
*>
(
ptr
)));
reinterpret_cast
<
volatile
int64_t
*>
(
ptr
)));
return
old_value
;
}
inline
Atomic64
NoBarrier_AtomicIncrement
(
volatile
Atomic64
*
ptr
,
Atomic64
increment
)
{
return
OSAtomicAdd64
(
increment
,
const_cast
<
Atomic64
*>
(
ptr
));
return
OSAtomicAdd64
(
increment
,
reinterpret_cast
<
volatile
int64_t
*>
(
ptr
));
}
inline
Atomic64
Barrier_AtomicIncrement
(
volatile
Atomic64
*
ptr
,
Atomic64
increment
)
{
return
OSAtomicAdd64Barrier
(
increment
,
const_cast
<
Atomic64
*>
(
ptr
));
return
OSAtomicAdd64Barrier
(
increment
,
reinterpret_cast
<
volatile
int64_t
*>
(
ptr
));
}
inline
Atomic64
Acquire_CompareAndSwap
(
volatile
Atomic64
*
ptr
,
...
...
@@ -169,8 +170,8 @@ inline Atomic64 Acquire_CompareAndSwap(volatile Atomic64* ptr,
Atomic64
new_value
)
{
Atomic64
prev_value
;
do
{
if
(
OSAtomicCompareAndSwap64Barrier
(
old_value
,
new_value
,
const_cast
<
Atomic64
*>
(
ptr
)))
{
if
(
OSAtomicCompareAndSwap64Barrier
(
old_value
,
new_value
,
reinterpret_cast
<
volatile
int64_t
*>
(
ptr
)))
{
return
old_value
;
}
prev_value
=
*
ptr
;
...
...
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