[cfe-dev] clang, static/inline, and windows.h

David Chisnall theraven at sucs.org
Wed May 18 07:16:51 PDT 2011


On 18 May 2011, at 14:46, Andrew wrote:

> It seems that MSVC silently promotes any function declared __inline or
> __forceinline to static (or something equivalent/similar). My thinking
> is adding in a "compatibility" layer to clang so that when dealing
> with windows header files clang also promotes any function defined as
> inline to static storage. What does the list think? Is this a good
> idea? If it is, where would a good place to start in clang be to
> implement it? If it isn't a good idea, what would be?


It sounds like __inline is equivalent to static inline and __forceinline to __attribute__((always_inline)) in this case.  Perhaps the solution is to do do the same thing that we do for __block, and just define __inline and __forceinline as predefined macros when in MS mode?

David

-- Sent from my Apple II





More information about the cfe-dev mailing list