zinonet / naclports

Automatically exported from code.google.com/p/naclports
0 stars 0 forks source link

ntohs(glibc-compat) macro error #136

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. compile mp4v2 with glibc-compat
2.
3.

What is the expected output? What do you see instead?
atom name compare failed, code below:
...mp4util.h...
inline u_int32_t STRTOINT32(const char* s) {
  return ntohl(*(uint32_t *)s);
}

What version of the product are you using? On what operating system?
glibc-compat 0.1

Please provide any additional information below.
Use macro for ntohs, ntohl, htons, htonl are not good, something  may wrong 
when "unwind" macro. Use inline function instead:

old: 
#define ntohs(x)   __byte_swap_16(x)

new:
inline u_int32_t STRTOINT32(const char* s) {
  return  __byte_swap_16(x);
}

or inline the "__byte_swap_16". I'm not family with checkin my code, please 
help to patch it.

Original issue reported on code.google.com by ImSk...@gmail.com on 29 Aug 2014 at 2:33

GoogleCodeExporter commented 9 years ago
I believe this was fixed here: https://codereview.chromium.org/546233004

Should we add mp4v2 to naclports?

Original comment by sbc@google.com on 29 Sep 2014 at 9:50