Skip to content

Commit

Permalink
Borland C++ Builder: Fixed compilation problems when compiling cppcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
danmar committed Aug 14, 2009
1 parent c8da301 commit e9f643f
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 35 deletions.
79 changes: 47 additions & 32 deletions cppcheck.cbproj
Expand Up @@ -18,46 +18,46 @@
<CfgParent>Base</CfgParent>
</PropertyGroup>
<PropertyGroup Condition="'$(Base)'!=''">
<BCC_OptimizeForSpeed>true</BCC_OptimizeForSpeed>
<OutputExt>exe</OutputExt>
<DCC_CBuilderOutput>JPHNE</DCC_CBuilderOutput>
<BCC_OptimizeForSpeed>true</BCC_OptimizeForSpeed>
<Defines>NO_STRICT</Defines>
<DCC_CBuilderOutput>JPHNE</DCC_CBuilderOutput>
<DynamicRTL>true</DynamicRTL>
<ILINK_SelectedWarnings>false</ILINK_SelectedWarnings>
<ILINK_AllWarnings>true</ILINK_AllWarnings>
<ILINK_ObjectSearchPath>C:\cppcheck;src</ILINK_ObjectSearchPath>
<ProjectType>CppConsoleApplication</ProjectType>
<ILINK_AllWarnings>true</ILINK_AllWarnings>
<NoVCL>true</NoVCL>
<FinalOutputDir>.\</FinalOutputDir>
<ProjectType>CppConsoleApplication</ProjectType>
<BCC_SelectedWarnings>false</BCC_SelectedWarnings>
<DCC_UNSAFE_CAST>true</DCC_UNSAFE_CAST>
<FinalOutputDir>.\</FinalOutputDir>
<PackageImports>vcl.bpi;rtl.bpi;bcbie.bpi;vclx.bpi;vclactnband.bpi;xmlrtl.bpi;bcbsmp.bpi;dbrtl.bpi;vcldb.bpi;vcldbx.bpi;bdertl.bpi;A407_R110.bpi;DreamEdit_C6.bpi</PackageImports>
<DCC_UNSAFE_CAST>true</DCC_UNSAFE_CAST>
<BCC_AllWarnings>true</BCC_AllWarnings>
<BCC_wpar>false</BCC_wpar>
<IncludePath>$(BDS)\include;$(BDS)\include\dinkumware;$(BDS)\include\vcl;C:\cppcheck;src</IncludePath>
<ILINK_LibraryPath>$(BDS)\lib;$(BDS)\lib\obj;$(BDS)\lib\psdk;C:\cppcheck;src</ILINK_LibraryPath>
<DCC_UNSAFE_CODE>true</DCC_UNSAFE_CODE>
<DCC_UNSAFE_TYPE>true</DCC_UNSAFE_TYPE>
<DCC_UNSAFE_CODE>true</DCC_UNSAFE_CODE>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_1)'!=''">
<BCC_OptimizeForSpeed>false</BCC_OptimizeForSpeed>
<DCC_Optimize>false</DCC_Optimize>
<DCC_DebugInfoInExe>true</DCC_DebugInfoInExe>
<BCC_OptimizeForSpeed>false</BCC_OptimizeForSpeed>
<Defines>_DEBUG;$(Defines)</Defines>
<DCC_DebugInfoInExe>true</DCC_DebugInfoInExe>
<ILINK_FullDebugInfo>true</ILINK_FullDebugInfo>
<BCC_InlineFunctionExpansion>false</BCC_InlineFunctionExpansion>
<ILINK_DisableIncrementalLinking>true</ILINK_DisableIncrementalLinking>
<BCC_UseRegisterVariables>None</BCC_UseRegisterVariables>
<DCC_Define>DEBUG</DCC_Define>
<BCC_DebugLineNumbers>true</BCC_DebugLineNumbers>
<BCC_SelectedWarnings>false</BCC_SelectedWarnings>
<FinalOutputDir>.\</FinalOutputDir>
<BCC_SelectedWarnings>false</BCC_SelectedWarnings>
<IntermediateOutputDir>bcb_Debug</IntermediateOutputDir>
<BCC_AllWarnings>true</BCC_AllWarnings>
<TASM_DisplaySourceLines>true</TASM_DisplaySourceLines>
<BCC_StackFrames>true</BCC_StackFrames>
<BCC_DisableOptimizations>true</BCC_DisableOptimizations>
<ILINK_LibraryPath>$(BDS)\lib\debug;$(ILINK_LibraryPath)</ILINK_LibraryPath>
<BCC_DisableOptimizations>true</BCC_DisableOptimizations>
<TASM_Debugging>Full</TASM_Debugging>
<BCC_SourceDebuggingOn>true</BCC_SourceDebuggingOn>
</PropertyGroup>
Expand All @@ -77,65 +77,80 @@
</ProjectExtensions>
<Import Project="$(MSBuildBinPath)\Borland.Cpp.Targets" />
<ItemGroup>
<CppCompile Include="src\checkautovariables.cpp">
<DependentOn>src\checkautovariables.h</DependentOn>
<BuildOrder>0</BuildOrder>
</CppCompile>
<CppCompile Include="src\checkbufferoverrun.cpp">
<DependentOn>src\checkbufferoverrun.h</DependentOn>
<BuildOrder>0</BuildOrder>
<BuildOrder>1</BuildOrder>
</CppCompile>
<CppCompile Include="src\checkclass.cpp">
<DependentOn>src\checkclass.h</DependentOn>
<BuildOrder>1</BuildOrder>
<BuildOrder>2</BuildOrder>
</CppCompile>
<CppCompile Include="src\checkdangerousfunctions.cpp">
<DependentOn>src\checkdangerousfunctions.h</DependentOn>
<BuildOrder>15</BuildOrder>
</CppCompile>
<CppCompile Include="src\checkfunctionusage.cpp">
<DependentOn>src\checkfunctionusage.h</DependentOn>
<BuildOrder>2</BuildOrder>
<BuildOrder>3</BuildOrder>
</CppCompile>
<CppCompile Include="src\checkheaders.cpp">
<DependentOn>src\checkheaders.h</DependentOn>
<BuildOrder>3</BuildOrder>
<BuildOrder>4</BuildOrder>
</CppCompile>
<CppCompile Include="src\checkmemoryleak.cpp">
<DependentOn>src\checkmemoryleak.h</DependentOn>
<BuildOrder>4</BuildOrder>
<BuildOrder>5</BuildOrder>
</CppCompile>
<CppCompile Include="src\checkother.cpp">
<DependentOn>src\checkother.h</DependentOn>
<BuildOrder>5</BuildOrder>
</CppCompile>
<CppCompile Include="src\cppcheck.cpp">
<BuildOrder>6</BuildOrder>
</CppCompile>
<CppCompile Include="src\cppcheckexecutor.cpp">
<CppCompile Include="src\checkstl.cpp">
<DependentOn>src\checkstl.h</DependentOn>
<BuildOrder>7</BuildOrder>
</CppCompile>
<CppCompile Include="src\errormessage.cpp">
<DependentOn>src\errormessage.h</DependentOn>
<CppCompile Include="src\checkunusedfunctions.cpp">
<DependentOn>src\checkunusedfunctions.h</DependentOn>
<BuildOrder>8</BuildOrder>
</CppCompile>
<CppCompile Include="src\cppcheck.cpp">
<BuildOrder>9</BuildOrder>
</CppCompile>
<CppCompile Include="src\cppcheckexecutor.cpp">
<BuildOrder>10</BuildOrder>
</CppCompile>
<CppCompile Include="src\errorlogger.cpp">
<DependentOn>src\errorlogger.h</DependentOn>
<BuildOrder>11</BuildOrder>
</CppCompile>
<CppCompile Include="src\filelister.cpp">
<DependentOn>src\filelister.h</DependentOn>
<BuildOrder>9</BuildOrder>
<BuildOrder>12</BuildOrder>
</CppCompile>
<CppCompile Include="src\main.cpp">
<BuildOrder>10</BuildOrder>
<BuildOrder>13</BuildOrder>
</CppCompile>
<CppCompile Include="src\mathlib.cpp">
<DependentOn>src\mathlib.h</DependentOn>
<BuildOrder>14</BuildOrder>
</CppCompile>
<CppCompile Include="src\preprocessor.cpp">
<DependentOn>src\preprocessor.h</DependentOn>
<BuildOrder>11</BuildOrder>
<BuildOrder>15</BuildOrder>
</CppCompile>
<CppCompile Include="src\settings.cpp">
<BuildOrder>12</BuildOrder>
<BuildOrder>16</BuildOrder>
</CppCompile>
<CppCompile Include="src\threadexecutor.cpp">
<BuildOrder>17</BuildOrder>
</CppCompile>
<CppCompile Include="src\token.cpp">
<DependentOn>src\token.h</DependentOn>
<BuildOrder>13</BuildOrder>
<BuildOrder>18</BuildOrder>
</CppCompile>
<CppCompile Include="src\tokenize.cpp">
<DependentOn>src\tokenize.h</DependentOn>
<BuildOrder>14</BuildOrder>
<BuildOrder>19</BuildOrder>
</CppCompile>
<BuildConfiguration Include="Debug">
<Key>Cfg_1</Key>
Expand Down
17 changes: 14 additions & 3 deletions src/filelister.cpp
Expand Up @@ -30,8 +30,12 @@
#endif
#if defined(__BORLANDC__) || defined(_MSC_VER) || defined(__MINGW32__)
#include <windows.h>
#ifdef __BORLANDC__
#include <dir.h>
#else
#include <shlwapi.h>
#endif
#endif

std::string FileLister::simplifyPath(const char *originalPath)
{
Expand Down Expand Up @@ -198,9 +202,16 @@ static HANDLE MyFindFirstFile(std::string path, LPWIN32_FIND_DATA findData)

static BOOL MyIsDirectory(std::string path)
{
// See http://msdn.microsoft.com/en-us/library/bb773621(VS.85).aspx
BOOL res = PathIsDirectory(path.c_str());
return res;
#ifdef __BORLANDC__
struct ffblk ffblk;
int ret = findfirst(path.c_str(), &ffblk, FA_DIREC);
if (ret == 0)
findclose(&ffblk);
return !ret;
#else
// See http://msdn.microsoft.com/en-us/library/bb773621(VS.85).aspx
return PathIsDirectory(path.c_str());
#endif
}

static HANDLE MyFindFirstFile(std::string path, LPWIN32_FIND_DATA findData)
Expand Down

0 comments on commit e9f643f

Please sign in to comment.