[Scummvm-cvs-logs] SF.net SVN: scummvm:[46151] scummvm/trunk/common

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Thu Nov 26 11:59:47 CET 2009


Revision: 46151
          http://scummvm.svn.sourceforge.net/scummvm/?rev=46151&view=rev
Author:   thebluegr
Date:     2009-11-26 10:59:46 +0000 (Thu, 26 Nov 2009)

Log Message:
-----------
Renamed common/console.* to common/textconsole.* to fix compilation under MSVC again (broken with commit #46130). MSVC places all object files for each engine in the same folder (even if they're in subfolders), which resulted in clashing between gui/console.* and common/console.*. There's no easy way around this, other than turning the resulting MSVC files into a big mess, so a simple file rename is more feasible

Modified Paths:
--------------
    scummvm/trunk/common/debug.h
    scummvm/trunk/common/module.mk
    scummvm/trunk/common/util.h

Added Paths:
-----------
    scummvm/trunk/common/textconsole.cpp
    scummvm/trunk/common/textconsole.h

Removed Paths:
-------------
    scummvm/trunk/common/console.cpp
    scummvm/trunk/common/console.h

Deleted: scummvm/trunk/common/console.cpp
===================================================================
--- scummvm/trunk/common/console.cpp	2009-11-26 08:19:56 UTC (rev 46150)
+++ scummvm/trunk/common/console.cpp	2009-11-26 10:59:46 UTC (rev 46151)
@@ -1,144 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * $URL$
- * $Id$
- */
-
-#include "common/console.h"
-#include "common/system.h"
-
-namespace Common {
-
-static OutputFormatter s_errorOutputFormatter = 0;
-
-void setErrorOutputFormatter(OutputFormatter f) {
-	s_errorOutputFormatter = f;
-}
-
-static ErrorHandler s_errorHandler = 0;
-
-void setErrorHandler(ErrorHandler handler) {
-	s_errorHandler = handler;
-}
-
-
-}	// End of namespace Common
-
-
-#ifndef DISABLE_TEXT_CONSOLE
-
-void warning(const char *s, ...) {
-	char buf[STRINGBUFLEN];
-	va_list va;
-
-	va_start(va, s);
-	vsnprintf(buf, STRINGBUFLEN, s, va);
-	va_end(va);
-
-#if !defined (__SYMBIAN32__)
-	fputs("WARNING: ", stderr);
-	fputs(buf, stderr);
-	fputs("!\n", stderr);
-#endif
-
-#if defined( USE_WINDBG )
-	strcat(buf, "\n");
-#if defined( _WIN32_WCE )
-	TCHAR buf_unicode[1024];
-	MultiByteToWideChar(CP_ACP, 0, buf, strlen(buf) + 1, buf_unicode, sizeof(buf_unicode));
-	OutputDebugString(buf_unicode);
-#else
-	OutputDebugString(buf);
-#endif
-#endif
-}
-
-#endif
-
-void NORETURN error(const char *s, ...) {
-	char buf_input[STRINGBUFLEN];
-	char buf_output[STRINGBUFLEN];
-	va_list va;
-
-	// Generate the full error message
-	va_start(va, s);
-	vsnprintf(buf_input, STRINGBUFLEN, s, va);
-	va_end(va);
-
-
-	// Next, give the active engine (if any) a chance to augment the message
-	if (Common::s_errorOutputFormatter) {
-		(*Common::s_errorOutputFormatter)(buf_output, buf_input, STRINGBUFLEN);
-	} else {
-		strncpy(buf_output, buf_input, STRINGBUFLEN);
-	}
-
-	buf_output[STRINGBUFLEN-3] = '\0';
-	buf_output[STRINGBUFLEN-2] = '\0';
-	buf_output[STRINGBUFLEN-1] = '\0';
-	strcat(buf_output, "!\n");
-
-
-	// Print the error message to stderr
-	fputs(buf_output, stderr);
-
-	// If there is an error handler, invoke it now
-	if (Common::s_errorHandler)
-		(*Common::s_errorHandler)(buf_output);
-
-	// TODO: Add a OSystem::fatalError() method and invoke it here.
-	// The default implementation would just call OSystem::quit().
-
-#if defined( USE_WINDBG )
-#if defined( _WIN32_WCE )
-	TCHAR buf_output_unicode[1024];
-	MultiByteToWideChar(CP_ACP, 0, buf_output, strlen(buf_output) + 1, buf_output_unicode, sizeof(buf_output_unicode));
-	OutputDebugString(buf_output_unicode);
-#ifndef DEBUG
-	drawError(buf_output);
-#else
-	int cmon_break_into_the_debugger_if_you_please = *(int *)(buf_output + 1);	// bus error
-	printf("%d", cmon_break_into_the_debugger_if_you_please);			// don't optimize the int out
-#endif
-#else
-	OutputDebugString(buf_output);
-#endif
-#endif
-
-#ifdef PALMOS_MODE
-	extern void PalmFatalError(const char *err);
-	PalmFatalError(buf_output);
-#endif
-
-#ifdef __SYMBIAN32__
-	Symbian::FatalError(buf_output);
-#endif
-	// Finally exit. quit() will terminate the program if g_system is present
-	if (g_system)
-		g_system->quit();
-
-#if defined(SAMSUNGTV)
-	// FIXME
-	for (;;) {}
-#else
-	exit(1);
-#endif
-}

Deleted: scummvm/trunk/common/console.h
===================================================================
--- scummvm/trunk/common/console.h	2009-11-26 08:19:56 UTC (rev 46150)
+++ scummvm/trunk/common/console.h	2009-11-26 10:59:46 UTC (rev 46151)
@@ -1,89 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * $URL$
- * $Id$
- */
-
-#ifndef COMMON_CONSOLE_H
-#define COMMON_CONSOLE_H
-
-#include "common/scummsys.h"
-
-namespace Common {
-
-/**
- * An output formatter takes a source string and 'decorates' it with
- * extra information, storing the result in a destination buffer.
- * A typical use is to (optionally) enhance the output given by
- * the error() and debug() functions with extra information on
- * the state of the active engine.
- */
-typedef void (*OutputFormatter)(char *dst, const char *src, size_t dstSize);
-
-/**
- * Set the output formatter used by error().
- */
-void setErrorOutputFormatter(OutputFormatter f);
-
-
-/**
- * A callback which is invoked by error() just before aborting.
- * A typical example would be a function which shows a debug
- * console and displays the given message in it.
- */
-typedef void (*ErrorHandler)(const char *msg);
-
-/**
- * Set a callback that is invoked by error() after the error
- * message has been printed, but before the application is
- * terminated.
- * This can be used to e.g. show a debugger console.
- */
-void setErrorHandler(ErrorHandler handler);
-
-}	// End of namespace Common
-
-
-#if defined(__GNUC__)
-void error(const char *s, ...) GCC_PRINTF(1, 2) NORETURN;
-#else
-void NORETURN error(const char *s, ...);
-#endif
-
-#ifdef DISABLE_TEXT_CONSOLE
-
-inline int printf(const char *s, ...) { return 0; }
-
-inline void warning(const char *s, ...) {}
-
-#else
-
-/**
- * Print a warning message to the text console (stderr).
- * Automatically prepends the text "WARNING: " and appends
- * an exclamation mark and a newline.
- */
-void warning(const char *s, ...) GCC_PRINTF(1, 2);
-
-#endif
-
-
-#endif

Modified: scummvm/trunk/common/debug.h
===================================================================
--- scummvm/trunk/common/debug.h	2009-11-26 08:19:56 UTC (rev 46150)
+++ scummvm/trunk/common/debug.h	2009-11-26 10:59:46 UTC (rev 46151)
@@ -26,7 +26,7 @@
 #define COMMON_DEBUG_H
 
 #include "common/scummsys.h"
-#include "common/console.h"
+#include "common/textconsole.h"
 #include "common/list.h"
 #include "common/str.h"
 

Modified: scummvm/trunk/common/module.mk
===================================================================
--- scummvm/trunk/common/module.mk	2009-11-26 08:19:56 UTC (rev 46150)
+++ scummvm/trunk/common/module.mk	2009-11-26 10:59:46 UTC (rev 46151)
@@ -4,7 +4,7 @@
 	archive.o \
 	config-file.o \
 	config-manager.o \
-	console.o \
+	textconsole.o \
 	debug.o \
 	EventDispatcher.o \
 	EventRecorder.o \

Copied: scummvm/trunk/common/textconsole.cpp (from rev 46149, scummvm/trunk/common/console.cpp)
===================================================================
--- scummvm/trunk/common/textconsole.cpp	                        (rev 0)
+++ scummvm/trunk/common/textconsole.cpp	2009-11-26 10:59:46 UTC (rev 46151)
@@ -0,0 +1,144 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ */
+
+#include "common/textconsole.h"
+#include "common/system.h"
+
+namespace Common {
+
+static OutputFormatter s_errorOutputFormatter = 0;
+
+void setErrorOutputFormatter(OutputFormatter f) {
+	s_errorOutputFormatter = f;
+}
+
+static ErrorHandler s_errorHandler = 0;
+
+void setErrorHandler(ErrorHandler handler) {
+	s_errorHandler = handler;
+}
+
+
+}	// End of namespace Common
+
+
+#ifndef DISABLE_TEXT_CONSOLE
+
+void warning(const char *s, ...) {
+	char buf[STRINGBUFLEN];
+	va_list va;
+
+	va_start(va, s);
+	vsnprintf(buf, STRINGBUFLEN, s, va);
+	va_end(va);
+
+#if !defined (__SYMBIAN32__)
+	fputs("WARNING: ", stderr);
+	fputs(buf, stderr);
+	fputs("!\n", stderr);
+#endif
+
+#if defined( USE_WINDBG )
+	strcat(buf, "\n");
+#if defined( _WIN32_WCE )
+	TCHAR buf_unicode[1024];
+	MultiByteToWideChar(CP_ACP, 0, buf, strlen(buf) + 1, buf_unicode, sizeof(buf_unicode));
+	OutputDebugString(buf_unicode);
+#else
+	OutputDebugString(buf);
+#endif
+#endif
+}
+
+#endif
+
+void NORETURN error(const char *s, ...) {
+	char buf_input[STRINGBUFLEN];
+	char buf_output[STRINGBUFLEN];
+	va_list va;
+
+	// Generate the full error message
+	va_start(va, s);
+	vsnprintf(buf_input, STRINGBUFLEN, s, va);
+	va_end(va);
+
+
+	// Next, give the active engine (if any) a chance to augment the message
+	if (Common::s_errorOutputFormatter) {
+		(*Common::s_errorOutputFormatter)(buf_output, buf_input, STRINGBUFLEN);
+	} else {
+		strncpy(buf_output, buf_input, STRINGBUFLEN);
+	}
+
+	buf_output[STRINGBUFLEN-3] = '\0';
+	buf_output[STRINGBUFLEN-2] = '\0';
+	buf_output[STRINGBUFLEN-1] = '\0';
+	strcat(buf_output, "!\n");
+
+
+	// Print the error message to stderr
+	fputs(buf_output, stderr);
+
+	// If there is an error handler, invoke it now
+	if (Common::s_errorHandler)
+		(*Common::s_errorHandler)(buf_output);
+
+	// TODO: Add a OSystem::fatalError() method and invoke it here.
+	// The default implementation would just call OSystem::quit().
+
+#if defined( USE_WINDBG )
+#if defined( _WIN32_WCE )
+	TCHAR buf_output_unicode[1024];
+	MultiByteToWideChar(CP_ACP, 0, buf_output, strlen(buf_output) + 1, buf_output_unicode, sizeof(buf_output_unicode));
+	OutputDebugString(buf_output_unicode);
+#ifndef DEBUG
+	drawError(buf_output);
+#else
+	int cmon_break_into_the_debugger_if_you_please = *(int *)(buf_output + 1);	// bus error
+	printf("%d", cmon_break_into_the_debugger_if_you_please);			// don't optimize the int out
+#endif
+#else
+	OutputDebugString(buf_output);
+#endif
+#endif
+
+#ifdef PALMOS_MODE
+	extern void PalmFatalError(const char *err);
+	PalmFatalError(buf_output);
+#endif
+
+#ifdef __SYMBIAN32__
+	Symbian::FatalError(buf_output);
+#endif
+	// Finally exit. quit() will terminate the program if g_system is present
+	if (g_system)
+		g_system->quit();
+
+#if defined(SAMSUNGTV)
+	// FIXME
+	for (;;) {}
+#else
+	exit(1);
+#endif
+}

Copied: scummvm/trunk/common/textconsole.h (from rev 46149, scummvm/trunk/common/console.h)
===================================================================
--- scummvm/trunk/common/textconsole.h	                        (rev 0)
+++ scummvm/trunk/common/textconsole.h	2009-11-26 10:59:46 UTC (rev 46151)
@@ -0,0 +1,89 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ */
+
+#ifndef COMMON_CONSOLE_H
+#define COMMON_CONSOLE_H
+
+#include "common/scummsys.h"
+
+namespace Common {
+
+/**
+ * An output formatter takes a source string and 'decorates' it with
+ * extra information, storing the result in a destination buffer.
+ * A typical use is to (optionally) enhance the output given by
+ * the error() and debug() functions with extra information on
+ * the state of the active engine.
+ */
+typedef void (*OutputFormatter)(char *dst, const char *src, size_t dstSize);
+
+/**
+ * Set the output formatter used by error().
+ */
+void setErrorOutputFormatter(OutputFormatter f);
+
+
+/**
+ * A callback which is invoked by error() just before aborting.
+ * A typical example would be a function which shows a debug
+ * console and displays the given message in it.
+ */
+typedef void (*ErrorHandler)(const char *msg);
+
+/**
+ * Set a callback that is invoked by error() after the error
+ * message has been printed, but before the application is
+ * terminated.
+ * This can be used to e.g. show a debugger console.
+ */
+void setErrorHandler(ErrorHandler handler);
+
+}	// End of namespace Common
+
+
+#if defined(__GNUC__)
+void error(const char *s, ...) GCC_PRINTF(1, 2) NORETURN;
+#else
+void NORETURN error(const char *s, ...);
+#endif
+
+#ifdef DISABLE_TEXT_CONSOLE
+
+inline int printf(const char *s, ...) { return 0; }
+
+inline void warning(const char *s, ...) {}
+
+#else
+
+/**
+ * Print a warning message to the text console (stderr).
+ * Automatically prepends the text "WARNING: " and appends
+ * an exclamation mark and a newline.
+ */
+void warning(const char *s, ...) GCC_PRINTF(1, 2);
+
+#endif
+
+
+#endif

Modified: scummvm/trunk/common/util.h
===================================================================
--- scummvm/trunk/common/util.h	2009-11-26 08:19:56 UTC (rev 46150)
+++ scummvm/trunk/common/util.h	2009-11-26 10:59:46 UTC (rev 46151)
@@ -26,7 +26,7 @@
 #define COMMON_UTIL_H
 
 #include "common/scummsys.h"
-#include "common/console.h"
+#include "common/textconsole.h"
 #include "common/str.h"
 
 


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