From a3f1b934517805b6d6c92a8641b3b63a54e885ef Mon Sep 17 00:00:00 2001 From: Stephen L Arnold Date: Fri, 1 Dec 2023 11:50:13 -0800 Subject: [PATCH] fix: dev: address toolchain requirement changes in cmd.c * use more specific if check for windows includes Signed-off-by: Stephen L Arnold --- src/base/cmd/cmd.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/base/cmd/cmd.c b/src/base/cmd/cmd.c index 708fc3f5b6..5d9d5e8fba 100644 --- a/src/base/cmd/cmd.c +++ b/src/base/cmd/cmd.c @@ -9,7 +9,7 @@ Synopsis [Command file.] Author [Alan Mishchenko] - + Affiliation [UC Berkeley] Date [Ver. 1.0. Started - June 20, 2005.] @@ -18,11 +18,11 @@ ***********************************************************************/ -#ifdef WIN32 +#if defined(WIN32) && !defined(__MINGW32__) #include #else -#include #include +#include #endif #include "base/abc/abc.h" @@ -1836,7 +1836,7 @@ int CmdCommandScrGen( Abc_Frame_t * pAbc, int argc, char **argv ) #else -Vec_Ptr_t * CmdReturnFileNames( char * pDirStr ) +Vec_Ptr_t * CmdReturnFileNames( char * pDirStr ) { Vec_Ptr_t * vRes = Vec_PtrAlloc( 100 ); struct dirent **namelist; @@ -1848,7 +1848,7 @@ Vec_Ptr_t * CmdReturnFileNames( char * pDirStr ) for (int i = 0; i < num_files; i++) { char * pExt = strstr(namelist[i]->d_name, "."); if ( !pExt || !strcmp(pExt, ".") || !strcmp(pExt, "..") || !strcmp(pExt, ".s") || !strcmp(pExt, ".txt") ) - continue; + continue; Vec_PtrPush( vRes, Abc_UtilStrsav(namelist[i]->d_name) ); free(namelist[i]); } @@ -1864,7 +1864,7 @@ int CmdCommandScrGenLinux( Abc_Frame_t * pAbc, int argc, char **argv ) char * pDirStr = (char *)"."; char * pComStr = (char *)"ps"; char * pWriteStr = NULL; - char * pWriteExt = NULL; + char * pWriteExt = NULL; char Line[2000], * pName; int nFileNameMax; int fBatch = 0; @@ -1919,7 +1919,7 @@ int CmdCommandScrGenLinux( Abc_Frame_t * pAbc, int argc, char **argv ) } pWriteExt = argv[globalUtilOptind]; globalUtilOptind++; - break; + break; case 'b': fBatch ^= 1; break; @@ -1949,8 +1949,8 @@ int CmdCommandScrGenLinux( Abc_Frame_t * pAbc, int argc, char **argv ) int fAndSpace = pComStr[0] == '&'; fprintf( pFile, "# Script file produced by ABC on %s\n", Extra_TimeStamp() ); fprintf( pFile, "# Command line was: scrgen -F %s -D %s -C \"%s\"%s%s%s%s\n", - pFileStr, pDirStr, pComStr, - pWriteStr?" -W ":"", pWriteStr?pWriteStr:"", + pFileStr, pDirStr, pComStr, + pWriteStr?" -W ":"", pWriteStr?pWriteStr:"", pWriteExt?" -E ":"", pWriteExt?pWriteExt:"" ); Vec_PtrForEachEntry( char *, vNames, pName, k ) { char * pExt = strstr(pName, "."); @@ -1988,7 +1988,7 @@ int CmdCommandScrGenLinux( Abc_Frame_t * pAbc, int argc, char **argv ) fprintf( pAbc->Err, "\t-C str : the sequence of commands to run [default = \"ps\"]\n" ); fprintf( pAbc->Err, "\t-W str : the directory to write the resulting files [default = no writing]\n" ); fprintf( pAbc->Err, "\t-E str : the output files extension (with \".\") [default = the same as input files]\n" ); - fprintf( pAbc->Err, "\t-b : toggles adding batch mode support [default = %s]\n", fBatch? "yes": "no" ); + fprintf( pAbc->Err, "\t-b : toggles adding batch mode support [default = %s]\n", fBatch? "yes": "no" ); fprintf( pAbc->Err, "\t-h : print the command usage\n\n"); fprintf( pAbc->Err, "\tExample : scrgen -F test1.s -R a/in -C \"ps; st; ps\" -W a/out -E .blif\n" ); return 1; @@ -2541,7 +2541,7 @@ int CmdCommandCapo( Abc_Frame_t * pAbc, int argc, char **argv ) Synopsis [] Description [] - + SideEffects [] SeeAlso [] @@ -2568,7 +2568,7 @@ int CmdCommandStarter( Abc_Frame_t * pAbc, int argc, char ** argv ) } nCores = atoi(argv[globalUtilOptind]); globalUtilOptind++; - if ( nCores < 0 ) + if ( nCores < 0 ) goto usage; break; case 'C': @@ -2626,7 +2626,7 @@ int CmdCommandStarter( Abc_Frame_t * pAbc, int argc, char ** argv ) Synopsis [] Description [] - + SideEffects [] SeeAlso [] @@ -2654,7 +2654,7 @@ int CmdCommandAutoTuner( Abc_Frame_t * pAbc, int argc, char ** argv ) } nCores = atoi(argv[globalUtilOptind]); globalUtilOptind++; - if ( nCores < 0 ) + if ( nCores < 0 ) goto usage; break; case 'C': @@ -2775,7 +2775,7 @@ int CmdCommandVersion( Abc_Frame_t * pAbc, int argc, char **argv ) Synopsis [] Description [] - + SideEffects [] SeeAlso [] @@ -2800,7 +2800,7 @@ int CmdCommandSGen( Abc_Frame_t * pAbc, int argc, char ** argv ) } nParts = atoi(argv[globalUtilOptind]); globalUtilOptind++; - if ( nParts < 0 ) + if ( nParts < 0 ) goto usage; break; case 'I': @@ -2826,7 +2826,7 @@ int CmdCommandSGen( Abc_Frame_t * pAbc, int argc, char ** argv ) Abc_Print( -2, "There is no current network.\n" ); return 1; } - if ( !Abc_NtkIsStrash(Abc_FrameReadNtk(pAbc)) ) + if ( !Abc_NtkIsStrash(Abc_FrameReadNtk(pAbc)) ) { Abc_Print( -2, "The current network is not an AIG.\n" ); return 1;