diff options
author | Cameron Katri <me@cameronkatri.com> | 2022-05-25 18:20:38 -0400 |
---|---|---|
committer | Cameron Katri <me@cameronkatri.com> | 2022-05-25 18:20:38 -0400 |
commit | 3dbb2ce2ea8b12867db0e24d4bd6c7c6501f5d5d (patch) | |
tree | 34b4c2f32dca91660db151412cd94ce5a4d58ece /machoparse/cdhash.c | |
parent | a902c812e98dd53cf9f16b5175f7c1f87e780b53 (diff) | |
download | trustcache-3dbb2ce2ea8b12867db0e24d4bd6c7c6501f5d5d.tar.gz trustcache-3dbb2ce2ea8b12867db0e24d4bd6c7c6501f5d5d.tar.zst trustcache-3dbb2ce2ea8b12867db0e24d4bd6c7c6501f5d5d.zip |
Fix some portability issues
Diffstat (limited to 'machoparse/cdhash.c')
-rw-r--r-- | machoparse/cdhash.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/machoparse/cdhash.c b/machoparse/cdhash.c index 8f7796e..5ccd3aa 100644 --- a/machoparse/cdhash.c +++ b/machoparse/cdhash.c @@ -69,6 +69,7 @@ # define be32toh(x) OSSwapBigToHostInt32(x) #elif __has_include(<endian.h>) # include <endian.h> +# define bswap32(x) __builtin_bswap32(x) #else # include <sys/endian.h> #endif @@ -374,7 +375,7 @@ compute_cdhash_macho(const struct mach_header_64 *mh, const struct mach_header * return csblob_cdhash((CS_GenericBlob *)cs_data, cs_end - cs_data, cdhash); } -bool +static bool compute_cdhash(const void *file, size_t size, struct hashes *cdhash) { // Try to compute the cdhash for a Mach-O file. const struct mach_header_64 *mh = file; @@ -397,7 +398,7 @@ compute_cdhash(const void *file, size_t size, struct hashes *cdhash) { return false; } -void +static void compute_cdhashes(const void *file, size_t size, struct cdhashes *h) { const struct fat_header *fh = NULL; if (*((uint32_t*)file) == FAT_MAGIC || *((uint32_t*)file) == FAT_CIGAM) |