Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(94)

Unified Diff: fusl/src/locale/duplocale.c

Issue 1573973002: Add a "fork" of musl as //fusl. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « fusl/src/locale/dcngettext.c ('k') | fusl/src/locale/freelocale.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fusl/src/locale/duplocale.c
diff --git a/fusl/src/locale/duplocale.c b/fusl/src/locale/duplocale.c
new file mode 100644
index 0000000000000000000000000000000000000000..030b64cb0e706cdf29c7104526e86b6ee08d7adb
--- /dev/null
+++ b/fusl/src/locale/duplocale.c
@@ -0,0 +1,15 @@
+#include <stdlib.h>
+#include <string.h>
+#include "locale_impl.h"
+#include "libc.h"
+
+locale_t __duplocale(locale_t old)
+{
+ locale_t new = malloc(sizeof *new);
+ if (!new) return 0;
+ if (old == LC_GLOBAL_LOCALE) old = &libc.global_locale;
+ *new = *old;
+ return new;
+}
+
+weak_alias(__duplocale, duplocale);
« no previous file with comments | « fusl/src/locale/dcngettext.c ('k') | fusl/src/locale/freelocale.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698