From 03da96f12fb4deb153cc0dc73936df346ecd4bcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Povi=C5=A1er?= Date: Tue, 23 Apr 2024 11:40:09 +0200 Subject: [PATCH] Patch for lack of `system` on WASM --- src/aig/gia/giaStoch.c | 4 ++++ src/base/abci/abc.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/aig/gia/giaStoch.c b/src/aig/gia/giaStoch.c index fc65c80bb..f7515e835 100644 --- a/src/aig/gia/giaStoch.c +++ b/src/aig/gia/giaStoch.c @@ -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 ); diff --git a/src/base/abci/abc.c b/src/base/abci/abc.c index d7e16576b..6d6530741 100644 --- a/src/base/abci/abc.c +++ b/src/base/abci/abc.c @@ -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; }