[libc-commits] [PATCH] D71094: [libc] Add implementation of errno and define the other macros of errno.h.

Siva Chandra via Phabricator via libc-commits libc-commits at lists.llvm.org
Fri Dec 6 00:45:33 PST 2019


sivachandra marked an inline comment as done.
sivachandra added inline comments.


================
Comment at: libc/src/errno/errno_location.cpp:14
+static thread_local int __errno = 0;
+int &llvmlibc_errno = __errno;
+
----------------
abrachet wrote:
> If we do end up keeping this reference we could also put it behind `namespace __llvm_libc` and call it something less verbose, perhaps.
I did consider `__llvm_libc::errno`. But, now since `errno` is a token by itself, it interferes with the public macro `errno` when used along with other libraries, and even gtest.
Your comment now points me to the fact that the name should actually be `__llvmlibc_errno` to avoid name pollution. If you have a suggestion for a shorter name within the namespace `__llvm_libc` which can be less verbose than `__llvmlibc_errno`, I will take it.

Will update in the next round.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D71094





More information about the libc-commits mailing list