summaryrefslogtreecommitdiff
path: root/src/shared/util.h
diff options
context:
space:
mode:
authorCristian Rodríguez <crrodriguez@opensuse.org>2015-01-15 02:27:34 -0300
committerDavid Herrmann <dh.herrmann@gmail.com>2015-01-18 22:08:44 +0100
commit0193ad26ba121f3df259cc8b3bab54a99b8e5252 (patch)
treeb30bd4d5785661534b0db293c7e7ef89f0b4635b /src/shared/util.h
parent43fcd650e5cb0836cfc9f667ed74b3bc0283a81c (diff)
util: replace RUN_WITH_LOCALE with extended locale functions
There were two callers, one can use strtod_l() and the other strptime_l(). (David: fix up commit-msg and coding-style)
Diffstat (limited to 'src/shared/util.h')
-rw-r--r--src/shared/util.h26
1 files changed, 0 insertions, 26 deletions
diff --git a/src/shared/util.h b/src/shared/util.h
index fdb9fb6ef5..84453713ca 100644
--- a/src/shared/util.h
+++ b/src/shared/util.h
@@ -942,32 +942,6 @@ int unlink_noerrno(const char *path);
_r_; \
})
-struct _locale_struct_ {
- locale_t saved_locale;
- locale_t new_locale;
- bool quit;
-};
-
-static inline void _reset_locale_(struct _locale_struct_ *s) {
- PROTECT_ERRNO;
- if (s->saved_locale != (locale_t) 0)
- uselocale(s->saved_locale);
- if (s->new_locale != (locale_t) 0)
- freelocale(s->new_locale);
-}
-
-#define RUN_WITH_LOCALE(mask, loc) \
- for (_cleanup_(_reset_locale_) struct _locale_struct_ _saved_locale_ = { (locale_t) 0, (locale_t) 0, false }; \
- ({ \
- if (!_saved_locale_.quit) { \
- PROTECT_ERRNO; \
- _saved_locale_.new_locale = newlocale((mask), (loc), (locale_t) 0); \
- if (_saved_locale_.new_locale != (locale_t) 0) \
- _saved_locale_.saved_locale = uselocale(_saved_locale_.new_locale); \
- } \
- !_saved_locale_.quit; }) ; \
- _saved_locale_.quit = true)
-
bool id128_is_valid(const char *s) _pure_;
int split_pair(const char *s, const char *sep, char **l, char **r);