On Thursday 30 April 2020 17:13:05 Liu Hao wrote: > 在 2020/4/30 16:43, Pali Rohár 写道: > > > > I think there is another problem: > > > > Function wcstof() which is in mingw-w64-headers/crt/stdlib.h should be > > marked as "inline". Otherwise there could be link problems... > > > > And after that above redefinition error should not be triggered as C99 > > allows you to have one inline and one non-inline definition of the same > > function. > > > > And I think after adding "inline" for function definition in header > > file, patch which Liu Hao posted should not be needed. > > > > See the macro definition in `_mingw_mac.h`. > > In the C case `__mingw_ovr` expands to `static inline` which is
Ou, I overlooked this one. > different from plain `inline`. > > And even in C99, you cannot have two function bodies in the same > translation unit. The following code provides two definitions but the > external one can't have a function body: > > ```c > // C99 only > > inline int xadd(int x, int y) // inline definition > { return x + y; } > > extern inline int xadd(int x, int y); // external definition > ``` Yea, so that guard via another #ifdef is really needed in this situation. Problem with inline is that it have different semantics in C99 standard, different in GNU C extension and different in MSVC pre-C99. So better is really to use inline only as "static inline". -- Pali Rohár pali.ro...@gmail.com _______________________________________________ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public