mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-22 15:20:15 +02:00
Fix build failure caused by undefined PATH_MAX.
Use PATH_MAX for PLATFORM_MAX_PATH only if it is defined and replace all instances of PATH_MAX by PLATFORM_MAX_PATH.
This commit is contained in:
parent
c7c15e09d8
commit
7d4bc6917b
@ -69,6 +69,7 @@ class wxWindow;
|
||||
void QuitAudacity(bool bForce);
|
||||
void QuitAudacity();
|
||||
|
||||
// Please try to support unlimited path length instead of using PLATFORM_MAX_PATH!
|
||||
// Define one constant for maximum path value, so we don't have to do
|
||||
// platform-specific conditionals everywhere we want to check it.
|
||||
#define PLATFORM_MAX_PATH 260 // Play it safe for default, with same value as Windows' MAX_PATH.
|
||||
@ -81,9 +82,12 @@ void QuitAudacity();
|
||||
|
||||
#ifdef __WXGTK__
|
||||
#include "configunix.h"
|
||||
// Some systems do not restrict the path length and therefore PATH_MAX is undefined
|
||||
#ifdef PATH_MAX
|
||||
#undef PLATFORM_MAX_PATH
|
||||
#define PLATFORM_MAX_PATH PATH_MAX
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef __WXX11__
|
||||
#include "configunix.h"
|
||||
|
@ -225,10 +225,10 @@ wxString FileNames::PathFromAddr(void *addr)
|
||||
#if defined(__WXMAC__) || defined(__WXGTK__)
|
||||
Dl_info info;
|
||||
if (dladdr(addr, &info)) {
|
||||
char realname[PATH_MAX + 1];
|
||||
char realname[PLATFORM_MAX_PATH + 1];
|
||||
int len;
|
||||
name = LAT1CTOWX(info.dli_fname);
|
||||
len = readlink(OSINPUT(name.GetFullPath()), realname, PATH_MAX);
|
||||
len = readlink(OSINPUT(name.GetFullPath()), realname, PLATFORM_MAX_PATH);
|
||||
if (len > 0) {
|
||||
realname[len] = 0;
|
||||
name.SetFullName(LAT1CTOWX(realname));
|
||||
|
@ -2142,7 +2142,7 @@ bool VSTEffect::Load()
|
||||
}
|
||||
|
||||
// Convert back to path
|
||||
UInt8 exePath[PATH_MAX];
|
||||
UInt8 exePath[PLATFORM_MAX_PATH];
|
||||
success = CFURLGetFileSystemRepresentation(exeRef, true, exePath, sizeof(exePath));
|
||||
|
||||
// Done with the executable reference
|
||||
|
Loading…
x
Reference in New Issue
Block a user