about summary refs log tree commit diff
path: root/src/internal
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2018-10-20 21:54:20 -0400
committerRich Felker <dalias@aerifal.cx>2018-10-20 21:54:20 -0400
commitd88e5dfa8b989dafff4b748bfb3cba3512c8482e (patch)
tree55aed89246eda30168d6b60d86073a55f3b3f4e9 /src/internal
parent8084d6ab57cdb0b8f328d3cdbad3b9d09eaaee04 (diff)
downloadmusl-d88e5dfa8b989dafff4b748bfb3cba3512c8482e.tar.gz
musl-d88e5dfa8b989dafff4b748bfb3cba3512c8482e.tar.xz
musl-d88e5dfa8b989dafff4b748bfb3cba3512c8482e.zip
adapt setlocale to support possibility of failure
introduce a new LOC_MAP_FAILED sentinel for errors, since null
pointers for a category's locale map indicate the C locale. at this
time, __get_locale does not fail, so there should be no functional
change by this commit.
Diffstat (limited to 'src/internal')
-rw-r--r--src/internal/locale_impl.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/internal/locale_impl.h b/src/internal/locale_impl.h
index 0b5e00cf..741a71c4 100644
--- a/src/internal/locale_impl.h
+++ b/src/internal/locale_impl.h
@@ -27,6 +27,8 @@ hidden const char *__lctrans_impl(const char *, const struct __locale_map *);
 hidden int __loc_is_allocated(locale_t);
 hidden char *__gettextdomain(void);
 
+#define LOC_MAP_FAILED ((const struct __locale_map *)-1)
+
 #define LCTRANS(msg, lc, loc) __lctrans(msg, (loc)->cat[(lc)])
 #define LCTRANS_CUR(msg) __lctrans_cur(msg)