]> git.sesse.net Git - vlc/commitdiff
Simpler use of HAVE_ASSERT
authorRémi Denis-Courmont <rem@videolan.org>
Wed, 1 Feb 2006 15:28:42 +0000 (15:28 +0000)
committerRémi Denis-Courmont <rem@videolan.org>
Wed, 1 Feb 2006 15:28:42 +0000 (15:28 +0000)
src/libvlc.c

index 0b8e664fae99617516664b717fedffc1bd7ca4f8..56ee835faf9ec64cc524611f7ad6db663f499d0f 100644 (file)
 #include <stdio.h>                                              /* sprintf() */
 #include <string.h>                                            /* strerror() */
 #include <stdlib.h>                                                /* free() */
-#include <assert.h>
+#ifdef HAVE_ASSERT
+# include <assert.h>
+#else
+# define assert( c ) ((void)0)
+#endif
 
 #ifndef WIN32
 #   include <netinet/in.h>                            /* BSD: struct in_addr */
@@ -2728,13 +2732,12 @@ char *FromLocale( const char *locale )
             inb--;
             vlc_iconv( libvlc.from_locale, NULL, NULL, NULL, NULL );
         }
-        vlc_mutex_unlock( &libvlc.from_locale_lock );
-#ifdef HAVE_ASSERT
+       vlc_mutex_unlock( &libvlc.from_locale_lock );
+
         assert (inb == 0);
         assert (*iptr == '\0');
         assert (*optr == '\0');
         assert (strlen( output ) == (size_t)(optr - output));
-#endif
         return realloc( output, optr - output + 1 );
     }
     return (char *)locale;
@@ -2777,12 +2780,10 @@ char *ToLocale( const char *utf8 )
         }
         vlc_mutex_unlock( &libvlc.to_locale_lock );
 
-#ifdef HAVE_ASSERT
         assert (inb == 0);
         assert (*iptr == '\0');
         assert (*optr == '\0');
         assert (strlen( output ) == (size_t)(optr - output));
-#endif
        return realloc( output, optr - output + 1 );
     }
     return (char *)utf8;