summaryrefslogtreecommitdiff
path: root/src/Main.cxx
diff options
context:
space:
mode:
authorRosen Penev <rosenp@gmail.com>2020-03-26 19:32:31 -0700
committerRosen Penev <rosenp@gmail.com>2020-03-31 18:05:23 -0700
commit71e551df42fd8d63dccf788c8e17938b4bd96174 (patch)
treee50cbe1e76fa9a52b212cd8425354e742a777bb2 /src/Main.cxx
parent3540cf26b1b342f175255f2dc02e615483a1383c (diff)
replace locale.h with clocale
Switch to std:: functions. Changed the meson check. Works locally. Signed-off-by: Rosen Penev <rosenp@gmail.com>
Diffstat (limited to 'src/Main.cxx')
-rw-r--r--src/Main.cxx14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/Main.cxx b/src/Main.cxx
index b43fb14c8..bcba497ba 100644
--- a/src/Main.cxx
+++ b/src/Main.cxx
@@ -109,14 +109,12 @@
#include <systemd/sd-daemon.h>
#endif
-#include <stdlib.h>
+#include <climits>
-#ifdef HAVE_LOCALE_H
-#include <locale.h>
+#ifdef HAVE_CLOCALE
+#include <clocale>
#endif
-#include <climits>
-
static constexpr size_t KILOBYTE = 1024;
static constexpr size_t MEGABYTE = 1024 * KILOBYTE;
@@ -360,10 +358,10 @@ MainConfigured(const struct options &options, const ConfigData &raw_config)
#endif
#ifndef ANDROID
-#ifdef HAVE_LOCALE_H
+#ifdef HAVE_CLOCALE
/* initialize locale */
- setlocale(LC_CTYPE,"");
- setlocale(LC_COLLATE, "");
+ std::setlocale(LC_CTYPE,"");
+ std::setlocale(LC_COLLATE, "");
#endif
#endif