在 2018年06月26日 18:35, Jacek Caban 写道: > I still need to run some test, but I it seems ready for review. > > The important change is __forceinline. We add extern to GCC macro, > because that matches closer intended behaviour. clang supports > __forceinline itself if -fms-extensions is used, so we should just leave > it to the compiler in that case (also __ptr32, __unaligned and __w64, so > I changed them as well while I was at it). Without -fms-extensions, > __always_inline__ is expected and as far as I can tell (and my testing > conforms that), it matches intended behaviour without additional attributes. > > Signed-off-by: Jacek Caban <[email protected]> > --- > mingw-w64-headers/crt/_mingw.h.in | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > >
In C99 mode `extern inline` and `inline` (with no `extern` on every declaration) behaves differently. The former will result in an external definition where a function definition is seen and results in multiple definitions if the function is defined multiple times in different translate units. The latter doesn't result in an external definitions at all, even in case of inline failure, where a call to the external function is emitted (this is the `__gnu_inline__` behavior). This has to be carefully tested with different optimizations levels in all of C89, C99 and C++. -- Best regards, LH_Mouse
signature.asc
Description: OpenPGP digital signature
------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________ Mingw-w64-public mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
