API BREAKER: Replacing defines in irrTypes.h which are conflicting with c++ reserved identifier rules.
C++ has undefined behavior for identifiers starting with __ or with _ followed by an uppercase letter. We still have many more (in IrrCompileConfig.h and in all header-guards), will likely replace those later as well. As a workaround for users which might use irrlicht defines in their code, I've added the header irrLegacyDefines.h Including that allows to continue using old defines for a while - or make it easier to have code which compiles with old and new Irrlicht library versions. git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6251 dfc29bdd-3216-0410-991c-e03cc46cb475
This commit is contained in:
@@ -336,7 +336,7 @@ bool CFileSystem::changeArchivePassword(const path& filename,
|
||||
// We need to check for directory names with trailing slash and without
|
||||
const path absPath = getAbsolutePath(filename);
|
||||
const path arcPath = FileArchives[idx]->getFileList()->getPath();
|
||||
if ((absPath == arcPath) || ((absPath+_IRR_TEXT("/")) == arcPath))
|
||||
if ((absPath == arcPath) || ((absPath+IRR_TEXT("/")) == arcPath))
|
||||
{
|
||||
if (password.size())
|
||||
FileArchives[idx]->Password=password;
|
||||
@@ -585,7 +585,7 @@ bool CFileSystem::changeWorkingDirectoryTo(const io::path& newDirectory)
|
||||
{
|
||||
WorkingDirectory[FILESYSTEM_VIRTUAL] = newDirectory;
|
||||
// is this empty string constant really intended?
|
||||
flattenFilename(WorkingDirectory[FILESYSTEM_VIRTUAL], _IRR_TEXT(""));
|
||||
flattenFilename(WorkingDirectory[FILESYSTEM_VIRTUAL], IRR_TEXT(""));
|
||||
success = true;
|
||||
}
|
||||
else
|
||||
@@ -645,7 +645,7 @@ io::path CFileSystem::getAbsolutePath(const io::path& filename) const
|
||||
return io::path(fpath);
|
||||
}
|
||||
if (filename[filename.size()-1]=='/')
|
||||
return io::path(p)+_IRR_TEXT("/");
|
||||
return io::path(p)+IRR_TEXT("/");
|
||||
else
|
||||
return io::path(p);
|
||||
#else
|
||||
@@ -667,7 +667,7 @@ io::path CFileSystem::getFileDir(const io::path& filename) const
|
||||
if ((u32)lastSlash < filename.size())
|
||||
return filename.subString(0, lastSlash);
|
||||
else
|
||||
return _IRR_TEXT(".");
|
||||
return IRR_TEXT(".");
|
||||
}
|
||||
|
||||
|
||||
@@ -720,7 +720,7 @@ io::path& CFileSystem::flattenFilename(io::path& directory, const io::path& root
|
||||
{
|
||||
subdir = directory.subString(lastpos, pos - lastpos + 1);
|
||||
|
||||
if (subdir == _IRR_TEXT("../"))
|
||||
if (subdir == IRR_TEXT("../"))
|
||||
{
|
||||
if (lastWasRealDir)
|
||||
{
|
||||
@@ -733,11 +733,11 @@ io::path& CFileSystem::flattenFilename(io::path& directory, const io::path& root
|
||||
lastWasRealDir=false;
|
||||
}
|
||||
}
|
||||
else if (subdir == _IRR_TEXT("/"))
|
||||
else if (subdir == IRR_TEXT("/"))
|
||||
{
|
||||
dir = root;
|
||||
}
|
||||
else if (subdir != _IRR_TEXT("./"))
|
||||
else if (subdir != IRR_TEXT("./"))
|
||||
{
|
||||
dir.append(subdir);
|
||||
lastWasRealDir=true;
|
||||
@@ -760,8 +760,8 @@ path CFileSystem::getRelativeFilename(const path& filename, const path& director
|
||||
core::splitFilename(getAbsolutePath(filename), &path1, &file, &ext);
|
||||
io::path path2(getAbsolutePath(directory));
|
||||
core::list<io::path> list1, list2;
|
||||
path1.split(list1, _IRR_TEXT("/\\"), 2);
|
||||
path2.split(list2, _IRR_TEXT("/\\"), 2);
|
||||
path1.split(list1, IRR_TEXT("/\\"), 2);
|
||||
path2.split(list2, IRR_TEXT("/\\"), 2);
|
||||
u32 i=0;
|
||||
core::list<io::path>::ConstIterator it1,it2;
|
||||
it1=list1.begin();
|
||||
@@ -774,9 +774,9 @@ path CFileSystem::getRelativeFilename(const path& filename, const path& director
|
||||
prefix1 = *it1;
|
||||
if ( it2 != list2.end() )
|
||||
prefix2 = *it2;
|
||||
if ( prefix1.size() > 1 && prefix1[1] == _IRR_TEXT(':') )
|
||||
if ( prefix1.size() > 1 && prefix1[1] == IRR_TEXT(':') )
|
||||
partition1 = core::locale_lower(prefix1[0]);
|
||||
if ( prefix2.size() > 1 && prefix2[1] == _IRR_TEXT(':') )
|
||||
if ( prefix2.size() > 1 && prefix2[1] == IRR_TEXT(':') )
|
||||
partition2 = core::locale_lower(prefix2[0]);
|
||||
|
||||
// must have the same prefix or we can't resolve it to a relative filename
|
||||
@@ -798,18 +798,18 @@ path CFileSystem::getRelativeFilename(const path& filename, const path& director
|
||||
++it1;
|
||||
++it2;
|
||||
}
|
||||
path1=_IRR_TEXT("");
|
||||
path1=IRR_TEXT("");
|
||||
for (; i<list2.size(); ++i)
|
||||
path1 += _IRR_TEXT("../");
|
||||
path1 += IRR_TEXT("../");
|
||||
while (it1 != list1.end())
|
||||
{
|
||||
path1 += *it1++;
|
||||
path1 += _IRR_TEXT('/');
|
||||
path1 += IRR_TEXT('/');
|
||||
}
|
||||
path1 += file;
|
||||
if (ext.size())
|
||||
{
|
||||
path1 += _IRR_TEXT('.');
|
||||
path1 += IRR_TEXT('.');
|
||||
path1 += ext;
|
||||
}
|
||||
return path1;
|
||||
@@ -877,7 +877,7 @@ IFileList* CFileSystem::createFileList()
|
||||
|
||||
r = new CFileList(Path, false, false);
|
||||
|
||||
r->addItem(Path + _IRR_TEXT(".."), 0, 0, true, 0);
|
||||
r->addItem(Path + IRR_TEXT(".."), 0, 0, true, 0);
|
||||
|
||||
//! We use the POSIX compliant methods instead of scandir
|
||||
DIR* dirHandle=opendir(Path.c_str());
|
||||
@@ -924,10 +924,10 @@ IFileList* CFileSystem::createFileList()
|
||||
SFileListEntry e3;
|
||||
|
||||
//! PWD
|
||||
r->addItem(Path + _IRR_TEXT("."), 0, 0, true, 0);
|
||||
r->addItem(Path + IRR_TEXT("."), 0, 0, true, 0);
|
||||
|
||||
//! parent
|
||||
r->addItem(Path + _IRR_TEXT(".."), 0, 0, true, 0);
|
||||
r->addItem(Path + IRR_TEXT(".."), 0, 0, true, 0);
|
||||
|
||||
//! merge archives
|
||||
for (u32 i=0; i < FileArchives.size(); ++i)
|
||||
|
Reference in New Issue
Block a user