[SCM] audacity/master: Fix build failure caused by undefined PATH_MAX.

bdrung at users.alioth.debian.org bdrung at users.alioth.debian.org
Sat May 31 20:15:31 UTC 2014


The following commit has been merged in the master branch:
commit 228dad5fdee37d181fb5ba365c3d0efeed36e8af
Author: Benjamin Drung <bdrung at debian.org>
Date:   Sat May 31 20:18:34 2014 +0200

    Fix build failure caused by undefined PATH_MAX.

diff --git a/debian/patches/path-max.patch b/debian/patches/path-max.patch
new file mode 100644
index 0000000..a7c8b2c
--- /dev/null
+++ b/debian/patches/path-max.patch
@@ -0,0 +1,55 @@
+Description: 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.
+Author: Benjamin Drung <bdrung at debian.org>
+Origin: upstream, r12964
+
+--- a/src/Audacity.h
++++ b/src/Audacity.h
+@@ -69,6 +69,7 @@
+ 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 @@
+ 
+ #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"
+--- a/src/FileNames.cpp
++++ b/src/FileNames.cpp
+@@ -225,10 +225,10 @@
+ #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));
+--- a/src/effects/VST/VSTEffect.cpp
++++ b/src/effects/VST/VSTEffect.cpp
+@@ -2118,7 +2118,7 @@
+    }
+ 
+    // 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
diff --git a/debian/patches/series b/debian/patches/series
index 41f8fe3..49c495c 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
 distclean.patch
+path-max.patch

-- 
Audacity debian packaging



More information about the pkg-multimedia-commits mailing list