[all-commits] [llvm/llvm-project] c56211: [libc] Make math-macros.h C++-friendly (#86206)

Roland McGrath via All-commits all-commits at lists.llvm.org
Thu Mar 21 15:11:52 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c56211b2430cf63ba3a469a4ae89cf2e829e9332
      https://github.com/llvm/llvm-project/commit/c56211b2430cf63ba3a469a4ae89cf2e829e9332
  Author: Roland McGrath <mcgrathr at google.com>
  Date:   2024-03-21 (Thu, 21 Mar 2024)

  Changed paths:
    M libc/include/llvm-libc-macros/math-macros.h

  Log Message:
  -----------
  [libc] Make math-macros.h C++-friendly (#86206)

The isfinite, isnan, and isinf "functions" are specified by C99..C23 to
be macros that act as type-generic functions. Defining them as their
__builtin_* counterparts works fine for this. However, in C++ the
identifiers need to be usable in different contexts, such as being
declared inside a C++ namespace. So define inline constexpr template
functions for them under `#ifdef __cplusplus`.



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