forked from libguestfs/hivex
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lib: Promote byte_conversions.h #include to hivex-internal.h
This patch addresses a build failure in OS X. Running git-bisect on a straightforward build (bootstrap, autogen.sh, configure, make, make install) showed this as the "Bad commit:" 3e7c039 The issue is that hivex-internal.h uses le32toh in a static inline function. In case `configure` doesn't find le32toh, byte_conversions.h defines it. But hivex-internal.h doesn't include the safety definition. OS X demonstrates this a problem. Neither endian.h nor byteswap.h are found with `configure` in OS X 10.8.5 (XCode 5), but the headers are both found in Fedora 19 and Ubuntu 13.04. This patch to configure.ac further logs that only ntohl is available for byte swaps: @@ -153,6 +153,8 @@ AC_REPLACE_FUNCS([mmap]) dnl Functions. AC_CHECK_FUNCS([bindtextdomain]) +AC_CHECK_FUNCS([le32toh ntohl bswap_32 __bswap_32]) + (As an aside, it's curious that a missing byteswap.h didn't cause hivex-internal.h to fail to build.) (As another aside, this is an interesting example of lazy symbol binding failing with an inline function.) The problem is resolved by having hivex-internal.h include byte_conversions.h. This obviates most of the other direct inclusions of byte_conversions.h. (One persists under sh/.) This patch builds and runs hivexml on images/large fine in Ubuntu 13.04 and Fedora 19. It also allows builds to succeed in OS X, but doesn't run hivexml for an unrelated reason. The _iconv_open symbol-not-found issue, that I thought was previously resolved (491ba0f), resurfaced. Signed-off-by: Alex Nelson <a.nelson@prometheuscomputing.com>
- Loading branch information
Showing
7 changed files
with
2 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters