From 3dbb2ce2ea8b12867db0e24d4bd6c7c6501f5d5d Mon Sep 17 00:00:00 2001 From: Cameron Katri Date: Wed, 25 May 2022 18:20:38 -0400 Subject: Fix some portability issues --- machoparse/cdhash.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'machoparse/cdhash.c') 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() # include +# define bswap32(x) __builtin_bswap32(x) #else # include #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) -- cgit v1.2.3