]> git.sesse.net Git - vlc/commitdiff
misc/darwin_specific.c: Fix compilation where MAXPATHLEN isn't defined. Fix a bunch...
authorPierre d'Herbemont <pdherbemont@videolan.org>
Fri, 8 Feb 2008 10:21:11 +0000 (10:21 +0000)
committerPierre d'Herbemont <pdherbemont@videolan.org>
Fri, 8 Feb 2008 10:21:11 +0000 (10:21 +0000)
src/misc/darwin_specific.c

index 3340c7c278dcb6b50555d57700253bcd351a2557..e040014c5f1487fddb151ec9d9691f989ee8b437 100644 (file)
 #   include <mach-o/dyld.h>
 #endif
 
+#ifndef MAXPATHLEN
+# define MAXPATHLEN 1024
+#endif
+
 /* CFLocaleCopyAvailableLocaleIdentifiers is present only on post-10.4 */
 extern CFArrayRef CFLocaleCopyAvailableLocaleIdentifiers(void) __attribute__((weak_import));
 
@@ -75,18 +79,18 @@ void system_Init( libvlc_int_t *p_this, int *pi_argc, char *ppsz_argv[] )
     char i_dummy;
     char *p_char = NULL;
     char *p_oldchar = &i_dummy;
-    int i;
+    unsigned int i;
 
     /* Get the full program path and name */
 
     /* First try to see if we are linked to the framework */
     for (i = 0; i < _dyld_image_count(); i++)
     {
-        char * psz_img_name = _dyld_get_image_name(i);
+        const char * psz_img_name = _dyld_get_image_name(i);
         /* Check for "VLCKit.framework/Versions/Current/VLCKit",
          * as well as "VLCKit.framework/Versions/A/VLCKit" and
          * "VLC.framework/Versions/B/VLCKit" */
-        if( p_char = strstr( psz_img_name, "VLCKit.framework/Versions/" ))
+        if( (p_char = strstr( psz_img_name, "VLCKit.framework/Versions/" )) )
         {
             /* Look for the next forward slash */
             p_char += 26; /* p_char += strlen(" VLCKit.framework/Versions/" ) */