aboutsummaryrefslogtreecommitdiff
path: root/lib/mlibc/options/crypt
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/crypt
parenta95b38b1b92b172e6cc4e8e56a88a30cc65907b0 (diff)
lib: Add mlibc
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'lib/mlibc/options/crypt')
-rw-r--r--lib/mlibc/options/crypt/generic/crypt-stubs.cpp7
-rw-r--r--lib/mlibc/options/crypt/include/crypt.h18
-rw-r--r--lib/mlibc/options/crypt/meson.build13
3 files changed, 38 insertions, 0 deletions
diff --git a/lib/mlibc/options/crypt/generic/crypt-stubs.cpp b/lib/mlibc/options/crypt/generic/crypt-stubs.cpp
new file mode 100644
index 0000000..65e0d23
--- /dev/null
+++ b/lib/mlibc/options/crypt/generic/crypt-stubs.cpp
@@ -0,0 +1,7 @@
+#include <crypt.h>
+#include <bits/ensure.h>
+
+char *crypt(const char *, const char *) {
+ __ensure(!"Not implemented");
+ __builtin_unreachable();
+}
diff --git a/lib/mlibc/options/crypt/include/crypt.h b/lib/mlibc/options/crypt/include/crypt.h
new file mode 100644
index 0000000..bf3a512
--- /dev/null
+++ b/lib/mlibc/options/crypt/include/crypt.h
@@ -0,0 +1,18 @@
+#ifndef _CRYPT_H
+#define _CRYPT_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef __MLIBC_ABI_ONLY
+
+char *crypt(const char *, const char *);
+
+#endif /* !__MLIBC_ABI_ONLY */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // _CRYPT_H
diff --git a/lib/mlibc/options/crypt/meson.build b/lib/mlibc/options/crypt/meson.build
new file mode 100644
index 0000000..a476f34
--- /dev/null
+++ b/lib/mlibc/options/crypt/meson.build
@@ -0,0 +1,13 @@
+if disable_crypt_option
+ subdir_done()
+endif
+
+libc_sources += files(
+ 'generic/crypt-stubs.cpp',
+)
+
+if not no_headers
+ install_headers(
+ 'include/crypt.h',
+ )
+endif