md4c

C Markdown parser. Fast. SAX-like interface. Compliant to CommonMark specification.
git clone https://noulin.net/git/md4c.git
Log | Files | Refs | README | LICENSE

commit f9e58913ce00cdd4cd4fb56c33fd2adf30d082f5
parent 7d20152c39dbf094a774bbf34a808bf689dd2b6a
Author: Martin Mitas <mity@morous.org>
Date:   Mon,  5 Dec 2016 20:54:37 +0100

Rename MD4C_USE_UNICODE to MD4C_USE_UTF8.

Diffstat:
MREADME.md | 2+-
Mmd4c/CMakeLists.txt | 2+-
Mmd4c/md4c.c | 4++--
3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/README.md b/README.md @@ -122,7 +122,7 @@ unchanged. The behavior of MD4C in the isolated situations where the encoding really matters is determined by preprocessor macros: - * If preprocessor macro `MD4C_USE_UNICODE` is defined, MD4C assumes UTF-8 + * If preprocessor macro `MD4C_USE_UTF8` is defined, MD4C assumes UTF-8 in the specific situations. * On Windows, if preprocessor macro `MD4C_USE_WIN_UNICODE` is defined, MD4C diff --git a/md4c/CMakeLists.txt b/md4c/CMakeLists.txt @@ -1,6 +1,6 @@ set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DDEBUG") -add_definitions(-DMD4C_USE_UNICODE) +add_definitions(-DMD4C_USE_UTF8) add_library(md4c STATIC md4c.c md4c.h) diff --git a/md4c/md4c.c b/md4c/md4c.c @@ -432,7 +432,7 @@ struct MD_UNICODE_FOLD_INFO_tag { }; -#if defined MD4C_USE_WIN_UNICODE || defined MD4C_USE_UNICODE +#if defined MD4C_USE_WIN_UNICODE || defined MD4C_USE_UTF8 static int md_is_unicode_whitespace__(int codepoint) { @@ -731,7 +731,7 @@ struct MD_UNICODE_FOLD_INFO_tag { { return md_decode_utf16le__(str+off, str_size-off, p_char_size); } -#elif defined MD4C_USE_UNICODE +#elif defined MD4C_USE_UTF8 #define IS_UTF8_LEAD1(byte) ((unsigned char)(byte) <= 0x7f) #define IS_UTF8_LEAD2(byte) (((unsigned char)(byte) & 0xe0) == 0xc0) #define IS_UTF8_LEAD3(byte) (((unsigned char)(byte) & 0xf0) == 0xe0)