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
609f43ce
Commit
609f43ce
authored
Jan 15, 2018
by
Oskar Świtalski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add guards against bswap_XX redefnitions
Signed-off-by:
Oskar Świtalski
<
oskar.switalski@indoorway.com
>
parent
47b7d2c7
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
port.h
src/google/protobuf/stubs/port.h
+8
-0
No files found.
src/google/protobuf/stubs/port.h
View file @
609f43ce
...
...
@@ -375,10 +375,14 @@ inline void GOOGLE_UNALIGNED_STORE64(void *p, uint64 v) {
#elif !defined(__GLIBC__) && !defined(__CYGWIN__)
#ifndef bswap_16
static
inline
uint16
bswap_16
(
uint16
x
)
{
return
static_cast
<
uint16
>
(((
x
&
0xFF
)
<<
8
)
|
((
x
&
0xFF00
)
>>
8
));
}
#define bswap_16(x) bswap_16(x)
#endif
#ifndef bswap_32
static
inline
uint32
bswap_32
(
uint32
x
)
{
return
(((
x
&
0xFF
)
<<
24
)
|
((
x
&
0xFF00
)
<<
8
)
|
...
...
@@ -386,6 +390,9 @@ static inline uint32 bswap_32(uint32 x) {
((
x
&
0xFF000000
)
>>
24
));
}
#define bswap_32(x) bswap_32(x)
#endif
#ifndef bswap_64
static
inline
uint64
bswap_64
(
uint64
x
)
{
return
(((
x
&
GOOGLE_ULONGLONG
(
0xFF
))
<<
56
)
|
((
x
&
GOOGLE_ULONGLONG
(
0xFF00
))
<<
40
)
|
...
...
@@ -397,6 +404,7 @@ static inline uint64 bswap_64(uint64 x) {
((
x
&
GOOGLE_ULONGLONG
(
0xFF00000000000000
))
>>
56
));
}
#define bswap_64(x) bswap_64(x)
#endif
#endif
...
...
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