diff options
Diffstat (limited to 'lib/os_internal.h')
-rw-r--r-- | lib/os_internal.h | 91 |
1 files changed, 86 insertions, 5 deletions
diff --git a/lib/os_internal.h b/lib/os_internal.h index 2f6d19779..24d810ffd 100644 --- a/lib/os_internal.h +++ b/lib/os_internal.h @@ -1,3 +1,6 @@ +#ifndef _XINE_OS_INTERNAL_H +#define _XINE_OS_INTERNAL_H + #include <stddef.h> #include "os_types.h" @@ -67,15 +70,93 @@ char *_xine_private_strpbrk(const char *s, const char *accept); char *_xine_private_strsep(char **stringp, const char *delim); #endif -/* replacing lstat by stat */ -#ifndef HAVE_LSTAT -# define lstat(FILENAME, BUF) stat((FILENAME), (BUF)) -#endif - /* macross needed for MSVC */ #ifdef _MSC_VER # define snprintf _snprintf # define vsnprintf _vsnprintf # define strcasecmp _stricmp # define strncasecmp _strnicmp +# define M_PI 3.14159265358979323846 +#endif + +#ifdef WIN32 +#include <io.h> +# define mkdir(A, B) _mkdir((A)) + +# ifndef S_ISDIR +# define S_ISDIR(m) ((m) & _S_IFDIR) +# endif + +# ifndef S_ISREG +# define S_ISREG(m) ((m) & _S_IFREG) +# endif + +# ifndef S_ISBLK +# define S_ISBLK(m) 0 +# endif + +# ifndef S_ISCHR +# define S_ISCHR(m) 0 +# endif + +# ifndef S_ISLNK +# define S_ISLNK(mode) 0 +# endif + +# ifndef S_ISSOCK +# define S_ISSOCK(mode) 0 +# endif + +# ifndef S_ISFIFO +# define S_ISFIFO(mode) 0 +# endif + +# ifndef S_IXUSR +# define S_IXUSR S_IEXEC +# endif + +# ifndef S_IXGRP +# define S_IXGRP S_IEXEC +# endif + +# ifndef S_IXOTH +# define S_IXOTH S_IEXEC +# endif + +# if !S_IXUGO +# define S_IXUGO (S_IXUSR | S_IXGRP | S_IXOTH) +# endif + +#endif + +#ifndef HAVE_READLINK +# define readlink(PATH, BUF, BUFSIZE) 0 +#endif + +/* replacing lstat by stat */ +#ifndef HAVE_LSTAT +# define lstat(FILENAME, BUF) stat((FILENAME), (BUF)) +#endif + +/* replacements of dirent for MSVC platform */ +#ifndef HAVE_OPENDIR +typedef struct DIR DIR; + +struct dirent { + unsigned short d_reclen; + char *d_name; +}; + +DIR *_xine_private_opendir(const char *); +int _xine_private_closedir(DIR *); +struct dirent *_xine_private_readdir(DIR *); +void _xine_private_rewinddir(DIR *); + +#define opendir(DIRENT_NAME) _xine_private_opendir((DIRENT_NAME)) +#define closedir(DIRENT_DIR) _xine_private_closedir((DIRENT_DIR)) +#define readdir(DIRENT_DIR) _xine_private_readdir((DIRENT_DIR)) +#define rewinddir(DIRENT_DIR) _xine_private_rewinddir((DIRENT_DIR)) + +#endif + #endif |