Import Geant4 11.0.0.beta source tree

This commit is contained in:
Gabriele Cosmo
2021-06-25 16:12:29 +02:00
parent c968e26a39
commit 6399a014b6
4200 changed files with 207479 additions and 237366 deletions
+45
View File
@@ -0,0 +1,45 @@
// Copyright (C) 2010, Guy Barrand. All rights reserved.
// See the file tools.license for terms.
#ifndef tools_put_env
#define tools_put_env
//WARNING : CYGWIN/gnu/std=c++11 : putenv, setenv not found.
#include "get_env"
#include "cstr"
namespace tools {
inline bool put_env(const std::string& a_env,const std::string& a_value){
std::string value = a_env+"="+a_value;
#ifdef TOOLS_MEM
if(::putenv(str_dup(value.c_str(),false))) return false;
#else
if(::putenv(str_dup(value.c_str()))) return false;
#endif
//check:
std::string s;
if(!get_env(a_env,s)) return false;
if(s!=a_value) return false;
return true;
}
inline bool rm_env(const std::string& a_env){
#ifdef _MSC_VER
std::string value = a_env+"=";
#ifdef TOOLS_MEM
if(::putenv(str_dup(value.c_str(),false))) return false;
#else
if(::putenv(str_dup(value.c_str()))) return false;
#endif
#else
::unsetenv(a_env.c_str());
#endif
return true;
}
}
#endif