2
0
mirror of https://github.com/boostorg/build.git synced 2026-02-14 00:32:11 +00:00

Boost Jam code cleanup - better checking and error reporting related to the -j command-line option and the PARALLELISM built-in variable.

[SVN r79054]
This commit is contained in:
Jurko Gospodnetić
2012-06-24 11:44:13 +00:00
parent 4ee4244d6b
commit 041f665f19
2 changed files with 8 additions and 6 deletions

View File

@@ -302,9 +302,10 @@ int main( int argc, char * * argv, char * * arg_environ )
if ( ( s = getoptval( optv, 'j', 0 ) ) )
{
globs.jobs = atoi( s );
if ( !globs.jobs )
if ( globs.jobs < 1 || globs.jobs > MAXJOBS )
{
printf( "Invalid value for the '-j' option.\n" );
printf( "Invalid value for the '-j' option, valid values are 1 "
"through %d.\n", MAXJOBS );
exit( EXITBAD );
}
}
@@ -518,9 +519,10 @@ int main( int argc, char * * argv, char * * arg_environ )
if ( !list_empty( p ) )
{
int const j = atoi( object_str( list_front( p ) ) );
if ( j == -1 )
printf( "Invalid value of PARALLELISM: %s\n", object_str(
list_front( p ) ) );
if ( j < 1 || j > MAXJOBS )
printf( "Invalid value of PARALLELISM: %s. Valid values "
"are 1 through %d.\n", object_str( list_front( p ) ),
MAXJOBS );
else
globs.jobs = j;
}

View File

@@ -414,7 +414,7 @@
#define MAXSYM 1024 /* longest symbol in the environment */
#define MAXJPATH 1024 /* longest filename */
#define MAXJOBS 64 /* silently enforced -j limit */
#define MAXJOBS 64 /* internally enforced -j limit */
#define MAXARGC 32 /* words in $(JAMSHELL) */
/* Jam private definitions below. */