Fix tests compilation in MSVC.

This commit is contained in:
2026-04-04 15:54:38 +01:00
parent 509bb6026d
commit 774ccbc8ae
6 changed files with 14 additions and 0 deletions

View File

@@ -22,9 +22,12 @@
/** @brief Clamp num_threads to LZMA's valid range [1, 2]. */ /** @brief Clamp num_threads to LZMA's valid range [1, 2]. */
#define LZMA_THREADS(ctx) ((ctx)->num_threads > 1 ? 2 : 1) #define LZMA_THREADS(ctx) ((ctx)->num_threads > 1 ? 2 : 1)
#include <stdbool.h>
#include <stdint.h> #include <stdint.h>
#include <stdio.h> #include <stdio.h>
#include "aaruformat/context.h"
#if defined(AARU_USE_WIN32_FILEIO64) #if defined(AARU_USE_WIN32_FILEIO64)
#define AARU_FSEEK _fseeki64 #define AARU_FSEEK _fseeki64
#define AARU_FTELL _ftelli64 #define AARU_FTELL _ftelli64

View File

@@ -10,6 +10,7 @@
#include <cstdio> #include <cstdio>
#include <cstring> #include <cstring>
#include "decls.h"
#include "gtest/gtest.h" #include "gtest/gtest.h"
extern "C" extern "C"

View File

@@ -11,6 +11,7 @@
#include <cstdlib> #include <cstdlib>
#include <cstring> #include <cstring>
#include "decls.h"
#include "gtest/gtest.h" #include "gtest/gtest.h"
extern "C" extern "C"

View File

@@ -11,6 +11,7 @@
#include <cstdlib> #include <cstdlib>
#include <cstring> #include <cstring>
#include "decls.h"
#include "gtest/gtest.h" #include "gtest/gtest.h"
extern "C" extern "C"

View File

@@ -1,7 +1,11 @@
// SHA-1 tests (public domain / MIT implementation integration) // SHA-1 tests (public domain / MIT implementation integration)
// Uses standard FIPS 180-1 test vectors. // Uses standard FIPS 180-1 test vectors.
#if defined(_WIN32)
#include <direct.h>
#else
#include <unistd.h> #include <unistd.h>
#endif
#include <climits> #include <climits>
#include <cstdint> #include <cstdint>
#include <cstdio> #include <cstdio>

View File

@@ -6,7 +6,11 @@
* Validates implementation against standard FIPS 180-4 test vectors and the bundled random file. * Validates implementation against standard FIPS 180-4 test vectors and the bundled random file.
*/ */
#if defined(_WIN32)
#include <direct.h>
#else
#include <unistd.h> #include <unistd.h>
#endif
#include <climits> #include <climits>
#include <cstdint> #include <cstdint>
#include <cstdio> #include <cstdio>