2
0
mirror of https://github.com/boostorg/build.git synced 2026-02-16 01:12:13 +00:00

Refactored the Boost Build execnt.c module's maxline() function to cache its result instead of calling the GetVersionEx() Windows API on every call.

[SVN r78989]
This commit is contained in:
Jurko Gospodnetić
2012-06-18 23:12:33 +00:00
parent f4840e83a6
commit b6d2a40a3e

View File

@@ -599,7 +599,7 @@ static void free_argv( char const * * args )
* http://support.microsoft.com/default.aspx?scid=kb;en-us;830473
*/
int maxline()
static int raw_maxline()
{
OSVERSIONINFO os_info;
os_info.dwOSVersionInfoSize = sizeof( os_info );
@@ -610,6 +610,13 @@ int maxline()
return 996; /* NT 3.5.1 */
}
int maxline()
{
static result;
if ( !result ) result = raw_maxline();
return result;
}
/*
* Convert a command string into arguments as used by Unix spawnvp() API. The