Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
babeld
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
babeld
Commits
bbf85aaf
Commit
bbf85aaf
authored
Feb 11, 2012
by
Matthieu Boutier
Committed by
Juliusz Chroboczek
Feb 11, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make endianness-conversion macros less fragile.
parent
2b757086
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
util.h
util.h
+4
-4
No files found.
util.h
View file @
bbf85aaf
...
...
@@ -21,10 +21,10 @@ THE SOFTWARE.
*/
#if defined(i386) || defined(__mc68020__) || defined(__x86_64__)
#define DO_NTOHS(_d, _s) do
{ _d = ntohs(*(unsigned short*)(_s)); }
while(0)
#define DO_NTOHL(_d, _s) do
{ _d = ntohl(*(
unsigned*)(_s)); } while(0)
#define DO_HTONS(_d, _s) do
{ *(unsigned short*)(_d) = htons(_s); } while(0)
#define DO_HTONL(_d, _s) do
{ *(unsigned*)(_d) = htonl(_s); } while(0)
#define DO_NTOHS(_d, _s) do
{ _d = ntohs(*(const unsigned short*)(_s)); }
while(0)
#define DO_NTOHL(_d, _s) do
{ _d = ntohl(*(const
unsigned*)(_s)); } while(0)
#define DO_HTONS(_d, _s) do{ *(unsigned short*)(_d) = htons(_s); } while(0)
#define DO_HTONL(_d, _s) do{ *(unsigned*)(_d) = htonl(_s); } while(0)
/* Some versions of gcc seem to be buggy, and ignore the packed attribute.
Disable this code until the issue is clarified. */
/* #elif defined __GNUC__*/
...
...
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