// (under Unix, configure tests for this)
 #ifndef HAVE_BOOL
     #if defined( __MWERKS__ )
-        #if (__MWERKS__ >= 0x1000) && !__option(bool)
+        #if (__MWERKS__ >= 0x1000) && __option(bool)
             #define HAVE_BOOL
         #endif
     #elif defined(__VISUALC__) && (__VISUALC__ == 1020)
 
     }
 
 private:
+#ifdef __MWERKS__
+    friend class wxSplitterWindow;
+#else
     friend wxSplitterWindow;
+#endif
 
     // data for the different types of event
     union
 
 // the accessors *must* be checked!
 class WXDLLEXPORT wxFileType
 {
+#ifdef __MWERKS__
+friend class wxMimeTypesManagerImpl;  // it has access to m_impl
+#else
 friend wxMimeTypesManagerImpl;  // it has access to m_impl
+#endif
 
 public:
     // An object of this class must be passed to Get{Open|Print}Command. The
 
 
 class WXDLLEXPORT wxTreeEvent : public wxNotifyEvent
 {
-friend wxTreeCtrl;
+#ifdef __MWERKS__
+    friend class wxTreeCtrl;
+#else
+    friend wxTreeCtrl;
+#endif
+
 public:
     wxTreeEvent(wxEventType commandType = wxEVT_NULL, int id = 0);
 
 
 
 #ifdef __WXMSW__
     #include <ansi_prefix.win32.h>
+    #include <ansi_parms.h>
+    #if defined( __MSL__ ) && __MSL__ >= 0x5012
+                       #define fileno  _fileno
+                       #define fdopen  _fdopen
+                       #define tell    _tell
+    #endif
 #elif defined( __WXMAC__)
     #include <ansi_prefix.mac.h>
 #endif
 
 #if !defined(wxStricmp) && !wxUSE_UNICODE
 #  if defined(__BORLANDC__) || defined(__WATCOMC__) || defined(__SALFORDC__) || defined(__VISAGECPP__) || defined(__EMX__)
 #    define wxStricmp stricmp
-#  elif defined(__SC__) || defined(__VISUALC__) || (defined(__MWERKS) && defined(__INTEL__))
+#  elif defined(__SC__) || defined(__VISUALC__) || (defined(__MWERKS__) && defined(__INTEL__))
 #    define wxStricmp _stricmp
 #  elif defined(__UNIX__) || defined(__GNUWIN32__)
 #    define wxStricmp strcasecmp
 
 #endif
 
 #if wxUSE_IOSTREAMH
-#if defined(__WXMSW__) && !defined(__GNUWIN32__)
+#if defined(__WXMSW__) && !defined(__GNUWIN32__) && !defined(__MWERKS__)
 #include <strstrea.h>
 #else
 #include <strstream.h>
 
 /////////////////////////////////////////////////////////////////////////////
 // Name:        paper.cpp
 // Purpose:     Paper size classes
-// Author:      Julian Smart
+// Author:      Julian Smart 
 // Modified by:
 // Created:     04/01/98
 // RCS-ID:      $Id$
 
 
 #include <stdio.h>
 #include <ctype.h>
+#ifndef __MWERKS__
 #include <sys/stat.h>
+#endif
 
 #ifndef __WINDOWS__
     #include   <unistd.h>
 
 
 #include <stdio.h>
 #include <ctype.h>
+#ifndef __MWERKS__
 #include <sys/stat.h>
+#endif
 
 #ifndef __WINDOWS__
 #   include   <unistd.h>
 
 
        case VT_BOOL:
                {
-#if defined(__WATCOMC__) || (defined(_MSC_VER) && (_MSC_VER <= 1000)) //GC
+#if defined(__WATCOMC__) || (defined(_MSC_VER) && (_MSC_VER <= 1000) && !defined(__MWERKS__) ) //GC
 #ifndef HAVE_BOOL // Can't use bool operator if no native bool type
                        variant = (long) (oleVariant.bool != 0);
 #else