Skip to content

Commit

Permalink
Fix support for BSD operating systems
Browse files Browse the repository at this point in the history
  • Loading branch information
rikyoz committed Jun 18, 2024
1 parent ee50c51 commit 3ad0c64
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 @@ -348,7 +348,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 @@ -184,7 +184,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 3ad0c64

Please sign in to comment.