Project

General

Profile

Actions

Feature #6790

closed

want suite of endian(3C) functions

Added by Robert Mustacchi over 7 years ago. Updated over 7 years ago.

Status:
Closed
Priority:
Normal
Category:
lib - userland libraries
Start date:
2016-03-24
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:
External Bug:

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 issues

Related to illumos gate - Bug #1777: byteswap.h and endian.h could be providedNew2011-11-14

Actions
Related to illumos gate - Bug #8706: libc lint library missing endian.h functionsClosedRobert Mustacchi2017-10-04

Actions
Actions #1

Updated by Robert Mustacchi over 7 years ago

  • Related to Bug #1777: byteswap.h and endian.h could be provided added
Actions #2

Updated by Electric Monk over 7 years ago

  • 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>

Actions #3

Updated by Richard PALO over 7 years ago

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

Actions #4

Updated by Robert Mustacchi over 7 years ago

Can you please open a new bug about this?

Actions #5

Updated by Robert Mustacchi about 6 years ago

  • Related to Bug #8706: libc lint library missing endian.h functions added
Actions

Also available in: Atom PDF