Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for Windows #25

Merged
merged 1 commit into from
Jan 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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