]> git.sesse.net Git - vlc/blobdiff - include/vlc_common.h
luarc: simplify
[vlc] / include / vlc_common.h
index 886711f4cd7914fdf64b51d93a17afbf5354724c..a1dbcf349ec773ce3ceef6260367475deba287b4 100644 (file)
 #   define unlikely(p) (!!(p))
 #endif
 
+#if defined(__GNUC__) && !defined __cplusplus
+# define LIBVLC_DEPRECATED __attribute__((deprecated))
+#else
+# define LIBVLC_DEPRECATED
+#endif
+
 /*****************************************************************************
  * Basic types definitions
  *****************************************************************************/
 #   endif
 #endif
 
+#ifdef __SYMBIAN32__
+ #include <sys/syslimits.h>
+#endif
+
 /* Counter for statistics and profiling */
 typedef unsigned long       count_t;
 
@@ -177,8 +187,6 @@ typedef struct vlc_list_t vlc_list_t;
 typedef struct vlc_object_t vlc_object_t;
 typedef struct libvlc_int_t libvlc_int_t;
 typedef struct date_t date_t;
-typedef struct dict_entry_t dict_entry_t;
-typedef struct dict_t dict_t;
 
 /* Playlist */
 
@@ -211,7 +219,6 @@ typedef struct config_category_t config_category_t;
 
 /* Input */
 typedef struct input_thread_t input_thread_t;
-typedef struct input_thread_sys_t input_thread_sys_t;
 typedef struct input_item_t input_item_t;
 typedef struct input_item_node_t input_item_node_t;
 typedef struct access_t access_t;
@@ -223,7 +230,6 @@ typedef struct demux_sys_t demux_sys_t;
 typedef struct es_out_t     es_out_t;
 typedef struct es_out_id_t  es_out_id_t;
 typedef struct es_out_sys_t es_out_sys_t;
-typedef struct es_descriptor_t es_descriptor_t;
 typedef struct seekpoint_t seekpoint_t;
 typedef struct info_t info_t;
 typedef struct info_category_t info_category_t;
@@ -278,7 +284,6 @@ typedef struct sout_stream_sys_t sout_stream_sys_t;
 
 typedef struct config_chain_t       config_chain_t;
 typedef struct session_descriptor_t session_descriptor_t;
-typedef struct announce_method_t announce_method_t;
 
 /* Decoders */
 typedef struct decoder_t         decoder_t;
@@ -340,10 +345,6 @@ typedef struct vod_t     vod_t;
 typedef struct vod_sys_t vod_sys_t;
 typedef struct vod_media_t vod_media_t;
 
-/* opengl */
-typedef struct opengl_t     opengl_t;
-typedef struct opengl_sys_t opengl_sys_t;
-
 /* osdmenu */
 typedef struct osd_menu_t   osd_menu_t;
 typedef struct osd_state_t  osd_state_t;
@@ -424,9 +425,6 @@ struct vlc_list_t
 #define VLC_VAR_INTEGER   0x0030
 #define VLC_VAR_HOTKEY    0x0031
 #define VLC_VAR_STRING    0x0040
-#define VLC_VAR_MODULE    0x0041
-#define VLC_VAR_FILE      0x0042
-#define VLC_VAR_DIRECTORY 0x0043
 #define VLC_VAR_VARIABLE  0x0044
 #define VLC_VAR_FLOAT     0x0050
 #define VLC_VAR_TIME      0x0060
@@ -627,6 +625,23 @@ static inline unsigned clz (unsigned x)
 /* XXX: this assumes that int is 32-bits or more */
 #define clz32( x ) (clz(x) - ((sizeof(unsigned) - sizeof (uint32_t)) * 8))
 
+/* Bit weight */
+LIBVLC_USED
+static inline unsigned popcount (unsigned x)
+{
+#ifdef __GNUC_
+    return __builtin_popcount (x);
+#else
+    unsigned count = 0;
+    while (x)
+    {
+        count += x & 1;
+        x = x >> 1;
+    }
+    return count;
+#endif
+}
+
 /* Free and set set the variable to NULL */
 #define FREENULL(a) do { free( a ); a = NULL; } while(0)
 
@@ -765,7 +780,6 @@ static inline uint64_t ntoh64 (uint64_t ll)
 /* win32, cl and icl support */
 #   if defined( _MSC_VER ) || !defined( __MINGW32__ )
 #       define __attribute__(x)
-#       define __inline__      __inline
 #       define S_IFBLK         0x3000  /* Block */
 #       define S_ISBLK(m)      (0)
 #       define S_ISCHR(m)      (0)
@@ -864,7 +878,6 @@ static inline void *xrealloc (void *ptr, size_t len)
 /*****************************************************************************
  * libvlc features
  *****************************************************************************/
-VLC_EXPORT( const char *, VLC_Version, ( void ) LIBVLC_USED );
 VLC_EXPORT( const char *, VLC_CompileBy, ( void ) LIBVLC_USED );
 VLC_EXPORT( const char *, VLC_CompileHost, ( void ) LIBVLC_USED );
 VLC_EXPORT( const char *, VLC_Compiler, ( void ) LIBVLC_USED );
@@ -878,7 +891,7 @@ VLC_EXPORT( const char *, VLC_Compiler, ( void ) LIBVLC_USED );
 #include "vlc_main.h"
 #include "vlc_configuration.h"
 
-#if defined( WIN32 ) || defined( UNDER_CE )
+#if defined( WIN32 ) || defined( UNDER_CE ) || defined( __SYMBIAN32__ )
 #   define DIR_SEP_CHAR '\\'
 #   define DIR_SEP "\\"
 #   define PATH_SEP_CHAR ';'