aboutsummaryrefslogtreecommitdiffstats
path: root/solc/main.cpp
diff options
context:
space:
mode:
authorChristopher Gilbert <christopher.john.gilbert@gmail.com>2016-08-30 19:29:37 +0800
committerChristopher Gilbert <christopher.john.gilbert@gmail.com>2016-08-30 19:29:37 +0800
commit1b9147d7db08a94dd00532bc611ac322c8ed3e57 (patch)
tree80b4c89b5c0b7aed52e994d43d6d471ed926fa72 /solc/main.cpp
parent29b8965b9541e75905bb688954649ee7b0b0fefc (diff)
downloaddexon-solidity-1b9147d7db08a94dd00532bc611ac322c8ed3e57.tar.gz
dexon-solidity-1b9147d7db08a94dd00532bc611ac322c8ed3e57.tar.zst
dexon-solidity-1b9147d7db08a94dd00532bc611ac322c8ed3e57.zip
Fixed a bug causing solc to crash on startup due to invalid environment settings for locale
Diffstat (limited to 'solc/main.cpp')
-rw-r--r--solc/main.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/solc/main.cpp b/solc/main.cpp
index eaada1c4..bc8bdc81 100644
--- a/solc/main.cpp
+++ b/solc/main.cpp
@@ -21,13 +21,24 @@
*/
#include "CommandLineInterface.h"
+#include <clocale>
#include <iostream>
#include <boost/exception/all.hpp>
using namespace std;
+void setEnv() {
+ std::setlocale(LC_ALL, "C");
+#if !defined(WIN32) && !defined(MAC_OSX) && !defined(__FreeBSD__) && !defined(__OpenBSD__)
+ if (!std::setlocale(LC_ALL, "")) {
+ setenv("LC_ALL", "C", 1);
+ }
+#endif
+}
+
int main(int argc, char** argv)
{
+ setEnv();
dev::solidity::CommandLineInterface cli;
if (!cli.parseArguments(argc, argv))
return 1;