typedef uint8_t byte_t;
+/* Systems that don't have stdint.h may not define INT64_MIN and
+ INT64_MAX */
+#ifndef INT64_MIN
+#define INT64_MIN (-9223372036854775807LL-1)
+#endif
+#ifndef INT64_MAX
+#define INT64_MAX (9223372036854775807LL)
+#endif
+
/* ptrdiff_t definition */
#ifdef HAVE_STDDEF_H
# include <stddef.h>
}
/* Dynamic array handling: realloc array, move data, increment position */
+#if defined( _MSC_VER )
+# define VLCCVP (void**) /* Work-around for broken compiler */
+#else
+# define VLCCVP
+#endif
#define INSERT_ELEM( p_ar, i_oldsize, i_pos, elem ) \
do \
{ \
- if( i_oldsize ) \
- { \
- (p_ar) = realloc( p_ar, ((i_oldsize) + 1) * sizeof( *(p_ar) ) ); \
- } \
- else \
- { \
- (p_ar) = malloc( ((i_oldsize) + 1) * sizeof( *(p_ar) ) ); \
- } \
+ if( !i_oldsize ) (p_ar) = NULL; \
+ (p_ar) = VLCCVP realloc( p_ar, ((i_oldsize) + 1) * sizeof(*(p_ar)) ); \
if( (i_oldsize) - (i_pos) ) \
{ \
- memmove( (p_ar) + (i_pos) + 1, \
- (p_ar) + (i_pos), \
+ memmove( (p_ar) + (i_pos) + 1, (p_ar) + (i_pos), \
((i_oldsize) - (i_pos)) * sizeof( *(p_ar) ) ); \
} \
(p_ar)[i_pos] = elem; \
# define vlc_strcasestr NULL
#endif
+#ifndef HAVE_DIRENT_H
+ typedef void DIR;
+# ifndef FILENAME_MAX
+# define FILENAME_MAX (260)
+# endif
+ struct dirent
+ {
+ long d_ino; /* Always zero. */
+ unsigned short d_reclen; /* Always zero. */
+ unsigned short d_namlen; /* Length of name in d_name. */
+ char d_name[FILENAME_MAX]; /* File name. */
+ };
+# define opendir vlc_opendir
+# define readdir vlc_readdir
+# define closedir vlc_closedir
+ VLC_EXPORT( void *, vlc_opendir, ( const char * ) );
+ VLC_EXPORT( void *, vlc_readdir, ( void * ) );
+ VLC_EXPORT( int, vlc_closedir, ( void * ) );
+#elif !defined(__PLUGIN__)
+# define vlc_opendir NULL
+# define vlc_readdir NULL
+# define vlc_closedir NULL
+#endif
+
/* Format type specifiers for 64 bits numbers */
-#if !defined(WIN32) && !defined(UNDER_CE)
+#if defined(__CYGWIN32__) || (!defined(WIN32) && !defined(UNDER_CE))
# define I64Fd "%lld"
# define I64Fi "%lli"
# define I64Fo "%llo"
# endif
# endif
-# if defined( _MSC_VER )
+/*
+# if (defined( _MSC_VER ) && (!defined(__WXMSW__)))
# if !defined( _OFF_T_DEFINED )
typedef __int64 off_t;
# define _OFF_T_DEFINED
# else
# define off_t __int64
+ // for wx compatibility typedef long off_t;
# endif
# endif
+*/
# if defined( __BORLANDC__ )
# undef off_t
# define vsnprintf _vsnprintf
# endif
-# ifndef _T
-# ifdef UNICODE
-# define _T(q) L##q
-# else
-# define _T(q) q
-# endif
-# endif
-#endif
-
-/* lseek (defined in src/extras/libc.c) */
-#ifndef HAVE_LSEEK
-# define lseek vlc_lseek
- VLC_EXPORT( off_t, vlc_lseek, ( int fildes, off_t offset, int whence ) );
-#elif !defined(__PLUGIN__)
-# define vlc_lseek NULL
+# include <tchar.h>
#endif
VLC_EXPORT( vlc_bool_t, vlc_reduce, ( int *, int *, int64_t, int64_t, int64_t ) );