commonmark / cmark

CommonMark parsing and rendering library and program in C
Other
1.6k stars 527 forks source link

replace usage of `CMARK_INLINE` with `inline` #503

Closed compnerd closed 6 months ago

compnerd commented 6 months ago

Modern versions of MSVC (2015+) support most of the C99 standard, including the inline keyword. Avoid the vendor extension __inline and use the ISO standard spelling.

jgm commented 6 months ago

@kainjow @nwellnhof Does this change make sense to you? (cf. #76 for background)

nwellnhof commented 6 months ago

Yes, if you want to drop support for older MSVC compilers.

You can also remove the /TP flag hack here: https://github.com/commonmark/cmark/blob/master/CMakeLists.txt#L50

compnerd commented 6 months ago

@nwellnhof good point! I'll do a follow up to clean that up as well.

jgm commented 6 months ago

I don't know if there's any reason to support these old compilers. (But I don't know enough about the Windows world to answer that question.)

nwellnhof commented 6 months ago

You can find a history of C99/C11 support in Microsoft compilers in my Stackoverflow answer: https://stackoverflow.com/a/28118893/1956010

It's a judgment call but sooner or later this cruft should be removed. MSVC 14.0 (Visual Studio 2015) should be able to compile libcmark out of the box.

jgm commented 6 months ago

OK, let's do it sooner then!