Fixed compilation error on POSIX

Former-commit-id: 92c425519f250d15f4fe71d2e08e987b965dac70
This commit is contained in:
Lynix 2013-10-19 18:28:05 +02:00
parent d97d4b62e4
commit cb007b48fd
4 changed files with 14 additions and 14 deletions

View File

@ -45,7 +45,7 @@ bool NzDirectoryImpl::NextResult()
else else
{ {
if (errno != ENOENT) if (errno != ENOENT)
NazaraError("Unable to get next result: " + NzGetLastSystemError()); NazaraError("Unable to get next result: " + NzError::GetLastSystemError());
return false; return false;
} }
@ -56,7 +56,7 @@ bool NzDirectoryImpl::Open(const NzString& dirPath)
m_handle = opendir(dirPath.GetConstBuffer()); m_handle = opendir(dirPath.GetConstBuffer());
if (!m_handle) if (!m_handle)
{ {
NazaraError("Unable to open directory: " + NzGetLastSystemError()); NazaraError("Unable to open directory: " + NzError::GetLastSystemError());
return false; return false;
} }
@ -87,7 +87,7 @@ NzString NzDirectoryImpl::GetCurrent()
if (getcwd(path, _PC_PATH_MAX)) if (getcwd(path, _PC_PATH_MAX))
currentPath = path; currentPath = path;
else else
NazaraError("Unable to get current directory: " + NzGetLastSystemError()); NazaraError("Unable to get current directory: " + NzError::GetLastSystemError());
delete[] path; delete[] path;

View File

@ -39,7 +39,7 @@ bool NzFileImpl::EndOfFile() const
void NzFileImpl::Flush() void NzFileImpl::Flush()
{ {
if (fsync(m_fileDescriptor) == -1) if (fsync(m_fileDescriptor) == -1)
NazaraError("Unable to flush file: " + NzGetLastSystemError()); NazaraError("Unable to flush file: " + NzError::GetLastSystemError());
} }
nzUInt64 NzFileImpl::GetCursorPos() const nzUInt64 NzFileImpl::GetCursorPos() const
@ -143,7 +143,7 @@ bool NzFileImpl::Copy(const NzString& sourcePath, const NzString& targetPath)
int fd1 = open64(sourcePath.GetConstBuffer(), O_RDONLY); int fd1 = open64(sourcePath.GetConstBuffer(), O_RDONLY);
if (fd1 == -1) if (fd1 == -1)
{ {
NazaraError("Fail to open input file (" + sourcePath + "): " + NzGetLastSystemError()); NazaraError("Fail to open input file (" + sourcePath + "): " + NzError::GetLastSystemError());
return false; return false;
} }
@ -151,7 +151,7 @@ bool NzFileImpl::Copy(const NzString& sourcePath, const NzString& targetPath)
int fd2 = open64(targetPath.GetConstBuffer(), O_WRONLY | O_TRUNC, permissions); int fd2 = open64(targetPath.GetConstBuffer(), O_WRONLY | O_TRUNC, permissions);
if (fd2 == -1) if (fd2 == -1)
{ {
NazaraError("Fail to open output file (" + targetPath + "): " + NzGetLastSystemError()); // TODO: more info ? NazaraError("Fail to open output file (" + targetPath + "): " + NzError::GetLastSystemError()); // TODO: more info ?
close(fd1); close(fd1);
return false; return false;
} }
@ -165,7 +165,7 @@ bool NzFileImpl::Copy(const NzString& sourcePath, const NzString& targetPath)
{ {
close(fd1); close(fd1);
close(fd2); close(fd2);
NazaraError("An error occured from copy : " + NzGetLastSystemError()); NazaraError("An error occured from copy : " + NzError::GetLastSystemError());
return false; return false;
} }
write(fd2,buffer,bytes); write(fd2,buffer,bytes);
@ -185,7 +185,7 @@ bool NzFileImpl::Delete(const NzString& filePath)
return true; return true;
else else
{ {
NazaraError("Failed to delete file (" + filePath + "): " + NzGetLastSystemError()); NazaraError("Failed to delete file (" + filePath + "): " + NzError::GetLastSystemError());
return false; return false;
} }
} }
@ -238,7 +238,7 @@ bool NzFileImpl::Rename(const NzString& sourcePath, const NzString& targetPath)
return true; return true;
else else
{ {
NazaraError("Unable to rename file: " + NzGetLastSystemError()); NazaraError("Unable to rename file: " + NzError::GetLastSystemError());
return false; return false;
} }
} }

View File

@ -12,7 +12,7 @@
NzSemaphoreImpl::NzSemaphoreImpl(unsigned int count) NzSemaphoreImpl::NzSemaphoreImpl(unsigned int count)
{ {
if(sem_init(&m_semaphore, 0, count) != 0) if(sem_init(&m_semaphore, 0, count) != 0)
NazaraError("Failed to create semaphore: " + NzGetLastSystemError()); NazaraError("Failed to create semaphore: " + NzError::GetLastSystemError());
} }
NzSemaphoreImpl::~NzSemaphoreImpl() NzSemaphoreImpl::~NzSemaphoreImpl()
@ -31,7 +31,7 @@ void NzSemaphoreImpl::Post()
{ {
#if NAZARA_CORE_SAFE #if NAZARA_CORE_SAFE
if (sem_post(&m_semaphore)==-1) if (sem_post(&m_semaphore)==-1)
NazaraError("Failed to release semaphore: " + NzGetLastSystemError()); NazaraError("Failed to release semaphore: " + NzError::GetLastSystemError());
#else #else
sem_post(&m_semaphore); sem_post(&m_semaphore);
#endif #endif
@ -41,7 +41,7 @@ void NzSemaphoreImpl::Wait()
{ {
#if NAZARA_CORE_SAFE #if NAZARA_CORE_SAFE
if (sem_wait(&m_semaphore) == -1 ) if (sem_wait(&m_semaphore) == -1 )
NazaraError("Failed to wait for semaphore: " + NzGetLastSystemError()); NazaraError("Failed to wait for semaphore: " + NzError::GetLastSystemError());
#else #else
sem_wait(&m_semaphore); sem_wait(&m_semaphore);
#endif #endif
@ -60,7 +60,7 @@ bool NzSemaphoreImpl::Wait(nzUInt32 timeout)
#if NAZARA_CORE_SAFE #if NAZARA_CORE_SAFE
if (sem_timedwait(&m_semaphore, &ti) != 0) if (sem_timedwait(&m_semaphore, &ti) != 0)
{ {
NazaraError("Failed to wait for semaphore: " + NzGetLastSystemError()); NazaraError("Failed to wait for semaphore: " + NzError::GetLastSystemError());
return false; return false;
} }

View File

@ -13,7 +13,7 @@ NzThreadImpl::NzThreadImpl(NzFunctor* functor)
{ {
int error = pthread_create(&m_handle, nullptr, &NzThreadImpl::ThreadProc, functor); int error = pthread_create(&m_handle, nullptr, &NzThreadImpl::ThreadProc, functor);
if (error != 0) if (error != 0)
NazaraInternalError("Failed to create thread: " + NzGetLastSystemError()); NazaraInternalError("Failed to create thread: " + NzError::GetLastSystemError());
} }
void NzThreadImpl::Detach() void NzThreadImpl::Detach()