1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0022972: Eliminate macro definitions that has compiler-provided analogs (WNT and so on)

1) Macro definition WNT replaced by _WIN32 and _MSC_VER for platform and compiler detection accordingly.
2) Macro definition LIN replaced by __linux__ macro.
3) Macro definition DEB replaced by OCCT_DEBUG macro.
This commit is contained in:
akz
2015-09-15 17:46:43 +03:00
committed by kgv
parent 28a73c1fe7
commit 57c28b6122
180 changed files with 370 additions and 411 deletions

View File

@@ -54,7 +54,7 @@ static Standard_Integer RemoveExtraSeparator(TCollection_AsciiString& aString) {
Standard_Integer i, j, len ;
len = aString.Length() ;
#ifdef WNT
#ifdef _WIN32
// Case of network path, such as \\MACHINE\dir
for (i = j = 2 ; j <= len ; i++,j++) {
#else
@@ -75,7 +75,7 @@ static TCollection_AsciiString AbsolutePath(
const TCollection_AsciiString& aRelFilePath)
{
TCollection_AsciiString EmptyString = "" ;
#ifdef WNT
#ifdef _WIN32
if (aRelFilePath.Search(":") == 2 ||
(aRelFilePath.Search("\\") == 1 && aRelFilePath.Value(2) == '\\'))
#else
@@ -86,7 +86,7 @@ static TCollection_AsciiString AbsolutePath(
TCollection_AsciiString DirPath = aDirPath, RelFilePath = aRelFilePath ;
Standard_Integer i,len ;
#ifdef WNT
#ifdef _WIN32
if(DirPath.Search(":") != 2 &&
(DirPath.Search("\\") != 1 || DirPath.Value(2) != '\\'))
#else
@@ -94,7 +94,7 @@ static TCollection_AsciiString AbsolutePath(
#endif
return EmptyString ;
#ifdef WNT
#ifdef _WIN32
DirPath.ChangeAll('\\','/') ;
RelFilePath.ChangeAll('\\','/') ;
#endif
@@ -125,7 +125,7 @@ static TCollection_AsciiString GetDirFromFile(const TCollection_ExtendedString&
TCollection_AsciiString theCFile(aFileName);
TCollection_AsciiString theDirectory;
Standard_Integer i=theCFile.SearchFromEnd("/");
#ifdef WNT
#ifdef _WIN32
// if(i==-1) i=theCFile.SearchFromEnd("\\");
if(theCFile.SearchFromEnd("\\") > i)
i=theCFile.SearchFromEnd("\\");

View File

@@ -27,9 +27,9 @@
#include <Storage_Data.hxx>
#include <UTL.hxx>
#ifdef WNT
#ifdef _MSC_VER
# include <tchar.h>
#endif // WNT
#endif // _MSC_VER
//=======================================================================
//function : PCDM_ReferenceIterator
@@ -99,7 +99,7 @@ Handle(CDM_MetaData) PCDM_ReferenceIterator::MetaData(const Standard_Boolean ) c
TCollection_ExtendedString theFolder,theName;
TCollection_ExtendedString theFile=myReferences(myIterator).FileName();
TCollection_ExtendedString f(theFile);
#ifndef WNT
#ifndef _WIN32
Standard_Integer i= f.SearchFromEnd("/");
TCollection_ExtendedString n = f.Split(i);
@@ -136,7 +136,7 @@ Handle(CDM_MetaData) PCDM_ReferenceIterator::MetaData(const Standard_Boolean ) c
}
theFolder = dirRet;
theName = UTL::Name(p); theName+= UTL::Extension(p);
#endif // WNT
#endif // _WIN32
return CDM_MetaData::LookUp(theFolder,theName,theFile,theFile,UTL::IsReadOnly(theFile));
}