summaryrefslogtreecommitdiff
path: root/lib/mlibc/options/posix/generic/posix_locale.cpp
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2024-03-07 17:28:00 -0500
committerIan Moffett <ian@osmora.org>2024-03-07 17:28:32 -0500
commitbd5969fc876a10b18613302db7087ef3c40f18e1 (patch)
tree7c2b8619afe902abf99570df2873fbdf40a4d1a1 /lib/mlibc/options/posix/generic/posix_locale.cpp
parenta95b38b1b92b172e6cc4e8e56a88a30cc65907b0 (diff)
lib: Add mlibc
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'lib/mlibc/options/posix/generic/posix_locale.cpp')
-rw-r--r--lib/mlibc/options/posix/generic/posix_locale.cpp37
1 files changed, 37 insertions, 0 deletions
diff --git a/lib/mlibc/options/posix/generic/posix_locale.cpp b/lib/mlibc/options/posix/generic/posix_locale.cpp
new file mode 100644
index 0000000..bd8710a
--- /dev/null
+++ b/lib/mlibc/options/posix/generic/posix_locale.cpp
@@ -0,0 +1,37 @@
+#include <bits/posix/posix_locale.h>
+#include <bits/ensure.h>
+#include <mlibc/debug.hpp>
+
+namespace {
+
+bool newlocale_seen = false;
+bool uselocale_seen = false;
+
+}
+
+locale_t newlocale(int, const char *, locale_t) {
+ // Due to all of the locale functions being stubs, the locale will not be used
+ if(!newlocale_seen) {
+ mlibc::infoLogger() << "mlibc: newlocale() is a no-op" << frg::endlog;
+ newlocale_seen = true;
+ }
+ return nullptr;
+}
+
+void freelocale(locale_t) {
+ mlibc::infoLogger() << "mlibc: freelocale() is a no-op" << frg::endlog;
+ return;
+}
+
+locale_t uselocale(locale_t) {
+ if(!uselocale_seen) {
+ mlibc::infoLogger() << "mlibc: uselocale() is a no-op" << frg::endlog;
+ uselocale_seen = true;
+ }
+ return nullptr;
+}
+
+locale_t duplocale(locale_t) {
+ mlibc::infoLogger() << "mlibc: duplocale() is a no-op" << frg::endlog;
+ return nullptr;
+}