From 0e216b4044f1cbbf30df4e378d51d91a0267e680 Mon Sep 17 00:00:00 2001 From: Nick Wellnhofer Date: Sat, 12 Mar 2016 11:13:14 +0100 Subject: Switch from "inline" to "CMARK_INLINE" Newer MSVC versions support enough of C99 to be able to compile cmark in plain C mode. Only the "inline" keyword is still unsupported. We have to use "__inline" instead. --- src/html.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/html.c') diff --git a/src/html.c b/src/html.c index 27e0586..753e5e2 100644 --- a/src/html.c +++ b/src/html.c @@ -17,7 +17,7 @@ static void escape_html(cmark_strbuf *dest, const unsigned char *source, houdini_escape_html0(dest, source, length, 0); } -static inline void cr(cmark_strbuf *html) { +static CMARK_INLINE void cr(cmark_strbuf *html) { if (html->size && html->ptr[html->size - 1] != '\n') cmark_strbuf_putc(html, '\n'); } -- cgit v1.2.3 From 6135e9b953747365358f7f2e23e53cc0e4a701b2 Mon Sep 17 00:00:00 2001 From: Nick Wellnhofer Date: Sat, 12 Mar 2016 11:29:55 +0100 Subject: Don't use variable length arrays They're not supported by MSVC. --- src/html.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/html.c') diff --git a/src/html.c b/src/html.c index 753e5e2..9ffa08a 100644 --- a/src/html.c +++ b/src/html.c @@ -10,6 +10,8 @@ #include "houdini.h" #include "scanners.h" +#define BUFFER_SIZE 100 + // Functions to convert cmark_nodes to HTML strings. static void escape_html(cmark_strbuf *dest, const unsigned char *source, @@ -29,7 +31,6 @@ struct render_state { static void S_render_sourcepos(cmark_node *node, cmark_strbuf *html, int options) { - const size_t BUFFER_SIZE = 100; char buffer[BUFFER_SIZE]; if (CMARK_OPT_SOURCEPOS & options) { snprintf(buffer, BUFFER_SIZE, " data-sourcepos=\"%d:%d-%d:%d\"", @@ -47,7 +48,6 @@ static int S_render_node(cmark_node *node, cmark_event_type ev_type, char start_heading[] = "