WXMAKINGDLL --> WXMAKINGDLL_CORE and also fixed name of resources file
in multi-lib builds (so it doesn't look for "_core" in the name.) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23251 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -55,7 +55,7 @@
|
|||||||
|
|
||||||
#ifdef __DARWIN__
|
#ifdef __DARWIN__
|
||||||
# include <CoreServices/CoreServices.h>
|
# include <CoreServices/CoreServices.h>
|
||||||
# if defined(WXMAKINGDLL)
|
# if defined(WXMAKINGDLL_CORE)
|
||||||
# include <mach-o/dyld.h>
|
# include <mach-o/dyld.h>
|
||||||
# endif
|
# endif
|
||||||
#else
|
#else
|
||||||
@@ -470,7 +470,7 @@ DEFINE_ONE_SHOT_HANDLER_GETTER( wxAppEventHandler )
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(WXMAKINGDLL) && !defined(__DARWIN__)
|
#if defined(WXMAKINGDLL_CORE) && !defined(__DARWIN__)
|
||||||
// we know it's there ;-)
|
// we know it's there ;-)
|
||||||
WXIMPORT char std::__throws_bad_alloc ;
|
WXIMPORT char std::__throws_bad_alloc ;
|
||||||
#endif
|
#endif
|
||||||
@@ -485,7 +485,7 @@ bool wxApp::Initialize(int& argc, wxChar **argv)
|
|||||||
SetEventMask( everyEvent ) ;
|
SetEventMask( everyEvent ) ;
|
||||||
UMAShowWatchCursor() ;
|
UMAShowWatchCursor() ;
|
||||||
|
|
||||||
#if defined(WXMAKINGDLL) && defined(__DARWIN__)
|
#if defined(WXMAKINGDLL_CORE) && defined(__DARWIN__)
|
||||||
// open shared library resources from here since we don't have
|
// open shared library resources from here since we don't have
|
||||||
// __wxinitialize in Mach-O shared libraries
|
// __wxinitialize in Mach-O shared libraries
|
||||||
wxStAppResource::OpenSharedLibraryResource(NULL);
|
wxStAppResource::OpenSharedLibraryResource(NULL);
|
||||||
@@ -656,7 +656,7 @@ void wxApp::CleanUp()
|
|||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(WXMAKINGDLL) && defined(__DARWIN__)
|
#if defined(WXMAKINGDLL_CORE) && defined(__DARWIN__)
|
||||||
// close shared library resources from here since we don't have
|
// close shared library resources from here since we don't have
|
||||||
// __wxterminate in Mach-O shared libraries
|
// __wxterminate in Mach-O shared libraries
|
||||||
wxStAppResource::CloseSharedLibraryResource();
|
wxStAppResource::CloseSharedLibraryResource();
|
||||||
@@ -683,9 +683,9 @@ void wxApp::CleanUp()
|
|||||||
// need to be able to find it with NSLookupAndBindSymbol
|
// need to be able to find it with NSLookupAndBindSymbol
|
||||||
short gSharedLibraryResource = kResFileNotOpened ;
|
short gSharedLibraryResource = kResFileNotOpened ;
|
||||||
|
|
||||||
#if defined(WXMAKINGDLL) && defined(__DARWIN__)
|
#if defined(WXMAKINGDLL_CORE) && defined(__DARWIN__)
|
||||||
CFBundleRef gSharedLibraryBundle = NULL;
|
CFBundleRef gSharedLibraryBundle = NULL;
|
||||||
#endif /* WXMAKINGDLL && __DARWIN__ */
|
#endif /* WXMAKINGDLL_CORE && __DARWIN__ */
|
||||||
|
|
||||||
wxStAppResource::wxStAppResource()
|
wxStAppResource::wxStAppResource()
|
||||||
{
|
{
|
||||||
@@ -708,7 +708,7 @@ void wxStAppResource::OpenSharedLibraryResource(const void *initBlock)
|
|||||||
{
|
{
|
||||||
gSharedLibraryResource = kResFileNotOpened;
|
gSharedLibraryResource = kResFileNotOpened;
|
||||||
|
|
||||||
#ifdef WXMAKINGDLL
|
#ifdef WXMAKINGDLL_CORE
|
||||||
if ( initBlock != NULL ) {
|
if ( initBlock != NULL ) {
|
||||||
const CFragInitBlock *theInitBlock = (const CFragInitBlock *)initBlock;
|
const CFragInitBlock *theInitBlock = (const CFragInitBlock *)initBlock;
|
||||||
FSSpec *fileSpec = NULL;
|
FSSpec *fileSpec = NULL;
|
||||||
@@ -741,9 +741,8 @@ void wxStAppResource::OpenSharedLibraryResource(const void *initBlock)
|
|||||||
else {
|
else {
|
||||||
// wxWindows is a simple dynamic shared library
|
// wxWindows is a simple dynamic shared library
|
||||||
// load the resources from the data fork of a separate resource file
|
// load the resources from the data fork of a separate resource file
|
||||||
char *theResPath;
|
wxString theResPath;
|
||||||
char *theName;
|
wxString theName;
|
||||||
char *theExt;
|
|
||||||
FSRef theResRef;
|
FSRef theResRef;
|
||||||
OSErr theErr = noErr;
|
OSErr theErr = noErr;
|
||||||
|
|
||||||
@@ -763,27 +762,24 @@ void wxStAppResource::OpenSharedLibraryResource(const void *initBlock)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// allocate copy to replace .dylib.* extension with .rsrc
|
// allocate copy to replace .dylib.* extension with .rsrc
|
||||||
theResPath = strdup(theLibPath);
|
if (theLibPath != NULL) {
|
||||||
if (theResPath != NULL) {
|
theResPath = theLibPath;
|
||||||
theName = strrchr(theResPath, '/');
|
// replace '_core' with '' in case of multi-lib build
|
||||||
if (theName == NULL) {
|
theResPath.Replace(wxT("_core"), wxEmptyString);
|
||||||
// no directory elements in path
|
// replace ".dylib" shared library extension with ".rsrc"
|
||||||
theName = theResPath;
|
theResPath.Replace(wxT(".dylib"), wxT(".rsrc"));
|
||||||
}
|
// Find the begining of the filename
|
||||||
// find ".dylib" shared library extension
|
theName = theResPath.AfterLast('/');
|
||||||
theExt = strstr(theName, ".dylib");
|
|
||||||
// overwrite extension with ".rsrc"
|
|
||||||
strcpy(theExt, ".rsrc");
|
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
wxLogDebug( wxT("wxMac resources file name is '%s'"),
|
wxLogDebug( wxT("wxMac resources file name is '%s'"),
|
||||||
theResPath );
|
theResPath.mb_str() );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
theErr = FSPathMakeRef((UInt8 *) theResPath, &theResRef, false);
|
theErr = FSPathMakeRef((UInt8 *) theResPath.mb_str(), &theResRef, false);
|
||||||
if (theErr != noErr) {
|
if (theErr != noErr) {
|
||||||
// try in current directory (using name only)
|
// try in current directory (using name only)
|
||||||
theErr = FSPathMakeRef((UInt8 *) theName, &theResRef, false);
|
theErr = FSPathMakeRef((UInt8 *) theName.mb_str(), &theResRef, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
// open the resource file
|
// open the resource file
|
||||||
@@ -795,22 +791,20 @@ void wxStAppResource::OpenSharedLibraryResource(const void *initBlock)
|
|||||||
#ifdef __WXDEBUG__
|
#ifdef __WXDEBUG__
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
wxT("unable to open wxMac resource file '%s'\n"),
|
wxT("unable to open wxMac resource file '%s'\n"),
|
||||||
theResPath );
|
theResPath.mb_str() );
|
||||||
#endif // __WXDEBUG__
|
#endif // __WXDEBUG__
|
||||||
}
|
}
|
||||||
|
|
||||||
// free duplicated resource file path
|
|
||||||
free(theResPath);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* __DARWIN__ */
|
#endif /* __DARWIN__ */
|
||||||
}
|
}
|
||||||
#endif /* WXMAKINGDLL */
|
#endif /* WXMAKINGDLL_CORE */
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxStAppResource::CloseSharedLibraryResource()
|
void wxStAppResource::CloseSharedLibraryResource()
|
||||||
{
|
{
|
||||||
#ifdef WXMAKINGDLL
|
#ifdef WXMAKINGDLL_CORE
|
||||||
// Close the shared library resource file
|
// Close the shared library resource file
|
||||||
if (gSharedLibraryResource != kResFileNotOpened) {
|
if (gSharedLibraryResource != kResFileNotOpened) {
|
||||||
#ifdef __DARWIN__
|
#ifdef __DARWIN__
|
||||||
@@ -826,10 +820,10 @@ void wxStAppResource::CloseSharedLibraryResource()
|
|||||||
}
|
}
|
||||||
gSharedLibraryResource = kResFileNotOpened;
|
gSharedLibraryResource = kResFileNotOpened;
|
||||||
}
|
}
|
||||||
#endif /* WXMAKINGDLL */
|
#endif /* WXMAKINGDLL_CORE */
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(WXMAKINGDLL) && !defined(__DARWIN__)
|
#if defined(WXMAKINGDLL_CORE) && !defined(__DARWIN__)
|
||||||
|
|
||||||
// for shared libraries we have to manually get the correct resource
|
// for shared libraries we have to manually get the correct resource
|
||||||
// ref num upon initializing and releasing when terminating, therefore
|
// ref num upon initializing and releasing when terminating, therefore
|
||||||
@@ -853,7 +847,7 @@ pascal void __wxterminate(void)
|
|||||||
__terminate() ;
|
__terminate() ;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* WXMAKINGDLL && !__DARWIN__ */
|
#endif /* WXMAKINGDLL_CORE && !__DARWIN__ */
|
||||||
|
|
||||||
#if TARGET_CARBON
|
#if TARGET_CARBON
|
||||||
|
|
||||||
|
@@ -55,7 +55,7 @@
|
|||||||
|
|
||||||
#ifdef __DARWIN__
|
#ifdef __DARWIN__
|
||||||
# include <CoreServices/CoreServices.h>
|
# include <CoreServices/CoreServices.h>
|
||||||
# if defined(WXMAKINGDLL)
|
# if defined(WXMAKINGDLL_CORE)
|
||||||
# include <mach-o/dyld.h>
|
# include <mach-o/dyld.h>
|
||||||
# endif
|
# endif
|
||||||
#else
|
#else
|
||||||
@@ -470,7 +470,7 @@ DEFINE_ONE_SHOT_HANDLER_GETTER( wxAppEventHandler )
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(WXMAKINGDLL) && !defined(__DARWIN__)
|
#if defined(WXMAKINGDLL_CORE) && !defined(__DARWIN__)
|
||||||
// we know it's there ;-)
|
// we know it's there ;-)
|
||||||
WXIMPORT char std::__throws_bad_alloc ;
|
WXIMPORT char std::__throws_bad_alloc ;
|
||||||
#endif
|
#endif
|
||||||
@@ -485,7 +485,7 @@ bool wxApp::Initialize(int& argc, wxChar **argv)
|
|||||||
SetEventMask( everyEvent ) ;
|
SetEventMask( everyEvent ) ;
|
||||||
UMAShowWatchCursor() ;
|
UMAShowWatchCursor() ;
|
||||||
|
|
||||||
#if defined(WXMAKINGDLL) && defined(__DARWIN__)
|
#if defined(WXMAKINGDLL_CORE) && defined(__DARWIN__)
|
||||||
// open shared library resources from here since we don't have
|
// open shared library resources from here since we don't have
|
||||||
// __wxinitialize in Mach-O shared libraries
|
// __wxinitialize in Mach-O shared libraries
|
||||||
wxStAppResource::OpenSharedLibraryResource(NULL);
|
wxStAppResource::OpenSharedLibraryResource(NULL);
|
||||||
@@ -656,7 +656,7 @@ void wxApp::CleanUp()
|
|||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(WXMAKINGDLL) && defined(__DARWIN__)
|
#if defined(WXMAKINGDLL_CORE) && defined(__DARWIN__)
|
||||||
// close shared library resources from here since we don't have
|
// close shared library resources from here since we don't have
|
||||||
// __wxterminate in Mach-O shared libraries
|
// __wxterminate in Mach-O shared libraries
|
||||||
wxStAppResource::CloseSharedLibraryResource();
|
wxStAppResource::CloseSharedLibraryResource();
|
||||||
@@ -683,9 +683,9 @@ void wxApp::CleanUp()
|
|||||||
// need to be able to find it with NSLookupAndBindSymbol
|
// need to be able to find it with NSLookupAndBindSymbol
|
||||||
short gSharedLibraryResource = kResFileNotOpened ;
|
short gSharedLibraryResource = kResFileNotOpened ;
|
||||||
|
|
||||||
#if defined(WXMAKINGDLL) && defined(__DARWIN__)
|
#if defined(WXMAKINGDLL_CORE) && defined(__DARWIN__)
|
||||||
CFBundleRef gSharedLibraryBundle = NULL;
|
CFBundleRef gSharedLibraryBundle = NULL;
|
||||||
#endif /* WXMAKINGDLL && __DARWIN__ */
|
#endif /* WXMAKINGDLL_CORE && __DARWIN__ */
|
||||||
|
|
||||||
wxStAppResource::wxStAppResource()
|
wxStAppResource::wxStAppResource()
|
||||||
{
|
{
|
||||||
@@ -708,7 +708,7 @@ void wxStAppResource::OpenSharedLibraryResource(const void *initBlock)
|
|||||||
{
|
{
|
||||||
gSharedLibraryResource = kResFileNotOpened;
|
gSharedLibraryResource = kResFileNotOpened;
|
||||||
|
|
||||||
#ifdef WXMAKINGDLL
|
#ifdef WXMAKINGDLL_CORE
|
||||||
if ( initBlock != NULL ) {
|
if ( initBlock != NULL ) {
|
||||||
const CFragInitBlock *theInitBlock = (const CFragInitBlock *)initBlock;
|
const CFragInitBlock *theInitBlock = (const CFragInitBlock *)initBlock;
|
||||||
FSSpec *fileSpec = NULL;
|
FSSpec *fileSpec = NULL;
|
||||||
@@ -741,9 +741,8 @@ void wxStAppResource::OpenSharedLibraryResource(const void *initBlock)
|
|||||||
else {
|
else {
|
||||||
// wxWindows is a simple dynamic shared library
|
// wxWindows is a simple dynamic shared library
|
||||||
// load the resources from the data fork of a separate resource file
|
// load the resources from the data fork of a separate resource file
|
||||||
char *theResPath;
|
wxString theResPath;
|
||||||
char *theName;
|
wxString theName;
|
||||||
char *theExt;
|
|
||||||
FSRef theResRef;
|
FSRef theResRef;
|
||||||
OSErr theErr = noErr;
|
OSErr theErr = noErr;
|
||||||
|
|
||||||
@@ -763,27 +762,24 @@ void wxStAppResource::OpenSharedLibraryResource(const void *initBlock)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// allocate copy to replace .dylib.* extension with .rsrc
|
// allocate copy to replace .dylib.* extension with .rsrc
|
||||||
theResPath = strdup(theLibPath);
|
if (theLibPath != NULL) {
|
||||||
if (theResPath != NULL) {
|
theResPath = theLibPath;
|
||||||
theName = strrchr(theResPath, '/');
|
// replace '_core' with '' in case of multi-lib build
|
||||||
if (theName == NULL) {
|
theResPath.Replace(wxT("_core"), wxEmptyString);
|
||||||
// no directory elements in path
|
// replace ".dylib" shared library extension with ".rsrc"
|
||||||
theName = theResPath;
|
theResPath.Replace(wxT(".dylib"), wxT(".rsrc"));
|
||||||
}
|
// Find the begining of the filename
|
||||||
// find ".dylib" shared library extension
|
theName = theResPath.AfterLast('/');
|
||||||
theExt = strstr(theName, ".dylib");
|
|
||||||
// overwrite extension with ".rsrc"
|
|
||||||
strcpy(theExt, ".rsrc");
|
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
wxLogDebug( wxT("wxMac resources file name is '%s'"),
|
wxLogDebug( wxT("wxMac resources file name is '%s'"),
|
||||||
theResPath );
|
theResPath.mb_str() );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
theErr = FSPathMakeRef((UInt8 *) theResPath, &theResRef, false);
|
theErr = FSPathMakeRef((UInt8 *) theResPath.mb_str(), &theResRef, false);
|
||||||
if (theErr != noErr) {
|
if (theErr != noErr) {
|
||||||
// try in current directory (using name only)
|
// try in current directory (using name only)
|
||||||
theErr = FSPathMakeRef((UInt8 *) theName, &theResRef, false);
|
theErr = FSPathMakeRef((UInt8 *) theName.mb_str(), &theResRef, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
// open the resource file
|
// open the resource file
|
||||||
@@ -795,22 +791,20 @@ void wxStAppResource::OpenSharedLibraryResource(const void *initBlock)
|
|||||||
#ifdef __WXDEBUG__
|
#ifdef __WXDEBUG__
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
wxT("unable to open wxMac resource file '%s'\n"),
|
wxT("unable to open wxMac resource file '%s'\n"),
|
||||||
theResPath );
|
theResPath.mb_str() );
|
||||||
#endif // __WXDEBUG__
|
#endif // __WXDEBUG__
|
||||||
}
|
}
|
||||||
|
|
||||||
// free duplicated resource file path
|
|
||||||
free(theResPath);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* __DARWIN__ */
|
#endif /* __DARWIN__ */
|
||||||
}
|
}
|
||||||
#endif /* WXMAKINGDLL */
|
#endif /* WXMAKINGDLL_CORE */
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxStAppResource::CloseSharedLibraryResource()
|
void wxStAppResource::CloseSharedLibraryResource()
|
||||||
{
|
{
|
||||||
#ifdef WXMAKINGDLL
|
#ifdef WXMAKINGDLL_CORE
|
||||||
// Close the shared library resource file
|
// Close the shared library resource file
|
||||||
if (gSharedLibraryResource != kResFileNotOpened) {
|
if (gSharedLibraryResource != kResFileNotOpened) {
|
||||||
#ifdef __DARWIN__
|
#ifdef __DARWIN__
|
||||||
@@ -826,10 +820,10 @@ void wxStAppResource::CloseSharedLibraryResource()
|
|||||||
}
|
}
|
||||||
gSharedLibraryResource = kResFileNotOpened;
|
gSharedLibraryResource = kResFileNotOpened;
|
||||||
}
|
}
|
||||||
#endif /* WXMAKINGDLL */
|
#endif /* WXMAKINGDLL_CORE */
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(WXMAKINGDLL) && !defined(__DARWIN__)
|
#if defined(WXMAKINGDLL_CORE) && !defined(__DARWIN__)
|
||||||
|
|
||||||
// for shared libraries we have to manually get the correct resource
|
// for shared libraries we have to manually get the correct resource
|
||||||
// ref num upon initializing and releasing when terminating, therefore
|
// ref num upon initializing and releasing when terminating, therefore
|
||||||
@@ -853,7 +847,7 @@ pascal void __wxterminate(void)
|
|||||||
__terminate() ;
|
__terminate() ;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* WXMAKINGDLL && !__DARWIN__ */
|
#endif /* WXMAKINGDLL_CORE && !__DARWIN__ */
|
||||||
|
|
||||||
#if TARGET_CARBON
|
#if TARGET_CARBON
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user