[libcxx-commits] [PATCH] D122861: [libcxx] Add some missing xlocale wrapper functions for OpenBSD

Mark de Wever via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Apr 7 08:44:35 PDT 2022


Mordante added a comment.

In D122861#3434764 <https://reviews.llvm.org/D122861#3434764>, @brad wrote:

> In D122861#3433609 <https://reviews.llvm.org/D122861#3433609>, @Mordante wrote:
>
>> I wonder whether this only affects OpenBSD or other platforms as well. If it also affects other platforms should these functions be here or in `_support/xlocale/__strtonum_fallback.h`?
>
> I was wondering about that as well, but thought I should keep this specific to OpenBSD for now to reduce the likelihood of something breaking and can be expanded later if desired.

Fair point.



================
Comment at: libcxx/include/__support/openbsd/xlocale.h:24
+
+static inline long strtol_l(const char *nptr, char **endptr, int base,
+                            locale_t) {
----------------
brad wrote:
> Mordante wrote:
> > Why the `static inline` instead of `inline`?
> > Please add `_LIBCPP_HIDE_FROM_ABI`.
> > Why the `static inline` instead of `inline`?
> > Please add `_LIBCPP_HIDE_FROM_ABI`.
> 
> I copied bits from libcxx/include/__support/solaris/xlocale.h, but the same goes for libcxx/include/__support/ibm/xlocale.h and libcxx/include/__support/musl/xlocale.h.
> 
> I don't see _LIBCPP_HIDE_FROM_ABI used anywhere in that sub-dir.
This is used in `_support/xlocale/__strtonum_fallback.h`
```
inline _LIBCPP_INLINE_VISIBILITY long long                                      
strtoll_l(const char *nptr, char **endptr, int base, locale_t) {
  return ::strtoll(nptr, endptr, base);
}                                                                               
```
Note that `_LIBCPP_INLINE_VISIBILITY` is the deprecated name for `_LIBCPP_HIDE_FROM_ABI`

@ldionne Do you know why these locale headers use `static inline` instead of `inline LIBCPP_HIDE_FROM_ABI`?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D122861/new/

https://reviews.llvm.org/D122861



More information about the libcxx-commits mailing list