Force the locale LC_ALL to be POSIX (in Hurricane::DataBase).

* Problem: In LEF/DEF, the parsers makes use of the libc "strtod()" which
    is now localized. So, if your environment is set up for French, the
    decimal separator is not '.' (dot) but ',' (comma). So floating
    numbers in LEF/DEF file are not longer recognized as such, causing
    the parsers to fail with a LEFPARS-1 error.
      To avoid that, we force the LC_ALL environment variable to POSIX
    in Hurricane::DataBase::create(). So first things that happens when
    Hurricane starts, is the environment to be reset.
      Strangely, when I try to setup only LC_NUMERIC with setlocale()
    it doesn't work. There is something I'm missing there...
This commit is contained in:
Jean-Paul Chaput 2018-09-28 12:12:18 +02:00
parent 3c849787e2
commit dc01b60d5c
1 changed files with 3 additions and 0 deletions

View File

@ -17,6 +17,7 @@
// not, see <http://www.gnu.org/licenses/>.
// ****************************************************************************************************
#include <cstdlib>
#include "hurricane/Initializer.h"
#include "hurricane/Warning.h"
#include "hurricane/Error.h"
@ -127,6 +128,8 @@ DataBase::DataBase()
DataBase* DataBase::create()
// *************************
{
setenv( "LC_ALL", "POSIX", 1 );
DataBase* dataBase = new DataBase();
dataBase->_postCreate();