Skip to content

Commit

Permalink
Merge pull request #25 from ProjectBorealis/master
Browse files Browse the repository at this point in the history
Fixes for Windows
  • Loading branch information
gen2brain authored Jan 14, 2022
2 parents 9c4a697 + a7ec007 commit b947898
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/cmd/unarr/unarr
/cmd/unarr/unarr.exe
/unarr
/unarr.exe
/dist

.DS_Store
Expand Down
4 changes: 2 additions & 2 deletions unarrc/external/unarr/common/stream.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ static size_t file_read(void *data, void *buffer, size_t count)

static bool file_seek(void *data, off64_t offset, int origin)
{
#ifdef _MSC_VER
#ifdef _WIN32
return _fseeki64(data, offset, origin) == 0;
#else
#if _POSIX_C_SOURCE >= 200112L
Expand All @@ -74,7 +74,7 @@ static bool file_seek(void *data, off64_t offset, int origin)

static off64_t file_tell(void *data)
{
#ifdef _MSC_VER
#ifdef _WIN32
return _ftelli64(data);
#elif _POSIX_C_SOURCE >= 200112L
return ftello(data);
Expand Down
6 changes: 3 additions & 3 deletions unarrc/external/unarr/lzmasdk/CpuArch.c
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ BoolInt CPU_Is_InOrder()
}

#if !defined(MY_CPU_AMD64) && defined(_WIN32)
#include <Windows.h>
#include <windows.h>
static BoolInt CPU_Sys_Is_SSE_Supported()
{
OSVERSIONINFO vi;
Expand Down Expand Up @@ -275,7 +275,7 @@ BoolInt CPU_IsSupported_SHA()
// #include <stdio.h>

#ifdef _WIN32
#include <Windows.h>
#include <windows.h>
#endif

BoolInt CPU_IsSupported_AVX2()
Expand Down Expand Up @@ -351,7 +351,7 @@ BoolInt CPU_IsSupported_PageGB()

#ifdef _WIN32

#include <Windows.h>
#include <windows.h>

BoolInt CPU_IsSupported_CRC32() { return IsProcessorFeaturePresent(PF_ARM_V8_CRC32_INSTRUCTIONS_AVAILABLE) ? 1 : 0; }
BoolInt CPU_IsSupported_CRYPTO() { return IsProcessorFeaturePresent(PF_ARM_V8_CRYPTO_INSTRUCTIONS_AVAILABLE) ? 1 : 0; }
Expand Down
11 changes: 11 additions & 0 deletions unarrc/external/unarr/zip/inflate.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@
#include <string.h>

#ifndef _MSC_VER
#ifdef __forceinline
#define FORCE_INLINE_OVERRIDE
#endif
#ifdef FORCE_INLINE_OVERRIDE
#pragma push_macro("__forceinline")
#undef __forceinline
#endif
#define __forceinline inline
#endif

Expand Down Expand Up @@ -482,3 +489,7 @@ int inflate_flush(inflate_state *state, unsigned char data_in[8])
state->in.available = keep;
return count;
}

#ifdef FORCE_INLINE_OVERRIDE
#pragma pop_macro("__forceinline")
#endif

0 comments on commit b947898

Please sign in to comment.