mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-02-01 03:10:06 +00:00
Added code to make the mac detect its executable file, removing the need for the juce_setCurrentExecutable function, and removed this function from the codebase.
This commit is contained in:
parent
5df4ac7dec
commit
6fe090f2cb
10 changed files with 1696 additions and 1789 deletions
|
|
@ -70,10 +70,6 @@ BEGIN_JUCE_NAMESPACE
|
|||
#include "../../macosx/platform_specific_code/juce_posix_SharedCode.h"
|
||||
|
||||
|
||||
//==============================================================================
|
||||
static File executableFile;
|
||||
|
||||
|
||||
//==============================================================================
|
||||
void juce_getFileTimes (const String& fileName,
|
||||
int64& modificationTime,
|
||||
|
|
@ -262,21 +258,7 @@ const File File::getSpecialLocation (const SpecialLocationType type)
|
|||
|
||||
case currentExecutableFile:
|
||||
case currentApplicationFile:
|
||||
if (! executableFile.exists())
|
||||
{
|
||||
Dl_info executableInfo;
|
||||
dladdr ((const void*) juce_getFileTimes, &executableInfo);
|
||||
|
||||
if (executableInfo.dli_fname != 0)
|
||||
executableFile = File (String (executableInfo.dli_fname));
|
||||
}
|
||||
|
||||
// if this fails, it's probably because juce_setCurrentExecutableFileName()
|
||||
// was never called to set the filename - this should be done by the juce
|
||||
// main() function, so maybe you've hacked it to use your own custom main()?
|
||||
jassert (executableFile.exists());
|
||||
|
||||
return executableFile;
|
||||
return juce_getExecutableFile();
|
||||
|
||||
default:
|
||||
jassertfalse // unknown type?
|
||||
|
|
@ -286,11 +268,6 @@ const File File::getSpecialLocation (const SpecialLocationType type)
|
|||
return File::nonexistent;
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
void juce_setCurrentExecutableFileName (const String& filename) throw()
|
||||
{
|
||||
executableFile = File::getCurrentWorkingDirectory().getChildFile (filename);
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
const File File::getCurrentWorkingDirectory() throw()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue