Skip to content

Commit

Permalink
Fix support for BSD operating systems
Browse files Browse the repository at this point in the history
Close issue #230
  • Loading branch information
rikyoz committed Aug 10, 2024
1 parent b3d0017 commit 084b5dd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/internal/formatdetect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,9 @@ struct OffsetSignature {
#elif defined(__GNUC__) || defined(__clang__)
//Note: the versions of gcc and clang that can compile bit7z should also have this builtin, hence there is no need
// for checking the compiler version or using the _has_builtin macro.
#ifndef bswap64
#define bswap64 __builtin_bswap64
#endif
#else
static inline uint64_t bswap64( uint64_t x ) {
return ((x << 56) & 0xff00000000000000ULL) |
Expand Down
3 changes: 2 additions & 1 deletion src/internal/fsutil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,8 @@ static const mode_t global_umask = []() noexcept -> mode_t {
#endif

#ifndef _WIN32
#ifdef __APPLE__
#if defined( __APPLE__ ) || defined( BSD ) || \
defined( __FreeBSD__ ) || defined( __NetBSD__ ) || defined( __OpenBSD__ ) || defined( __DragonFly__ )
using stat_t = struct stat;
const auto os_lstat = &lstat;
const auto os_stat = &stat;
Expand Down

0 comments on commit 084b5dd

Please sign in to comment.