[PATCH] D49927: [libc++] Exclude posix_l/strtonum fallback inclusion for newlib > 2.4

Jordan Rupprecht via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 27 12:06:19 PDT 2018


rupprecht created this revision.
rupprecht added reviewers: ldionne, rsmith.
Herald added a reviewer: EricWF.
Herald added subscribers: cfe-commits, christof.

[libc++] Exclude posix_l/strtonum fallback inclusion for newlib > 2.4

r338122 changed the linkage of some methods which revealed an existing ODR violation, e.g.:
projects/libcxx/include/support/xlocale/__posix_l_fallback.h:83:38: error: 'internal_linkage' attribute does not appear on the first declaration of 'iswcntrl_l'
inline _LIBCPP_INLINE_VISIBILITY int iswcntrl_l(wint_t c, locale_t) {

  ^

lib/include/wctype.h:55:12: note: previous definition is here
extern int      iswcntrl_l (wint_t, locale_t);

These were added to newlib in 2.4 [1] [2], so move them to the already existing include guard.

[1] https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;a=commit;h=238455adfab4f8070ac65400aac22bb8a9e502fc
[2] https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;a=commit;h=8493c1631643fada62384768408852bc0fa6ff44


Repository:
  rCXX libc++

https://reviews.llvm.org/D49927

Files:
  include/support/newlib/xlocale.h


Index: include/support/newlib/xlocale.h
===================================================================
--- include/support/newlib/xlocale.h
+++ include/support/newlib/xlocale.h
@@ -19,9 +19,9 @@
 #if !defined(__NEWLIB__) || __NEWLIB__ < 2 || \
     __NEWLIB__ == 2 && __NEWLIB_MINOR__ < 5
 #include <support/xlocale/__nop_locale_mgmt.h>
-#endif
 #include <support/xlocale/__posix_l_fallback.h>
 #include <support/xlocale/__strtonum_fallback.h>
+#endif
 
 #endif // _NEWLIB_VERSION
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D49927.157734.patch
Type: text/x-patch
Size: 488 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180727/12e0a183/attachment.bin>


More information about the cfe-commits mailing list