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
+38
View File
@@ -0,0 +1,38 @@
// Copyright (C) 2010, Guy Barrand. All rights reserved.
// See the file tools.license for terms.
#ifndef tools_snpf
#define tools_snpf
#include <cstdarg>
#include <cstdio>
namespace tools {
inline int vsnpf(char* a_s,size_t a_n,const char* a_fmt,va_list args){
#ifdef _MSC_VER
#if _MSC_VER < 1900
unsigned int old = _set_output_format(_TWO_DIGIT_EXPONENT);
int status = _vsnprintf(a_s,a_n,a_fmt,args);
_set_output_format(old);
return status;
#else
return _vsnprintf(a_s,a_n,a_fmt,args);
#endif
#else
return ::vsnprintf(a_s,a_n,a_fmt,args);
#endif
}
inline int snpf(char* a_s,size_t a_n,const char* a_fmt,...){
va_list args;
va_start(args,a_fmt);
int n = vsnpf(a_s,a_n,a_fmt,args);
va_end(args);
return n;
}
}
#endif