Skip to content

Commit

Permalink
Merge pull request #68 from pzaino/develop
Browse files Browse the repository at this point in the history
Cumulative set of fixed to build ZVector under Microsoft Visual Studio 2019 and 2022 (core library)
  • Loading branch information
pzaino authored Jan 16, 2022
2 parents dcf9d20 + 8a72526 commit bfd899b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/zvector.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@
# if MUTEX_TYPE == 1
# include <pthread.h>
# elif MUTEX_TYPE == 2
# include <psapi.h>
# include <windows.h>
# include <psapi.h>
# endif // MUTEX_TYPE
#endif // ZVECT_THREAD_SAFE

Expand Down Expand Up @@ -163,7 +163,9 @@ static uint32_t p_init_state = 0;
/*---------------------------------------------------------------------------*/
// Errors and messages handling:

#if (ZVECT_COMPTYPE == 1) || (ZVECT_COMPTYPE == 3)
__attribute__((noreturn))
#endif
static void p_throw_error(const char *error_message) {
#if OS_TYPE == 1
fprintf(stderr, "Error: %s\n", error_message);
Expand Down Expand Up @@ -251,8 +253,8 @@ static inline void mutex_destroy(pthread_mutex_t *lock) {
pthread_mutex_unlock(lock);
pthread_mutex_destroy(lock);
}

# elif MUTEX_TYPE == 2
static volatile bool lock_enabled = true;

static inline void mutex_lock(CRITICAL_SECTION *lock) {
EnterCriticalSection(lock);
Expand Down

0 comments on commit bfd899b

Please sign in to comment.