Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
abseil-cpp
Overview
Overview
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
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open
abseil-cpp
Commits
01174578
Unverified
Commit
01174578
authored
Oct 30, 2018
by
Matt Calabrese
Committed by
GitHub
Oct 30, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #201 from ccawley2011/fix-byteswap
Fix compilation of generic byteswap routines
parents
f86f9413
297e77fb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
11 deletions
+14
-11
absl/base/internal/endian.h
+14
-11
No files found.
absl/base/internal/endian.h
View file @
01174578
...
@@ -82,14 +82,14 @@ inline uint64_t gbswap_64(uint64_t host_int) {
...
@@ -82,14 +82,14 @@ inline uint64_t gbswap_64(uint64_t host_int) {
#elif defined(__GLIBC__)
#elif defined(__GLIBC__)
return
bswap_64
(
host_int
);
return
bswap_64
(
host_int
);
#else
#else
return
(((
x
&
uint64_t
{(
0xFF
})
<<
56
)
|
return
(((
host_int
&
uint64_t
{
0xFF
})
<<
56
)
|
((
x
&
uint64_t
{(
0xFF00
})
<<
40
)
|
((
host_int
&
uint64_t
{
0xFF00
})
<<
40
)
|
((
x
&
uint64_t
{(
0xFF0000
})
<<
24
)
|
((
host_int
&
uint64_t
{
0xFF0000
})
<<
24
)
|
((
x
&
uint64_t
{(
0xFF000000
})
<<
8
)
|
((
host_int
&
uint64_t
{
0xFF000000
})
<<
8
)
|
((
x
&
uint64_t
{(
0xFF00000000
})
>>
8
)
|
((
host_int
&
uint64_t
{
0xFF00000000
})
>>
8
)
|
((
x
&
uint64_t
{(
0xFF0000000000
})
>>
24
)
|
((
host_int
&
uint64_t
{
0xFF0000000000
})
>>
24
)
|
((
x
&
uint64_t
{(
0xFF000000000000
})
>>
40
)
|
((
host_int
&
uint64_t
{
0xFF000000000000
})
>>
40
)
|
((
x
&
uint64_t
{(
0xFF00000000000000
})
>>
56
));
((
host_int
&
uint64_t
{
0xFF00000000000000
})
>>
56
));
#endif // bswap_64
#endif // bswap_64
}
}
...
@@ -97,8 +97,10 @@ inline uint32_t gbswap_32(uint32_t host_int) {
...
@@ -97,8 +97,10 @@ inline uint32_t gbswap_32(uint32_t host_int) {
#if defined(__GLIBC__)
#if defined(__GLIBC__)
return
bswap_32
(
host_int
);
return
bswap_32
(
host_int
);
#else
#else
return
(((
x
&
0xFF
)
<<
24
)
|
((
x
&
0xFF00
)
<<
8
)
|
((
x
&
0xFF0000
)
>>
8
)
|
return
(((
host_int
&
uint32_t
{
0xFF
})
<<
24
)
|
((
x
&
0xFF000000
)
>>
24
));
((
host_int
&
uint32_t
{
0xFF00
})
<<
8
)
|
((
host_int
&
uint32_t
{
0xFF0000
})
>>
8
)
|
((
host_int
&
uint32_t
{
0xFF000000
})
>>
24
));
#endif
#endif
}
}
...
@@ -106,7 +108,8 @@ inline uint16_t gbswap_16(uint16_t host_int) {
...
@@ -106,7 +108,8 @@ inline uint16_t gbswap_16(uint16_t host_int) {
#if defined(__GLIBC__)
#if defined(__GLIBC__)
return
bswap_16
(
host_int
);
return
bswap_16
(
host_int
);
#else
#else
return
uint16_t
{((
x
&
0xFF
)
<<
8
)
|
((
x
&
0xFF00
)
>>
8
)};
return
(((
host_int
&
uint16_t
{
0xFF
})
<<
8
)
|
((
host_int
&
uint16_t
{
0xFF00
})
>>
8
));
#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