modifications for compilation under Mac OS X
applied patches extracted from submission by Marc Newsam (tested under Mac OS 9) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@9372 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -76,6 +76,15 @@
|
||||
else
|
||||
return (void *)0;
|
||||
}
|
||||
#elif defined(__APPLE__) && defined(__UNIX__)
|
||||
char *dlopen(char *path, int mode /* mode is ignored */);
|
||||
void *dlsym(void *handle, char *symbol);
|
||||
int dlclose(void *handle);
|
||||
char *dlerror();
|
||||
|
||||
# define wxDllOpen(lib) dlopen(lib.fn_str(), 0)
|
||||
# define wxDllGetSymbol(handle, name) dlsym(handle, name)
|
||||
# define wxDllClose dlclose
|
||||
#elif defined(__WINDOWS__)
|
||||
// using LoadLibraryEx under Win32 to avoid name clash with LoadLibrary
|
||||
# ifdef __WIN32__
|
||||
@@ -221,7 +230,7 @@ wxDllLoader::LoadLibrary(const wxString & libname, bool *success)
|
||||
{
|
||||
wxDllType handle;
|
||||
|
||||
#if defined(__WXMAC__)
|
||||
#if defined(__WXMAC__) && !defined(__UNIX__)
|
||||
FSSpec myFSSpec ;
|
||||
Ptr myMainAddr ;
|
||||
Str255 myErrName ;
|
||||
@@ -294,13 +303,17 @@ wxDllLoader::GetSymbol(wxDllType dllHandle, const wxString &name)
|
||||
{
|
||||
void *symbol = NULL; // return value
|
||||
|
||||
#if defined( __WXMAC__ )
|
||||
#if defined(__WXMAC__) && !defined(__UNIX__)
|
||||
Ptr symAddress ;
|
||||
CFragSymbolClass symClass ;
|
||||
Str255 symName ;
|
||||
|
||||
strcpy( (char*) symName , name ) ;
|
||||
c2pstr( (char*) symName ) ;
|
||||
#if TARGET_CARBON
|
||||
c2pstrcpy( (StringPtr) symName , name ) ;
|
||||
#else
|
||||
strcpy( (char *) symName , name ) ;
|
||||
c2pstr( (char *) symName ) ;
|
||||
#endif
|
||||
|
||||
if ( FindSymbol( dllHandle , symName , &symAddress , &symClass ) == noErr )
|
||||
symbol = (void *)symAddress ;
|
||||
|
||||
@@ -114,11 +114,11 @@
|
||||
|
||||
extern wxChar *wxBuffer;
|
||||
|
||||
#ifdef __WXMAC__
|
||||
#include "morefile.h"
|
||||
#include "moreextr.h"
|
||||
#include "fullpath.h"
|
||||
#include "fspcompa.h"
|
||||
#if defined(__WXMAC__) && !defined(__UNIX__)
|
||||
#include "morefile.h"
|
||||
#include "moreextr.h"
|
||||
#include "fullpath.h"
|
||||
#include "fspcompa.h"
|
||||
#endif
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxPathList, wxStringList)
|
||||
@@ -817,7 +817,7 @@ wxString wxPathOnly (const wxString& path)
|
||||
// and back again - or we get nasty problems with delimiters.
|
||||
// Also, convert to lower case, since case is significant in UNIX.
|
||||
|
||||
#ifdef __WXMAC__
|
||||
#if defined(__WXMAC__) && !defined(__UNIX__)
|
||||
|
||||
static char sMacFileNameConversion[ 1000 ] ;
|
||||
|
||||
@@ -1058,7 +1058,7 @@ wxCopyFile (const wxString& file1, const wxString& file2)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
#ifndef __VISAGECPP__
|
||||
#if !defined(__VISAGECPP__) && !defined(__WXMAC__)
|
||||
// no chmod in VA. SHould be some permission API for HPFS386 partitions however
|
||||
if ( chmod(file2, fbuf.st_mode) != 0 )
|
||||
{
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
#include "wx/protocol/ftp.h"
|
||||
|
||||
#if defined(__WXMAC__)
|
||||
#include "/wx/mac/macsock.h"
|
||||
#include "wx/mac/macsock.h"
|
||||
#endif
|
||||
|
||||
#ifndef __MWERKS__
|
||||
|
||||
@@ -1398,12 +1398,16 @@ wxImage::wxImage( const wxBitmap &bitmap )
|
||||
|
||||
#ifdef __WXMAC__
|
||||
|
||||
#include <PictUtils.h>
|
||||
#ifdef __UNIX__
|
||||
#include <QD/PictUtils.h>
|
||||
#else
|
||||
#include <PictUtils.h>
|
||||
#endif
|
||||
|
||||
extern CTabHandle wxMacCreateColorTable( int numColors ) ;
|
||||
extern void wxMacDestroyColorTable( CTabHandle colors ) ;
|
||||
extern void wxMacSetColorTableEntry( CTabHandle newColors , int index , int red , int green , int blue ) ;
|
||||
extern GWorldPtr wxMacCreateGWorld( int height , int width , int depth ) ;
|
||||
extern GWorldPtr wxMacCreateGWorld( int width , int height , int depth ) ;
|
||||
extern void wxMacDestroyGWorld( GWorldPtr gw ) ;
|
||||
|
||||
wxBitmap wxImage::ConvertToBitmap() const
|
||||
|
||||
@@ -398,7 +398,7 @@ wxLogStderr::wxLogStderr(FILE *fp)
|
||||
m_fp = fp;
|
||||
}
|
||||
|
||||
#if defined(__WXMAC__)
|
||||
#if defined(__WXMAC__) && !defined(__UNIX__)
|
||||
#define kDebuggerSignature 'MWDB'
|
||||
|
||||
static Boolean FindProcessBySignature(OSType signature, ProcessInfoRec* info)
|
||||
@@ -494,7 +494,7 @@ void wxLogStderr::DoLogString(const wxChar *szString, time_t WXUNUSED(t))
|
||||
str += wxT("\r\n") ;
|
||||
OutputDebugString(str.c_str());
|
||||
#endif // MSW
|
||||
#if defined(__WXMAC__) && wxUSE_GUI
|
||||
#if defined(__WXMAC__) && !defined(__WXMAC_X__) && wxUSE_GUI
|
||||
Str255 pstr ;
|
||||
strcpy( (char*) pstr , str.c_str() ) ;
|
||||
strcat( (char*) pstr , ";g" ) ;
|
||||
@@ -525,7 +525,7 @@ void wxLogStderr::DoLogString(const wxChar *szString, time_t WXUNUSED(t))
|
||||
DebugStr(pstr);
|
||||
#endif
|
||||
}
|
||||
#endif // MSW
|
||||
#endif // Mac
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
@@ -42,7 +42,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxIPV4address, wxSockAddress)
|
||||
#ifdef ENABLE_IPV6
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxIPV6address, wxSockAddress)
|
||||
#endif
|
||||
#ifdef __UNIX__
|
||||
#if defined(__UNIX__) && !defined(__WXMAC_X__)
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxUNIXaddress, wxSockAddress)
|
||||
#endif
|
||||
|
||||
@@ -201,7 +201,7 @@ unsigned short wxIPV6address::Service()
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef __UNIX__
|
||||
#if defined(__UNIX__) && !defined(__WXMAC_X__)
|
||||
// ---------------------------------------------------------------------------
|
||||
// wxUNIXaddress
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
@@ -116,6 +116,8 @@ extern const wxChar WXDLLEXPORT *wxEmptyString = &g_strEmpty.dummy;
|
||||
#if defined(__VISUALC__) || (defined(__MINGW32__) && wxUSE_NORLANDER_HEADERS)
|
||||
#define wxVsnprintfA _vsnprintf
|
||||
#endif
|
||||
#elif defined(__WXMAC__)
|
||||
#define wxVsnprintfA vsnprintf
|
||||
#else // !Windows
|
||||
#ifdef HAVE_VSNPRINTF
|
||||
#define wxVsnprintfA vsnprintf
|
||||
@@ -130,9 +132,7 @@ extern const wxChar WXDLLEXPORT *wxEmptyString = &g_strEmpty.dummy;
|
||||
|
||||
#if defined(__VISUALC__)
|
||||
#pragma message("Using sprintf() because no snprintf()-like function defined")
|
||||
#elif defined(__GNUG__) && !defined(__UNIX__)
|
||||
#warning "Using sprintf() because no snprintf()-like function defined"
|
||||
#elif defined(__MWERKS__)
|
||||
#elif defined(__GNUG__)
|
||||
#warning "Using sprintf() because no snprintf()-like function defined"
|
||||
#endif //compiler
|
||||
#endif // no vsnprintf
|
||||
@@ -1410,7 +1410,7 @@ int wxString::PrintfV(const wxChar* pszFormat, va_list argptr)
|
||||
|
||||
// NB: wxVsnprintf() may return either less than the buffer size or -1 if
|
||||
// there is not enough place depending on implementation
|
||||
int iLen = wxVsnprintfA(szScratch, WXSIZEOF(szScratch), pszFormat, argptr);
|
||||
int iLen = wxVsnprintfA(szScratch, WXSIZEOF(szScratch), (char *)pszFormat, argptr);
|
||||
if ( iLen != -1 ) {
|
||||
// the whole string is in szScratch
|
||||
*this = szScratch;
|
||||
|
||||
@@ -44,6 +44,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxTime, wxObject)
|
||||
|
||||
wxTime::tFormat wxTime::ms_Format = wxTime::wx12h;
|
||||
wxTime::tPrecision wxTime::ms_Precision = wxTime::wxStdMinSec;
|
||||
wxChar wxTime::ms_bufTime[128];
|
||||
#endif
|
||||
|
||||
IMPLEMENT_ABSTRACT_CLASS(wxVariantData, wxObject)
|
||||
|
||||
@@ -33,6 +33,8 @@
|
||||
// the user (who can define wxUSE_ZLIB_H_IN_PATH), we hardcode the path here
|
||||
#if defined(__WXMSW__) && !defined(__WX_SETUP_H__) && !defined(wxUSE_ZLIB_H_IN_PATH)
|
||||
#include "../zlib/zlib.h"
|
||||
#elif defined(__WXMAC__) && defined(__UNIX__)
|
||||
#include <Zip/zlib.h>
|
||||
#else
|
||||
#include <zlib.h>
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user