Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-773

Endianness is wrong if <endian.h> header is not available

Attach filesAttach ScreenshotAdd voteVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Patch Available

    Description

      TProtocol expects the header <endian.h> to be available, otherwise it relies on <boost/config.hpp>, but

      • boost/config does not define endianness, that's done by <boost/detail/endian.hpp>
      • even if it was, boost only defines the macro depending on the type (so either BOOST_LITTLE_ENDIAN or BOOST_BIG_ENDIAN) and does not, as in <endian.h> set a value.

      As result, if <endian.h> is not available, the code always uses big endianness.

      The simplest solution is to include the right header and define those values using the information boost provides.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            nova77 Norman Casagrande

            Dates

              Created:
              Updated:

              Slack

                Issue deployment