From eadbe0cb009b8c8fec622946f0b0109a2f07b1f1 Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Tue, 20 Feb 2007 18:25:03 +0000 Subject: Applied patch by trapdoor to fix the usage of a deprecated function on MacOS X 10.4 and later. --- src/log.cpp | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'src') 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 +#include #endif + #ifdef __APPLE__ #include #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 -- cgit v1.2.3-70-g09d2