-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Adds MBEDTLS_THREADING_C implementation for Windows using srwlock #7180
base: development
Are you sure you want to change the base?
Changes from 6 commits
df86a45
b79a653
668e28f
91c1e26
70e8589
9374da3
b6dd4e5
c53a695
1781032
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,6 +47,19 @@ typedef struct mbedtls_threading_mutex_t { | |
} mbedtls_threading_mutex_t; | ||
#endif | ||
|
||
#if defined(MBEDTLS_THREADING_SRWLOCK) | ||
/* | ||
* Use spaces to pass the macroses name check. | ||
*/ | ||
# define WIN32_LEAN_AND_MEAN | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please add a comment explaining why (For |
||
# include <windows.h> | ||
# include <synchapi.h> | ||
# undef WIN32_LEAN_AND_MEAN | ||
typedef struct mbedtls_threading_mutex_t { | ||
SRWLOCK lock; | ||
} mbedtls_threading_mutex_t; | ||
#endif | ||
|
||
#if defined(MBEDTLS_THREADING_ALT) | ||
/* You should define the mbedtls_threading_mutex_t type in your header */ | ||
#include "threading_alt.h" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add
WIN32_LEAN_AND_MEAN
and_WIN32_WINNT
to theexclusions
list inparse_macros
intests/scripts/check_names.py
. That's how we deal with the similar case of_CRT_SECURE_NO_DEPRECATE
.