Commit 032a2347 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Include system headers before VLC headers

This fixes some problems when the system or VLC play evil tricks with
the preprocessor. (Only files including sys/stat.h are concerned with
this commit. I did not fix all files.)
parent 31c91f0a
......@@ -30,18 +30,6 @@
#endif
#include <assert.h>
#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_input.h>
#include <vlc_access.h>
#include <vlc_demux.h>
#include <vlc_charset.h>
#include <vlc_fs.h>
#include <vlc_url.h>
#include <vlc_vout.h>
#include <vlc_dialog.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
......@@ -54,6 +42,16 @@
#endif
#include <errno.h>
#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_input.h>
#include <vlc_access.h>
#include <vlc_demux.h>
#include <vlc_charset.h>
#include <vlc_fs.h>
#include <vlc_url.h>
#include <vlc_vout.h>
#include <vlc_dialog.h>
#include <vlc_keys.h>
#include <vlc_iso_lang.h>
......
......@@ -27,12 +27,6 @@
# include "config.h"
#endif
#include <vlc_common.h>
#include "fs.h"
#include <vlc_input.h>
#include <vlc_access.h>
#include <vlc_dialog.h>
#include <assert.h>
#include <errno.h>
#include <sys/types.h>
......@@ -58,7 +52,6 @@
# include <io.h>
# include <ctype.h>
# include <shlwapi.h>
# include <vlc_charset.h>
#else
# include <unistd.h>
#endif
......@@ -71,6 +64,14 @@
# define lseek _lseeki64
#endif
#include <vlc_common.h>
#include "fs.h"
#include <vlc_input.h>
#include <vlc_access.h>
#include <vlc_dialog.h>
#ifdef WIN32
# include <vlc_charset.h>
#endif
#include <vlc_fs.h>
#include <vlc_url.h>
......
......@@ -30,12 +30,6 @@
# include "config.h"
#endif
#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_input.h>
#include <vlc_access.h>
#include <vlc_dialog.h>
#include <assert.h>
#include <errno.h>
#include <sys/types.h>
......@@ -45,10 +39,14 @@
#ifdef HAVE_FCNTL_H
# include <fcntl.h>
#endif
#include <unistd.h>
#include <poll.h>
#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_input.h>
#include <vlc_access.h>
#include <vlc_dialog.h>
#include <vlc_fs.h>
#include "libmtp.h"
......
......@@ -28,11 +28,7 @@
# include "config.h"
#endif
#include <vlc_common.h>
#include <vlc_fs.h>
#include <vlc_plugin.h>
#include <vlc_access.h>
#include <errno.h>
#ifdef WIN32
# ifdef HAVE_FCNTL_H
# include <fcntl.h>
......@@ -50,7 +46,10 @@
# include <libsmbclient.h>
#endif
#include <errno.h>
#include <vlc_common.h>
#include <vlc_fs.h>
#include <vlc_plugin.h>
#include <vlc_access.h>
/*****************************************************************************
* Module descriptor
......
......@@ -34,16 +34,9 @@
# define INCL_DOSDEVIOCTL
#endif
#include <vlc_common.h>
#include <vlc_access.h>
#include <vlc_charset.h>
#include <vlc_fs.h>
#include <limits.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#include <sys/types.h>
#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
......@@ -55,6 +48,12 @@
# include <arpa/inet.h>
#endif
#include <vlc_common.h>
#include <vlc_access.h>
#include <vlc_charset.h>
#include <vlc_fs.h>
#include <limits.h>
#if defined( SYS_BSDI )
# include <dvd.h>
#elif defined ( __APPLE__ )
......
......@@ -26,36 +26,29 @@
# include "config.h"
#endif
#include <vlc_common.h>
#include <vlc_md5.h>
#include "libmp4.h"
#include <vlc_fs.h>
/* In Solaris (and perhaps others) PATH_MAX is in limits.h. */
#include <limits.h>
#ifdef WIN32
# include <io.h>
#else
# include <stdio.h>
#endif
#include <errno.h>
#ifdef WIN32
# if !defined( UNDER_CE )
# include <direct.h>
# endif
# include <tchar.h>
# include <shlobj.h>
# include <windows.h>
#else
# include <stdio.h>
#endif
#include <errno.h>
#include <sys/types.h>
#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
#include <sys/types.h>
/* In Solaris (and perhaps others) PATH_MAX is in limits.h. */
#include <limits.h>
#include <vlc_common.h>
#include <vlc_md5.h>
#include "libmp4.h"
#include <vlc_fs.h>
#ifdef __APPLE__
#include "TargetConditionals.h"
#ifndef TARGET_OS_IPHONE
......
......@@ -34,11 +34,16 @@
# include "config.h"
#endif
#include <vlc_common.h>
#include <vlc_plugin.h>
#define _XOPEN_SOURCE_EXTENDED 1
#include <assert.h>
#include <wchar.h>
#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
#include <vlc_common.h>
#include <vlc_plugin.h>
#include <ncurses.h>
......@@ -53,12 +58,6 @@
#include <vlc_fs.h>
#include <vlc_url.h>
#include <assert.h>
#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
/*****************************************************************************
* Local prototypes.
*****************************************************************************/
......
......@@ -26,6 +26,16 @@
# include "config.h"
#endif
#ifdef HAVE_FCNTL_H
# include <fcntl.h>
#endif
#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#include <vlc_common.h>
#include <vlc_fs.h>
......@@ -37,16 +47,6 @@
#include "../src/vlcproc.hpp"
#include "../src/window_manager.hpp"
#ifdef HAVE_FCNTL_H
# include <fcntl.h>
#endif
#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#if defined( HAVE_ZLIB_H )
# include <zlib.h>
# include <errno.h>
......
......@@ -24,19 +24,16 @@
/*****************************************************************************
* Preamble
*****************************************************************************/
#ifndef _GNU_SOURCE
# define _GNU_SOURCE
#endif
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <vlc_common.h>
#include <vlc_interface.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <vlc_common.h>
#include <vlc_interface.h>
#include "vlc.h"
#include "libs.h"
......
......@@ -24,30 +24,24 @@
/*****************************************************************************
* Preamble
*****************************************************************************/
#ifndef _GNU_SOURCE
# define _GNU_SOURCE
#endif
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <errno.h>
#ifdef WIN32
#include <io.h>
#endif
#ifdef HAVE_POLL
#include <poll.h> /* poll structures and defines */
#endif
#include <sys/stat.h>
#include <vlc_common.h>
#include <vlc_network.h>
#include <vlc_url.h>
#include <vlc_fs.h>
#ifdef HAVE_POLL
#include <poll.h> /* poll structures and defines */
#endif
#include <sys/stat.h>
#include<errno.h>
#include "../vlc.h"
#include "../libs.h"
......
......@@ -25,15 +25,12 @@
/*****************************************************************************
* Preamble
*****************************************************************************/
#ifndef _GNU_SOURCE
# define _GNU_SOURCE
#endif
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <assert.h>
#include <sys/stat.h>
#include <vlc_common.h>
#include <vlc_plugin.h>
......@@ -43,7 +40,6 @@
#include <vlc_aout.h>
#include <vlc_services_discovery.h>
#include <vlc_stream.h>
#include <sys/stat.h>
#include "vlc.h"
......
......@@ -28,17 +28,16 @@
#ifndef SQL_MEDIA_LIBRARY_H
#define SQL_MEDIA_LIBRARY_H
#ifdef HAVE_CONFIG_H
# include "config.h"
#include <stdarg.h>
#include <assert.h>
#include <errno.h>
#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
#include <vlc_common.h>
#include <vlc/vlc.h>
#include <vlc_sql.h>
#include <vlc_media_library.h>
#include <vlc_playlist.h>
#include <vlc_input.h>
#include <vlc_arrays.h>
......@@ -47,17 +46,8 @@
#include <vlc_interface.h>
#include <vlc_modules.h>
#include <stdarg.h>
#include <assert.h>
#include <errno.h>
#include "item_list.h"
#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
/*****************************************************************************
* Static parameters
*****************************************************************************/
......
......@@ -29,6 +29,10 @@
# include "config.h"
#endif
#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_art_finder.h>
......@@ -36,10 +40,6 @@
#include <vlc_url.h>
#include <vlc_input_item.h>
#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
static const char* cover_files[] = {
"Folder.jpg", /* Windows */
"AlbumArtSmall.jpg", /* Windows */
......
......@@ -26,13 +26,11 @@
# include "config.h"
#endif
#include <vlc_common.h>
#include <vlc_plugin.h>
#include <errno.h>
#include <time.h>
#include <sys/types.h>
#include <errno.h>
#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
......@@ -42,9 +40,10 @@
#else
# include <unistd.h>
#endif
# include <fcntl.h>
#include <fcntl.h>
#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_tls.h>
#include <vlc_charset.h>
#include <vlc_fs.h>
......
......@@ -29,15 +29,14 @@
# include "config.h"
#endif
#include <sys/stat.h>
#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_url.h>
#include <vlc_fs.h>
#include <vlc_services_discovery.h>
#include <sys/stat.h>
/*****************************************************************************
* Module descriptor
*****************************************************************************/
......
......@@ -34,6 +34,9 @@
#include <limits.h>
#include <assert.h>
#include <errno.h>
#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
#include "input_internal.h"
#include "event.h"
......@@ -55,10 +58,6 @@
#include <vlc_strings.h>
#include <vlc_modules.h>
#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
/*****************************************************************************
* Local prototypes
*****************************************************************************/
......
......@@ -31,17 +31,15 @@
# include "config.h"
#endif
#include <vlc_common.h>
#include <vlc_fs.h>
#include <vlc_url.h>
#include <ctype.h> /* isalnum() */
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#include <sys/stat.h>
#include <ctype.h> /* isalnum */
#include <vlc_common.h>
#include <vlc_fs.h>
#include <vlc_url.h>
#include "input_internal.h"
......
......@@ -28,7 +28,6 @@
# include "config.h"
#endif
#include <vlc_common.h>
#include <sys/stat.h>
#include <assert.h>
#include <errno.h>
......@@ -36,7 +35,8 @@
# include <unistd.h>
#endif
#include "vlc_block.h"
#include <vlc_common.h>
#include <vlc_block.h>
/**
* @section Block handling functions.
......
......@@ -28,15 +28,9 @@
# include "config.h"
#endif
#include <vlc_common.h>
#include "libvlc.h"
#include <stdlib.h> /* free(), strtol() */
#include <stdio.h> /* sprintf() */
#include <string.h> /* strdup() */
#include <vlc_plugin.h>
#include <errno.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#ifdef HAVE_UNISTD_H
......@@ -44,6 +38,12 @@
#endif
#include <assert.h>
#include <vlc_common.h>
#include "libvlc.h"
#include <vlc_plugin.h>
#include <errno.h>
#include "config/configuration.h"
#include <vlc_fs.h>
......
......@@ -27,6 +27,10 @@
#endif
#include <assert.h>
#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
#include <vlc_common.h>
#include <vlc_playlist.h>
#include <vlc_fs.h>
......@@ -35,10 +39,6 @@
#include <vlc_url.h>
#include <vlc_md5.h>
#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
#include "../libvlc.h"
#include "playlist_internal.h"
......
......@@ -24,6 +24,10 @@
# include "config.h"
#endif
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <vlc_common.h>
#include <vlc_playlist.h>
#include <vlc_events.h>
......@@ -33,10 +37,6 @@
#include <vlc_url.h>
#include <vlc_modules.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
int playlist_Export( playlist_t * p_playlist, const char *psz_filename,
playlist_item_t *p_export_root, const char *psz_type )
{
......
......@@ -25,26 +25,26 @@
# include "config.h"
#endif
#include <vlc_common.h>
#include <vlc_charset.h>
#include <vlc_fs.h>
#include "libvlc.h" /* vlc_mkdir */
#include <assert.h>
#include <stdio.h>
#include <limits.h> /* NAME_MAX */
#include <errno.h>
#include <sys/types.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/stat.h>
#ifndef HAVE_LSTAT
# define lstat(a, b) stat(a, b)
#endif
#include <dirent.h>
#include <sys/socket.h>
#ifndef HAVE_LSTAT
# define lstat( a, b ) stat(a, b)
#endif
#include <vlc_common.h>
#include <vlc_charset.h>
#include <vlc_fs.h>
#include "libvlc.h" /* vlc_mkdir */
/**
* Opens a system file handle.
......
......@@ -26,6 +26,11 @@
# include "config.h"
#endif
#include <sys/stat.h>
#include <sys/types.h>
#include <dirent.h>
#include <time.h>
#include <vlc_common.h>
#include <vlc_fs.h>
#include <vlc_strings.h>
......@@ -33,11 +38,6 @@
#include "snapshot.h"
#include <sys/stat.h>
#include <sys/types.h>
#include <dirent.h>
#include <time.h>
/* */
void vout_snapshot_Init(vout_snapshot_t *snap)
{
......
......@@ -28,11 +28,6 @@
# include "config.h"
#endif
#include <vlc_common.h>
#include <vlc_charset.h>
#include <vlc_fs.h>
#include "libvlc.h" /* vlc_mkdir */
#include <assert.h>
#include <stdio.h>
......@@ -48,6 +43,11 @@
# include <tchar.h>
#endif
#include <vlc_common.h>
#include <vlc_charset.h>
#include <vlc_fs.h>
#include "libvlc.h" /* vlc_mkdir */
static wchar_t *widen_path (const char *path)
{
wchar_t *wpath;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment