Skip to content

Commit

Permalink
[libc++][modules] Uses _LIBCPP_USING_IF_EXISTS. (llvm#90409)
Browse files Browse the repository at this point in the history
This attribute is used in the headers. Not using this in the modules has
led to several issues. Add them to the modules to avoid these errors in
other placed.
  • Loading branch information
mordante authored May 3, 2024
1 parent a06c1fe commit 6c4dedd
Show file tree
Hide file tree
Showing 33 changed files with 1,023 additions and 1,023 deletions.
28 changes: 14 additions & 14 deletions libcxx/modules/std.compat/cctype.inc
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@
//===----------------------------------------------------------------------===//

export {
using ::isalnum;
using ::isalpha;
using ::isblank;
using ::iscntrl;
using ::isdigit;
using ::isgraph;
using ::islower;
using ::isprint;
using ::ispunct;
using ::isspace;
using ::isupper;
using ::isxdigit;
using ::tolower;
using ::toupper;
using ::isalnum _LIBCPP_USING_IF_EXISTS;
using ::isalpha _LIBCPP_USING_IF_EXISTS;
using ::isblank _LIBCPP_USING_IF_EXISTS;
using ::iscntrl _LIBCPP_USING_IF_EXISTS;
using ::isdigit _LIBCPP_USING_IF_EXISTS;
using ::isgraph _LIBCPP_USING_IF_EXISTS;
using ::islower _LIBCPP_USING_IF_EXISTS;
using ::isprint _LIBCPP_USING_IF_EXISTS;
using ::ispunct _LIBCPP_USING_IF_EXISTS;
using ::isspace _LIBCPP_USING_IF_EXISTS;
using ::isupper _LIBCPP_USING_IF_EXISTS;
using ::isxdigit _LIBCPP_USING_IF_EXISTS;
using ::tolower _LIBCPP_USING_IF_EXISTS;
using ::toupper _LIBCPP_USING_IF_EXISTS;
} // export
26 changes: 13 additions & 13 deletions libcxx/modules/std.compat/cfenv.inc
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,21 @@

export {
// types
using ::fenv_t;
using ::fexcept_t;
using ::fenv_t _LIBCPP_USING_IF_EXISTS;
using ::fexcept_t _LIBCPP_USING_IF_EXISTS;

// functions
using ::feclearexcept;
using ::fegetexceptflag;
using ::feraiseexcept;
using ::fesetexceptflag;
using ::fetestexcept;
using ::feclearexcept _LIBCPP_USING_IF_EXISTS;
using ::fegetexceptflag _LIBCPP_USING_IF_EXISTS;
using ::feraiseexcept _LIBCPP_USING_IF_EXISTS;
using ::fesetexceptflag _LIBCPP_USING_IF_EXISTS;
using ::fetestexcept _LIBCPP_USING_IF_EXISTS;

using ::fegetround;
using ::fesetround;
using ::fegetround _LIBCPP_USING_IF_EXISTS;
using ::fesetround _LIBCPP_USING_IF_EXISTS;

using ::fegetenv;
using ::feholdexcept;
using ::fesetenv;
using ::feupdateenv;
using ::fegetenv _LIBCPP_USING_IF_EXISTS;
using ::feholdexcept _LIBCPP_USING_IF_EXISTS;
using ::fesetenv _LIBCPP_USING_IF_EXISTS;
using ::feupdateenv _LIBCPP_USING_IF_EXISTS;
} // export
14 changes: 7 additions & 7 deletions libcxx/modules/std.compat/cinttypes.inc
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
//===----------------------------------------------------------------------===//

export {
using ::imaxdiv_t;
using ::imaxdiv_t _LIBCPP_USING_IF_EXISTS;

using ::imaxabs;
using ::imaxdiv;
using ::strtoimax;
using ::strtoumax;
using ::wcstoimax;
using ::wcstoumax;
using ::imaxabs _LIBCPP_USING_IF_EXISTS;
using ::imaxdiv _LIBCPP_USING_IF_EXISTS;
using ::strtoimax _LIBCPP_USING_IF_EXISTS;
using ::strtoumax _LIBCPP_USING_IF_EXISTS;
using ::wcstoimax _LIBCPP_USING_IF_EXISTS;
using ::wcstoumax _LIBCPP_USING_IF_EXISTS;

// abs is conditionally here, but always present in cmath.cppm. To avoid
// conflicing declarations omit the using here.
Expand Down
6 changes: 3 additions & 3 deletions libcxx/modules/std.compat/clocale.inc
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@

export {
#ifndef _LIBCPP_HAS_NO_LOCALIZATION
using ::lconv;
using ::lconv _LIBCPP_USING_IF_EXISTS;

using ::localeconv;
using ::setlocale;
using ::localeconv _LIBCPP_USING_IF_EXISTS;
using ::setlocale _LIBCPP_USING_IF_EXISTS;
#endif // _LIBCPP_HAS_NO_LOCALIZATION
} // export
Loading

0 comments on commit 6c4dedd

Please sign in to comment.