Skip to content

Commit

Permalink
Remove #undef MBEDTLS_NET_C from mbedtls_config
Browse files Browse the repository at this point in the history
This was needed for windows because the `<windows.h>` include in
`threading_alt.h` broke compilation for `net_sockets.c`.

However, we can instead define `WIN32_LEAN_AND_MEAN` before including
<windows.h> in `threading_alt.h`, which avoids the issue so we can
remove this #undef.
  • Loading branch information
tobil4sk committed Jul 11, 2024
1 parent 9cdfc47 commit 2e27e61
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 1 addition & 3 deletions src/hx/libs/ssl/mbedtls_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,4 @@
#define MBEDTLS_THREADING_PTHREAD
#endif

#undef MBEDTLS_NET_C

#define MBEDTLS_THREADING_C
#define MBEDTLS_THREADING_C
3 changes: 2 additions & 1 deletion src/hx/libs/ssl/threading_alt.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#define WIN32_LEAN_AND_MEAN
#include <windows.h>

typedef struct {
CRITICAL_SECTION cs;
char is_valid;
} mbedtls_threading_mutex_t;
} mbedtls_threading_mutex_t;

0 comments on commit 2e27e61

Please sign in to comment.