Skip to content

Split afwrtsys.h

Ben Wagner requested to merge bungeman/freetype:fix_msvc_build into master

The header file afwrtsys.h has two distinct functions, to include the required writing system headers and also to generate code for each writing system. At each current use site only one or the other is used, with various macro trickery selecting one or the other. Split this header into afws_dec.h for the required writing system declarations and afws_itr.h for iterating over the writing systems to generate code.

The motivation for this change is that the Visual C++ compiler treats the standard include guard idiom like #pragma once "if no non-comment code or preprocessor directive comes before or after the standard form of the idiom". It appears to check this after macro expansion, so if WRITING_SYSTEM expands to empty the bottom of afwrtsys.h is empty and looks like the standard include guard idiom which is treated like #pragma once so subsequent inclusion of afwrtsys.h is elided.

Fixes: #1075 (closed)

Merge request reports