VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Common/lzma/Threads.h
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2025-01-01 10:37:18 +0100
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2025-01-01 10:37:18 +0100
commitfcc6302e6139b5b4714c91fd91d215c77af7695c (patch)
tree46af4b2f1675f4b11f4acef6c04ac7942e6a5f17 /src/Common/lzma/Threads.h
parent4e85009f579972ce422349d2c99ae0920b8e45c2 (diff)
downloadVeraCrypt-fcc6302e6139b5b4714c91fd91d215c77af7695c.tar.gz
VeraCrypt-fcc6302e6139b5b4714c91fd91d215c77af7695c.zip
Windows: Update LZMA SDK to version 24.09
Diffstat (limited to 'src/Common/lzma/Threads.h')
-rw-r--r--src/Common/lzma/Threads.h20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/Common/lzma/Threads.h b/src/Common/lzma/Threads.h
index 4028464a..c1484a27 100644
--- a/src/Common/lzma/Threads.h
+++ b/src/Common/lzma/Threads.h
@@ -1,5 +1,5 @@
/* Threads.h -- multithreading library
-2023-04-02 : Igor Pavlov : Public domain */
+2024-03-28 : Igor Pavlov : Public domain */
#ifndef ZIP7_INC_THREADS_H
#define ZIP7_INC_THREADS_H
@@ -9,12 +9,21 @@
#else
+#include "Compiler.h"
+
+// #define Z7_AFFINITY_DISABLE
#if defined(__linux__)
#if !defined(__APPLE__) && !defined(_AIX) && !defined(__ANDROID__)
#ifndef Z7_AFFINITY_DISABLE
#define Z7_AFFINITY_SUPPORTED
// #pragma message(" ==== Z7_AFFINITY_SUPPORTED")
-// #define _GNU_SOURCE
+#if !defined(_GNU_SOURCE)
+// #pragma message(" ==== _GNU_SOURCE set")
+// we need _GNU_SOURCE for cpu_set_t, if we compile for MUSL
+Z7_DIAGNOSTIC_IGNORE_BEGIN_RESERVED_MACRO_IDENTIFIER
+#define _GNU_SOURCE
+Z7_DIAGNOSTIC_IGNORE_END_RESERVED_MACRO_IDENTIFIER
+#endif
#endif
#endif
#endif
@@ -173,7 +182,7 @@ WRes CriticalSection_Init(CCriticalSection *p);
#else // _WIN32
-typedef struct _CEvent
+typedef struct
{
int _created;
int _manual_reset;
@@ -199,7 +208,7 @@ WRes Event_Wait(CEvent *p);
WRes Event_Close(CEvent *p);
-typedef struct _CSemaphore
+typedef struct
{
int _created;
UInt32 _count;
@@ -219,7 +228,7 @@ WRes Semaphore_Wait(CSemaphore *p);
WRes Semaphore_Close(CSemaphore *p);
-typedef struct _CCriticalSection
+typedef struct
{
pthread_mutex_t _mutex;
} CCriticalSection;
@@ -230,6 +239,7 @@ void CriticalSection_Enter(CCriticalSection *cs);
void CriticalSection_Leave(CCriticalSection *cs);
LONG InterlockedIncrement(LONG volatile *addend);
+LONG InterlockedDecrement(LONG volatile *addend);
#endif // _WIN32