[libc-commits] [libc] [libc] Initial support for 'locale.h' in the LLVM libc (PR #102689)

Petr Hosek via libc-commits libc-commits at lists.llvm.org
Sat Aug 10 22:34:59 PDT 2024


================
@@ -0,0 +1,49 @@
+//===-- Implementation of localeconv --------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "src/locale/localeconv.h"
+
+#include "src/__support/CPP/limits.h"
+#include "src/__support/common.h"
+#include "src/__support/macros/config.h"
+
+namespace LIBC_NAMESPACE_DECL {
+
+static char DOT_STRING[] = ".";
+static char EMPTY_STRING[] = "";
+
+static struct lconv POSIX_LCONV = {
----------------
petrhosek wrote:

These constants should be defined as `constexpr`.
```suggestion
static constexpr char DOT_STRING[] = ".";
static constexpr char EMPTY_STRING[] = "";

static constexpr struct lconv POSIX_LCONV = {
```

https://github.com/llvm/llvm-project/pull/102689


More information about the libc-commits mailing list