Skip to content
Snippets Groups Projects
Commit 3527e270 authored by Avi Kivity's avatar Avi Kivity
Browse files

libc: fix ntohl() and friends under mode=release

The glibc headers define those as macros, need to undefine before declaring
as functions.
parent 1ae91ef1
No related branches found
No related tags found
No related merge requests found
#include <netinet/in.h> #include <netinet/in.h>
#include <byteswap.h> #include <byteswap.h>
#undef htonl
uint32_t htonl(uint32_t n) uint32_t htonl(uint32_t n)
{ {
union { int i; char c; } u = { 1 }; union { int i; char c; } u = { 1 };
......
#include <netinet/in.h> #include <netinet/in.h>
#include <byteswap.h> #include <byteswap.h>
#undef htons
uint16_t htons(uint16_t n) uint16_t htons(uint16_t n)
{ {
union { int i; char c; } u = { 1 }; union { int i; char c; } u = { 1 };
......
#include <netinet/in.h> #include <netinet/in.h>
#include <byteswap.h> #include <byteswap.h>
#undef ntohl
uint32_t ntohl(uint32_t n) uint32_t ntohl(uint32_t n)
{ {
union { int i; char c; } u = { 1 }; union { int i; char c; } u = { 1 };
......
#include <netinet/in.h> #include <netinet/in.h>
#include <byteswap.h> #include <byteswap.h>
#undef ntohs
uint16_t ntohs(uint16_t n) uint16_t ntohs(uint16_t n)
{ {
union { int i; char c; } u = { 1 }; union { int i; char c; } u = { 1 };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment