[all-commits] [llvm/llvm-project] 91a875: [libc++] Skip including langinfo.h when unused (#2...

google-yfyang via All-commits all-commits at lists.llvm.org
Wed Sep 16 08:48:32 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 91a87531f26b989863517e07f0648733029c7cfe
      https://github.com/llvm/llvm-project/commit/91a87531f26b989863517e07f0648733029c7cfe
  Author: google-yfyang <yfyang at google.com>
  Date:   2026-09-16 (Wed, 16 Sep 2026)

  Changed paths:
    M libcxx/include/__locale_dir/support/linux.h

  Log Message:
  -----------
  [libc++] Skip including langinfo.h when unused (#223749)

A previous change unconditionally includes <langinfo.h>.
__get_locale_encoding() only uses langinfo when compiling shared
libraries, and hardcodes "UTF-8" on Android.

glibc's <langinfo.h> defines POSIX nl_item constants as raw numeric
preprocessor macros (#define ERA 46).
This causes Bionic's #define ERA 46 leaks into C++ translation units on
Android and fails the compilation with:

```
error: expected member name or ';' after declaration specifiers
   static constexpr typename ERA = random_value;
```



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list