Patch for lack of `system` on WASM

This commit is contained in:
Martin Povišer 2024-04-23 11:40:09 +02:00
parent b502f00222
commit 03da96f12f
2 changed files with 8 additions and 0 deletions

View File

@ -145,7 +145,11 @@ Gia_Man_t * Gia_StochProcessOne( Gia_Man_t * p, char * pScript, int Rand, int Ti
sprintf( FileName, "%06x.aig", Rand );
Gia_AigerWrite( p, FileName, 0, 0, 0 );
sprintf( Command, "./abc -q \"&read %s; %s; &write %s\"", FileName, pScript, FileName );
#if defined(__wasm)
if ( 1 )
#else
if ( system( (char *)Command ) )
#endif
{
fprintf( stderr, "The following command has returned non-zero exit status:\n" );
fprintf( stderr, "\"%s\"\n", (char *)Command );

View File

@ -7252,7 +7252,11 @@ int Abc_CommandRunSat( Abc_Frame_t * pAbc, int argc, char ** argv )
sprintf( pCommand, "kissat -q --seed=%d %s", i, pFileCnf );
else if ( fWalk )
sprintf( pCommand, "walk -s%d %s", i, pFileCnf );
#if defined(__wasm)
if (1) {
#else
if (system(pCommand) == -1) {
#endif
fprintf(stdout, "Command \"%s\" did not succeed.\n", pCommand);
return 0;
}