Skip to content

Commit 6d3ae09

Browse files
include windows.h instead of synchapi.h for win32
the win32 API uses some architecture-specific defines, but they're not defined by the MSVC compiler - they're defined directly in windows.h based on symbols defined by the MSVC compiler. rather than setting the architecture symbols ourselves, just import windows.h as a whole. this also needed to disable the short-name symbols in cmark-gfm.h, because there are some clashing symbols in win32 headers.
1 parent 97d1b5e commit 6d3ae09

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/include/cmark-gfm.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -807,7 +807,7 @@ const char *cmark_version_string(void);
807807
* John MacFarlane, Vicent Marti, Kārlis Gaņģis, Nick Wellnhofer.
808808
*/
809809

810-
#ifndef CMARK_NO_SHORT_NAMES
810+
#if !defined(CMARK_NO_SHORT_NAMES) && !defined(_WIN32)
811811
#define NODE_DOCUMENT CMARK_NODE_DOCUMENT
812812
#define NODE_BLOCK_QUOTE CMARK_NODE_BLOCK_QUOTE
813813
#define NODE_LIST CMARK_NODE_LIST

src/include/mutex.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ pthread_mutex_lock(&NAME##_lock);
3131
#elif defined(_WIN32) // building for windows
3232

3333
#define _WIN32_WINNT 0x0600
34-
#include <synchapi.h>
34+
#include <windows.h>
3535

3636
#define CMARK_DEFINE_ONCE(NAME) static INIT_ONCE NAME##_once = INIT_ONCE_STATIC_INIT;
3737

0 commit comments

Comments
 (0)