]> git.sesse.net Git - vlc/commitdiff
smb.c: prevents problem with glibc defining open as a macro
authorDamien Fouilleul <damienf@videolan.org>
Mon, 10 Sep 2007 12:59:08 +0000 (12:59 +0000)
committerDamien Fouilleul <damienf@videolan.org>
Mon, 10 Sep 2007 12:59:08 +0000 (12:59 +0000)
modules/access/smb.c

index e875c7cf6eea9fb319bb68ff11bc27a0bab73056..6da29f1ee96c12b13ace16c53acb7f8641132c0d 100644 (file)
@@ -226,7 +226,7 @@ static int Open( vlc_object_t *p_this )
         return VLC_EGENERIC;
     }
 
-    if( !(p_file = p_smb->open( p_smb, psz_uri, O_RDONLY, 0 )) )
+    if( !(p_file = (p_smb->open)( p_smb, psz_uri, O_RDONLY, 0 )) )
     {
         msg_Err( p_access, "open failed for '%s' (%s)",
                  p_access->psz_path, strerror(errno) );
@@ -251,6 +251,14 @@ static int Open( vlc_object_t *p_this )
     }
 #endif
 
+/*
+** some version of glibc defines open as a macro, causing havoc
+** with other macros using 'open' under the hood, such as the
+** following one:
+*/
+#if defined(smbc_open) && defined(open)
+# undef open
+#endif
     if( (i_smb = smbc_open( psz_uri, O_RDONLY, 0 )) < 0 )
     {
         msg_Err( p_access, "open failed for '%s' (%s)",