// Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "xml.h"
 #endif
 
 {
     if (str.IsEmpty()) return;
 #if wxUSE_UNICODE
-    const wxWX2MBbuf buf(str.mb_str(convFile ? *convFile : wxConvUTF8));
+    const wxWX2MBbuf buf(str.mb_str(
+#ifdef __MWERKS__
+    *(convFile ? convFile : &wxConvUTF8)
+#else
+    convFile ? *convFile : wxConvUTF8
+#endif
+    ));
     stream.Write((const char*)buf, strlen((const char*)buf));
 #else
     if ( convFile == NULL )