[Scummvm-cvs-logs] SF.net SVN: scummvm:[54317] scummvm/trunk/backends/platform/ds/arm9/source

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Thu Nov 18 14:13:48 CET 2010


Revision: 54317
          http://scummvm.svn.sourceforge.net/scummvm/?rev=54317&view=rev
Author:   fingolfin
Date:     2010-11-18 13:13:48 +0000 (Thu, 18 Nov 2010)

Log Message:
-----------
DS: Fix compilation despite use of 'forbidden' symbols

Modified Paths:
--------------
    scummvm/trunk/backends/platform/ds/arm9/source/cdaudio.cpp
    scummvm/trunk/backends/platform/ds/arm9/source/dsmain.cpp
    scummvm/trunk/backends/platform/ds/arm9/source/gbampsave.cpp
    scummvm/trunk/backends/platform/ds/arm9/source/gbampsave.h

Modified: scummvm/trunk/backends/platform/ds/arm9/source/cdaudio.cpp
===================================================================
--- scummvm/trunk/backends/platform/ds/arm9/source/cdaudio.cpp	2010-11-18 11:32:53 UTC (rev 54316)
+++ scummvm/trunk/backends/platform/ds/arm9/source/cdaudio.cpp	2010-11-18 13:13:48 UTC (rev 54317)
@@ -23,6 +23,9 @@
  *
  */
 
+// Disable symbol overrides for FILE as that is used in FLAC headers
+#define FORBIDDEN_SYMBOL_EXCEPTION_FILE
+
 #include "cdaudio.h"
 #include "backends/fs/ds/ds-fs.h"
 #include "common/config-manager.h"

Modified: scummvm/trunk/backends/platform/ds/arm9/source/dsmain.cpp
===================================================================
--- scummvm/trunk/backends/platform/ds/arm9/source/dsmain.cpp	2010-11-18 11:32:53 UTC (rev 54316)
+++ scummvm/trunk/backends/platform/ds/arm9/source/dsmain.cpp	2010-11-18 13:13:48 UTC (rev 54317)
@@ -71,8 +71,11 @@
 // - Try discworld?
 
 
+// Disable symbol overrides for FILE
+#define FORBIDDEN_SYMBOL_EXCEPTION_FILE
 
 
+
 #include <nds.h>
 #include <nds/registers_alt.h>
 #include <nds/arm9/exceptions.h>

Modified: scummvm/trunk/backends/platform/ds/arm9/source/gbampsave.cpp
===================================================================
--- scummvm/trunk/backends/platform/ds/arm9/source/gbampsave.cpp	2010-11-18 11:32:53 UTC (rev 54316)
+++ scummvm/trunk/backends/platform/ds/arm9/source/gbampsave.cpp	2010-11-18 13:13:48 UTC (rev 54317)
@@ -23,6 +23,9 @@
  *
  */
 
+// Disable symbol overrides for FILE
+#define FORBIDDEN_SYMBOL_EXCEPTION_FILE
+
 #include "gbampsave.h"
 #include "fat/gba_nds_fat.h"
 #include "backends/fs/ds/ds-fs.h"
@@ -43,47 +46,48 @@
 
 GBAMPSaveFile::~GBAMPSaveFile() {
 	flushSaveBuffer();
-	if (handle) DS::std_fclose(handle);
+	if (handle)
+		DS::std_fclose((FILE *)handle);
 //	consolePrintf("Closed file\n");
 }
 
 uint32 GBAMPSaveFile::read(void *buf, uint32 length) {
 	saveSize += length;
 //	consolePrintf("Read %d %d ", length, saveSize);
-	return DS::std_fread(buf, 1, length, handle);
+	return DS::std_fread(buf, 1, length, (FILE *)handle);
 }
 
 bool GBAMPSaveFile::eos() const {
-	return DS::std_feof(handle);
+	return DS::std_feof((FILE *)handle);
 }
 
 bool GBAMPSaveFile::skip(uint32 bytes) {
-	return DS::std_fseek(handle, bytes, SEEK_CUR) == 0;
+	return DS::std_fseek((FILE *)handle, bytes, SEEK_CUR) == 0;
 }
 
 void GBAMPSaveFile::flushSaveBuffer() {
 	if (bufferPos != 0) {
 //		consolePrintf("Flushing %d bytes from %x\n", bufferPos, buffer);
 		flushed += bufferPos;
-		DS::std_fwrite(buffer, 1, bufferPos, handle);
+		DS::std_fwrite(buffer, 1, bufferPos, (FILE *)handle);
 		bufferPos = 0;
 	}
 }
 
 int32 GBAMPSaveFile::pos() const {
-	return DS::std_ftell(handle);
+	return DS::std_ftell((FILE *)handle);
 }
 
 int32 GBAMPSaveFile::size() const {
 	int position = pos();
-	DS::std_fseek(handle, 0, SEEK_END);
-	int length = DS::std_ftell(handle);
-	DS::std_fseek(handle, position, SEEK_SET);
+	DS::std_fseek((FILE *)handle, 0, SEEK_END);
+	int length = DS::std_ftell((FILE *)handle);
+	DS::std_fseek((FILE *)handle, position, SEEK_SET);
 	return length;
 }
 
 bool GBAMPSaveFile::seek(int32 newPos, int whence) {
-	return DS::std_fseek(handle, newPos, whence) == 0;
+	return DS::std_fseek((FILE *)handle, newPos, whence) == 0;
 }
 
 

Modified: scummvm/trunk/backends/platform/ds/arm9/source/gbampsave.h
===================================================================
--- scummvm/trunk/backends/platform/ds/arm9/source/gbampsave.h	2010-11-18 11:32:53 UTC (rev 54316)
+++ scummvm/trunk/backends/platform/ds/arm9/source/gbampsave.h	2010-11-18 13:13:48 UTC (rev 54317)
@@ -28,12 +28,11 @@
 
 #include "common/system.h"
 #include "common/savefile.h"
-#include "backends/fs/ds/ds-fs.h"
 
 #define SAVE_BUFFER_SIZE 100000
 
 class GBAMPSaveFile : public Common::InSaveFile, public Common::OutSaveFile {
-	DS::fileHandle *handle;
+	void *handle;
 	char buffer[SAVE_BUFFER_SIZE];
 	int bufferPos;
 	int saveSize;


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list