Add support for WASI platform in Abc_ShowFile.

This commit is contained in:
whitequark 2020-04-30 17:12:36 +00:00 committed by Eddie Hung
parent 70ed4da2ac
commit 9366e4fa68
1 changed files with 8 additions and 0 deletions

View File

@ -363,7 +363,11 @@ void Abc_ShowFile( char * FileNameDot )
// generate the PostScript file using DOT
sprintf( CommandDot, "%s -Tps -o %s %s", pDotName, FileNamePs, FileNameDot );
#if defined(__wasm)
RetValue = -1;
#else
RetValue = system( CommandDot );
#endif
if ( RetValue == -1 )
{
fprintf( stdout, "Command \"%s\" did not succeed.\n", CommandDot );
@ -401,7 +405,11 @@ void Abc_ShowFile( char * FileNameDot )
char CommandPs[1000];
unlink( FileNameDot );
sprintf( CommandPs, "%s %s &", pGsNameUnix, FileNamePs );
#if defined(__wasm)
if ( 1 )
#else
if ( system( CommandPs ) == -1 )
#endif
{
fprintf( stdout, "Cannot execute \"%s\".\n", CommandPs );
return;