summaryrefslogtreecommitdiffstats
path: root/libcxx/include/support
diff options
context:
space:
mode:
authorHoward Hinnant <hhinnant@apple.com>2011-09-22 19:10:18 +0000
committerHoward Hinnant <hhinnant@apple.com>2011-09-22 19:10:18 +0000
commit3c78ca07bcfad4053c713cb96538594480fde3af (patch)
tree0bba5686be76fd18a86605bba7132575e5faea13 /libcxx/include/support
parentf9b785f1851ae7ee0d39b597637daaf966d356dc (diff)
downloadbcm5719-llvm-3c78ca07bcfad4053c713cb96538594480fde3af.tar.gz
bcm5719-llvm-3c78ca07bcfad4053c713cb96538594480fde3af.zip
Partial Windows port by Ruben Van Boxem
llvm-svn: 140328
Diffstat (limited to 'libcxx/include/support')
-rw-r--r--libcxx/include/support/win32/locale.h37
-rw-r--r--libcxx/include/support/win32/support.h15
2 files changed, 52 insertions, 0 deletions
diff --git a/libcxx/include/support/win32/locale.h b/libcxx/include/support/win32/locale.h
new file mode 100644
index 00000000000..c53b27a959c
--- /dev/null
+++ b/libcxx/include/support/win32/locale.h
@@ -0,0 +1,37 @@
+// -*- C++ -*-
+//===--------------------------- support/win32/locale.h --------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// Locale stuff
+// FIXME: the *_l functions are fairly new, only available on Vista?/7+
+#include <xlocinfo.h> //
+#define locale_t _locale_t
+#define strtoll_l _strtoi64_l
+#define strtoull_l _strtoui64_l
+// FIXME: current msvcrt does not know about long double
+#define strtold_l _strtod_l
+#define isdigit_l _isdigit_l
+#define isxdigit_l _isxdigit_l
+#define newlocale _create_locale
+#define freelocale _free_locale
+// FIXME: first call _configthreadlocale(_ENABLE_PER_THREAD_LOCALE) somewhere
+// FIXME: return types are different, need to make locale_t from char*
+inline locale_t uselocale(locale_t newloc)
+{
+ return newlocale( LC_ALL, setlocale(LC_ALL, newloc->locinfo->lc_category[LC_ALL].locale) );
+}
+
+#define LC_COLLATE_MASK _M_COLLATE
+#define LC_CTYPE_MASK _M_CTYPE
+#define LC_MONETARY_MASK _M_MONETARY
+#define LC_NUMERIC_MASK _M_NUMERIC
+#define LC_TIME_MASK _M_TIME
+#define LC_MESSAGES_MASK _M_MESSAGES
+
+enum { NL_SETD=0, NL_CAT_LOCALE=1 };
diff --git a/libcxx/include/support/win32/support.h b/libcxx/include/support/win32/support.h
new file mode 100644
index 00000000000..1a464bf7bfa
--- /dev/null
+++ b/libcxx/include/support/win32/support.h
@@ -0,0 +1,15 @@
+// -*- C++ -*-
+//===--------------------------- support/win32/support.h --------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+/*
+ Functions and constants used in libc++ that are missing from the Windows C library.
+ */
+
+int vasprintf( char **sptr, const char *__restrict__ fmt , va_list ap );
OpenPOWER on IntegriCloud