summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2007-02-20 18:25:03 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2007-02-20 18:25:03 +0000
commiteadbe0cb009b8c8fec622946f0b0109a2f07b1f1 (patch)
treea45211dea0c69c4922dd5f741eb54f88159fa639
parent4bc3390e60e0632f03e0d1be55ad2cf53bcaf8c8 (diff)
downloadmana-eadbe0cb009b8c8fec622946f0b0109a2f07b1f1.tar.gz
mana-eadbe0cb009b8c8fec622946f0b0109a2f07b1f1.tar.bz2
mana-eadbe0cb009b8c8fec622946f0b0109a2f07b1f1.tar.xz
mana-eadbe0cb009b8c8fec622946f0b0109a2f07b1f1.zip
Applied patch by trapdoor to fix the usage of a deprecated function on MacOS X
10.4 and later.
-rw-r--r--ChangeLog7
-rw-r--r--src/log.cpp17
2 files changed, 18 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index f8ac27f3..7c30cc59 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,9 @@
-2007-02-17 Bjørn Lindeijer <bjorn@lindeijer.nl>
+2007-02-20 Bjørn Lindeijer <bjorn@lindeijer.nl>
+
+ * src/log.cpp: Applied patch by trapdoor to fix the usage of a
+ deprecated function on MacOS X 10.4 and later.
+
+2007-02-17 Bjørn Lindeijer <bjorn@lindeijer.nl>
* data/help/header.txt, NEWS, README: Updated release date.
* data/graphics/sprites/Makefile.am,
diff --git a/src/log.cpp b/src/log.cpp
index b7a0545a..0d54a368 100644
--- a/src/log.cpp
+++ b/src/log.cpp
@@ -20,11 +20,13 @@
*/
#include "log.h"
+
#ifdef WIN32
- #include "utils/wingettimeofday.h"
+#include "utils/wingettimeofday.h"
#else
- #include <sys/time.h>
+#include <sys/time.h>
#endif
+
#ifdef __APPLE__
#include <Carbon/Carbon.h>
#endif
@@ -101,9 +103,14 @@ void Logger::error(const std::string &error_text)
MessageBox(NULL, error_text.c_str(), "Error", MB_ICONERROR | MB_OK);
#elif defined __APPLE__
Str255 msg;
- c2pstrcpy(msg, error_text.c_str());
- StandardAlert(kAlertStopAlert, "\pError",
- (ConstStr255Param)msg, NULL, NULL);
+ CFStringRef error;
+ error = CFStringCreateWithCString(NULL,
+ error_text.c_str(),
+ kCFStringEncodingMacRoman);
+ CFStringGetPascalString(error, msg, 255, kCFStringEncodingMacRoman);
+ StandardAlert(kAlertStopAlert,
+ "\pError",
+ (ConstStr255Param) msg, NULL, NULL);
#else
std::cerr << "Error: " << error_text << std::endl;
#endif