diff options
| author | fusion32 <marcopuzziello@gmail.com> | 2026-05-28 23:56:29 -0300 |
|---|---|---|
| committer | fusion32 <marcopuzziello@gmail.com> | 2026-05-28 23:56:29 -0300 |
| commit | e2ba7cd29617ae05087ad3d25c55a2eb8ce607a3 (patch) | |
| tree | 2a93ee38c7cc9c83b3b89b3f0f7cbb6fcb8e8b3c /src/script.cc | |
| parent | d1c4dce3be82aa7e50ddb5b43f15ecc00a16f985 (diff) | |
| download | game-e2ba7cd29617ae05087ad3d25c55a2eb8ce607a3.tar.gz game-e2ba7cd29617ae05087ad3d25c55a2eb8ce607a3.zip | |
fix issues and warnings when compiling with glibc < 2.32 (#57, #58)
This also fixes some inconsistencies such as mixing both strerror
and strerrordesc_np, and possible formatting issues.
Diffstat (limited to 'src/script.cc')
| -rw-r--r-- | src/script.cc | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/script.cc b/src/script.cc index 75eab55..4695acc 100644 --- a/src/script.cc +++ b/src/script.cc @@ -115,7 +115,7 @@ void TReadScriptFile::open(const char *FileName){ if(this->File[Depth] == NULL){ int ErrCode = errno; ::error("TReadScriptFile::open: Kann Datei %s nicht öffnen.\n", this->Filename[Depth]); - ::error("Fehler %d: %s.\n", ErrCode, strerror(ErrCode)); + ::error("Fehler %d: %s.\n", ErrCode, GetErrorDescription(ErrCode)); throw "Cannot open script-file"; } @@ -582,7 +582,7 @@ void TWriteScriptFile::open(const char *FileName){ if(this->File == NULL){ int ErrCode = errno; ::error("TWriteScriptFile: Kann Datei %s nicht anlegen.\n", FileName); - ::error("Fehler %d: %s.\n", ErrCode, strerror(ErrCode)); + ::error("Fehler %d: %s.\n", ErrCode, GetErrorDescription(ErrCode)); throw "Cannot create script-file"; } @@ -751,7 +751,7 @@ void TReadBinaryFile::close(void){ int ErrCode = errno; ::error("TReadBinaryFile::close: Fehler beim Schließen der Datei.\n"); ::error("# Datei: %s, Fehlercode: %d (%s)\n", - this->Filename, ErrCode, strerror(ErrCode)); + this->Filename, ErrCode, GetErrorDescription(ErrCode)); } this->File = NULL; } @@ -811,7 +811,7 @@ uint8 TReadBinaryFile::readByte(void){ int Position = this->getPosition(); ::error("TReadBinaryFile::readByte: Fehler beim Lesen eines Bytes\n"); ::error("# Datei: %s, Position: %d, Rückgabewert: %d, Fehlercode: %d (%s)\n", - this->Filename, Position, Result, ErrCode, strerror(ErrCode)); + this->Filename, Position, Result, ErrCode, GetErrorDescription(ErrCode)); // NOTE(fusion): Close file and make a backup, possibly for further inspection. if(fclose(this->File) != 0){ @@ -832,7 +832,7 @@ void TReadBinaryFile::readBytes(uint8 *Buffer, int Count){ int Position = this->getPosition(); ::error("TReadBinaryFile::readBytes: Fehler beim Lesen von %d Bytes\n", Count); ::error("# Datei: %s, Position %d, Rückgabewert: %d, Fehlercode: %d (%s)\n", - this->Filename, Position, Result, ErrCode, strerror(ErrCode)); + this->Filename, Position, Result, ErrCode, GetErrorDescription(ErrCode)); // NOTE(fusion): Close file and make a backup, possibly for further inspection. if(fclose(this->File) != 0){ @@ -885,7 +885,7 @@ void TWriteBinaryFile::open(const char *FileName){ if(this->File == NULL){ int ErrCode = errno; ::error("TWriteBinaryFile::open: Kann Datei %s nicht anlegen.\n", FileName); - ::error("Fehler %d: %s.\n", ErrCode, strerror(ErrCode)); + ::error("Fehler %d: %s.\n", ErrCode, GetErrorDescription(ErrCode)); snprintf(ErrorString, sizeof(ErrorString), "Cannot create file %s.", FileName); @@ -902,7 +902,7 @@ void TWriteBinaryFile::close(void){ int ErrCode = errno; ::error("TWriteBinaryFile::close: Fehler beim Schließen der Datei.\n"); ::error("# Datei: %s, Fehlercode: %d (%s)\n", - this->Filename, ErrCode, strerror(ErrCode)); + this->Filename, ErrCode, GetErrorDescription(ErrCode)); } this->File = NULL; } @@ -928,7 +928,7 @@ void TWriteBinaryFile::writeByte(uint8 Byte){ int ErrCode = errno; ::error("TWriteBinaryFile::writeByte: Fehler beim Schreiben eines Bytes\n"); ::error("# Datei: %s, Rückgabewert: %d, Fehlercode: %d (%s)\n", - this->Filename, Result, ErrCode, strerror(ErrCode)); + this->Filename, Result, ErrCode, GetErrorDescription(ErrCode)); // NOTE(fusion): Close file and make a backup, possibly for further inspection. if(fclose(this->File) != 0){ @@ -947,7 +947,7 @@ void TWriteBinaryFile::writeBytes(const uint8 *Buffer, int Count){ int ErrCode = errno; ::error("TWriteBinaryFile::writeBytes: Fehler beim Schreiben von %d Bytes\n", Count); ::error("# Datei: %s, Rückgabewert: %d, Fehlercode: %d (%s)\n", - this->Filename, Result, ErrCode, strerror(ErrCode)); + this->Filename, Result, ErrCode, GetErrorDescription(ErrCode)); // NOTE(fusion): Close file and make a backup, possibly for further inspection. if(fclose(this->File) != 0){ |
