Problem 2582

Summary: Compiling on windows system generate an error C2039: '_finite': is not a member of 'std'
Product: Geant4 Reporter: Thomas Frosio <thomas.frosio>
Component: configAssignee: Gabriele Cosmo <Gabriele.Cosmo>
Status: RESOLVED FIXED    
Severity: normal CC: Ben.Morgan
Priority: P4    
Version: other   
Hardware: PC   
OS: Windows   
Attachments: Proposed fix as implemented and tested

Description Thomas Frosio 2023-12-15 06:08:24 CET
When trying to compile on windows MSBuild version 17.8.3+195e7f5a3 for .NET Framework, the following error happens:

D:\MicrosoftVisualStudio\2022\Community\VC\Tools\MSVC\14.38.33130\include\xlocnum(1398,76): error C2039: '_finite': is
not a member of 'std' [D:\Libraries\GEANT4\geant4_build_windows\source\G4processes.vcxproj]

This issue is solved by changing the following:
1) In geant4/source/processes/hadronic/models/lend/src/nf_stringToDoubles.cc, replace line 13 by   #define isfinite isfinite instead of   #define isfinite _finite
2) In geant4/source/processes/hadronic/models/lend/include/nf_specialFunctions.h, replace line 14 by   #define isfinite isfinite instead of   #define isfinite _finite

The same might be necessary in geant4/examples/extended/electromagnetic/TestEm7/include/c2_function.hh line 48 but I did not test the compilation of this example.

Best regards,
Thomas
Comment 1 Thomas Frosio 2023-12-15 06:25:45 CET
I forgot to mention that the issue is encountered with the last G4 version 11.2.0
Comment 2 Gabriele Cosmo 2023-12-19 08:36:11 CET
Thanks for reporting the issue. A fix is now pushed in the development branch and will be available in the next patch release.
Comment 3 Ben Morgan 2024-01-14 17:33:13 CET
Created attachment 843 [details]
Proposed fix as implemented and tested

Proposed fix as implemented and tested, posted here to allow cross-reference from forum