在 7/13/21 3:05 PM, Jonathan Marler 写道:
+# if ((__MINGW_GNUC_PREREQ(4, 3) || defined(__clang__)) &&
__STDC_VERSION__ >= 199901L)
+#  define __MSVC_INLINE extern inline
+# else

No this is not correct. MSVC `__inline` is the C++ `inline`, which is equivalent to `extern __inline__ __attribute__((__weak__))`.


                GNU    C99    C++
  plain [1]      G      N      G-
  static         L      L      L
  extern [1]     N      G      G-


  - GNU  = `__attribute__((__gnu_inline__)) inline`
  - C99  = C99 `inline`
  - C++  = C++ `inline` and MSVC `__inline` [3]

  * N    = no code generated, even when address taken
  * L    = local code, not visible elsewhere
  * G    = global code [2]
  * G-   = weak/linkonce global code


  [1] `inline void foo() { }` followed by `extern void foo();`
      is equivalent to `extern inline void foo() { }`.
  [2] Multiple copies of such code will cause a linker error.
  [3] Code is generated only in case of inline failure.





--
Best regards,
LIU Hao

Attachment: OpenPGP_signature
Description: OpenPGP digital signature

_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to