Feature #6790
want suite of endian(3C) functions
Added by Robert Mustacchi about 5 years ago.
Updated almost 5 years ago.
Category:
lib - userland libraries
Description
Quite a lot of software leverages endian.h and a series of related functions for endian conversations beyond the traditional byteorder (ntohs, etc.) functions. This change adds support for these by providing an endian.h header as well as a suite of related functions that match the diverging name sets that folks use.
- Related to Bug #1777: byteswap.h and endian.h could be provided added
- Status changed from New to Closed
- % Done changed from 90 to 100
git commit 7dc9a163b382daee1ce43b6588dd1b507363dae5
commit 7dc9a163b382daee1ce43b6588dd1b507363dae5
Author: Robert Mustacchi <rm@joyent.com>
Date: 2016-05-19T14:45:53.000Z
6790 want suite of endian(3C) functions
Reviewed by: Dan McDonald <danmcd@omniti.com>
Reviewed by: Richard Lowe <richlowe@richlowe.net>
Approved by: Garrett D'Amore <garrett@damore.org>
This breaks mozilla which expects <endian.h> to be able to do the following in jscpucfg.h:
#elif defined(JS_HAVE_ENDIAN_H)
# include <endian.h>
# if defined(__BYTE_ORDER)
# if __BYTE_ORDER == __LITTLE_ENDIAN
# define IS_LITTLE_ENDIAN 1
# undef IS_BIG_ENDIAN
# elif __BYTE_ORDER == __BIG_ENDIAN
# undef IS_LITTLE_ENDIAN
# define IS_BIG_ENDIAN 1
# endif
# else /* !defined(__BYTE_ORDER) */
# error "endian.h does not define __BYTE_ORDER. Cannot determine endianness."
# endif
looks like the '__' prefixed form should perhaps be defined by default, and the standard
if ! defined STRICT_ANSI || defined EXTENSIONS whatnot be used for the defs without the prefix.
found this: http://www.scs.stanford.edu/histar/src/pkg/uclibc/include/endian.h
Can you please open a new bug about this?
- Related to Bug #8706: libc lint library missing endian.h functions added
Also available in: Atom
PDF