* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
-#if !defined( __LIBVLC__ )
- #error You are not libvlc or one of its plugins. You cannot include this file
-#endif
+#ifndef VLC_VARIABLES_H
+#define VLC_VARIABLES_H 1
-#ifndef _VLC_VARIABLES_H
-#define _VLC_VARIABLES_H 1
+/**
+ * \file
+ * This file defines functions and structures for dynamic variables in vlc
+ */
/**
* \defgroup variables Variables
#define VLC_VAR_INHERITVALUE 0x0030
#define VLC_VAR_TRIGGER_CALLBACKS 0x0035
+
+#define VLC_VAR_SETISCOMMAND 0x0040
/**@}*/
/*****************************************************************************
VLC_EXPORT( int, __var_Command, ( vlc_object_t *, const char *, const char *, const char *, char ** ) );
VLC_EXPORT( vlc_mutex_t *, var_AcquireMutex, ( const char * ) );
+#ifdef __GNUC__
+static
+__attribute__((unused))
+__attribute__((noinline))
+__attribute__((error("variable mutex name leaks memory at run-time")))
+const char *nonconst_mutex_name( const char *str )
+{
+ return str;
+}
+
+# define check_named_mutex( m ) \
+ (__builtin_constant_p(m) ? m : nonconst_mutex_name(m))
+#else
+# define check_named_mutex( m ) (m)
+#endif
+
+#define var_AcquireMutex( n ) var_AcquireMutex(check_named_mutex(n))
/**
* __var_Create() with automatic casting.