This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Fix htonl, htons, ntohl, ntohs functions on big endian systems
- From: Florian Weimer <fw at deneb dot enyo dot de>
- To: Aurelien Jarno <aurelien at aurel32 dot net>
- Cc: libc-alpha at sourceware dot org
- Date: Sun, 31 Jul 2016 15:56:18 +0200
- Subject: Re: [PATCH] Fix htonl, htons, ntohl, ntohs functions on big endian systems
- Authentication-results: sourceware.org; auth=none
- References: <1469919569-27798-1-git-send-email-aurelien@aurel32.net>
* Aurelien Jarno:
> +# if defined __GNUC__ && __GNUC__ >= 2
> +# define ntohl(x) \
> + (__extension__ \
> + ({ uint32_t __x = x; \
Please use __ntohl_x as the variable name or turn ntohl into a macro
which calls an inline function. ntohl (__x) looks like something
another header file might do (although the example in gutenprint is
harmless).