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:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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. */
|
||||
|
||||
Reference in New Issue
Block a user