Переглянути джерело

Remove inconsistently used HAVE_UNISTD_H

Rémi Denis-Courmont 11 роки тому
батько
коміт
c4199ab677

+ 1 - 3
compat/fdopendir.c

@@ -27,9 +27,7 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
-#ifdef HAVE_UNISTD_H
-# include <unistd.h>
-#endif
+#include <unistd.h>
 #include <dirent.h>
 
 DIR *fdopendir (int fd)

+ 2 - 6
modules/access/directory.c

@@ -37,12 +37,8 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <errno.h>
-#ifdef HAVE_UNISTD_H
-#   include <unistd.h>
-#   include <fcntl.h>
-#elif defined( _WIN32 )
-#   include <io.h>
-#endif
+#include <unistd.h>
+#include <fcntl.h>
 
 #include <vlc_fs.h>
 #include <vlc_url.h>

+ 1 - 6
modules/access/dv.c

@@ -34,12 +34,7 @@
 
 #include <errno.h>
 #include <sys/types.h>
-#ifdef HAVE_UNISTD_H
-#   include <unistd.h>
-#elif defined( _WIN32 )
-#   include <io.h>
-#endif
-
+#include <unistd.h>
 #include <sys/poll.h>
 
 #include <libraw1394/raw1394.h>

+ 1 - 3
modules/access/dvdnav.c

@@ -38,9 +38,7 @@
 #endif
 
 #include <assert.h>
-#ifdef HAVE_UNISTD_H
-#   include <unistd.h>
-#endif
+#include <unistd.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>

+ 1 - 4
modules/access/dvdread.c

@@ -50,11 +50,8 @@
 
 #include "../demux/ps.h"
 
-#ifdef HAVE_UNISTD_H
-#   include <unistd.h>
-#endif
-
 #include <sys/types.h>
+#include <unistd.h>
 
 #include <dvdread/dvd_reader.h>
 #include <dvdread/ifo_types.h>

+ 1 - 3
modules/access/mms/mmstu.c

@@ -35,10 +35,8 @@
 #include <errno.h>
 #include <assert.h>
 
-#ifdef HAVE_UNISTD_H
-#   include <unistd.h>
-#endif
 #include <sys/types.h>
+#include <unistd.h>
 #ifdef HAVE_POLL
 #   include <poll.h>
 #endif

+ 1 - 3
modules/access/vcd/cdrom.c

@@ -42,10 +42,8 @@
 #   define INCL_DOSDEVIOCTL
 #endif
 
-#ifdef HAVE_UNISTD_H
-#   include <unistd.h>
-#endif
 #include <sys/types.h>
+#include <unistd.h>
 #include <sys/stat.h>
 #include <fcntl.h>
 #ifdef HAVE_ARPA_INET_H

+ 1 - 5
modules/access/vdr.c

@@ -48,11 +48,7 @@ See http://www.vdr-wiki.de/ and http://www.tvdr.de/ for more information.
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
-#ifdef HAVE_UNISTD_H
-#   include <unistd.h>
-#elif defined( _WIN32 )
-#   include <io.h>
-#endif
+#include <unistd.h>
 
 #include <ctype.h>
 #include <time.h>

+ 1 - 3
modules/access_output/livehttp.c

@@ -34,9 +34,7 @@
 #include <time.h>
 #include <fcntl.h>
 #include <errno.h>
-#ifdef HAVE_UNISTD_H
-# include <unistd.h>
-#endif
+#include <unistd.h>
 
 #include <vlc_common.h>
 #include <vlc_plugin.h>

+ 1 - 4
modules/access_output/udp.c

@@ -33,16 +33,13 @@
 #include <vlc_plugin.h>
 
 #include <sys/types.h>
+#include <unistd.h>
 #include <assert.h>
 #include <errno.h>
 
 #include <vlc_sout.h>
 #include <vlc_block.h>
 
-#ifdef HAVE_UNISTD_H
-#   include <unistd.h>
-#endif
-
 #ifdef _WIN32
 #   include <winsock2.h>
 #   include <ws2tcpip.h>

+ 0 - 4
modules/audio_filter/channel_mixer/mono.c

@@ -31,10 +31,6 @@
 #include <math.h>                                        /* sqrt */
 #include <stdint.h>                                         /* int16_t .. */
 
-#ifdef HAVE_UNISTD_H
-#   include <unistd.h>
-#endif
-
 #include <vlc_common.h>
 #include <vlc_plugin.h>
 #include <vlc_block.h>

+ 1 - 3
modules/codec/fluidsynth.c

@@ -28,9 +28,7 @@
 #include <vlc_codec.h>
 #include <vlc_dialog.h>
 
-#ifdef HAVE_UNISTD_H
-# include <unistd.h>
-#endif
+#include <unistd.h>
 #ifdef _POSIX_VERSION
 # include <glob.h>
 #endif

+ 1 - 3
modules/control/netsync.c

@@ -36,10 +36,8 @@
 #include <vlc_input.h>
 #include <vlc_playlist.h>
 
-#ifdef HAVE_UNISTD_H
-#    include <unistd.h>
-#endif
 #include <sys/types.h>
+#include <unistd.h>
 #ifdef HAVE_POLL
 #   include <poll.h>
 #endif

+ 1 - 3
modules/control/rc.c

@@ -44,10 +44,8 @@
 #include <vlc_playlist.h>
 #include <vlc_keys.h>
 
-#ifdef HAVE_UNISTD_H
-#    include <unistd.h>
-#endif
 #include <sys/types.h>
+#include <unistd.h>
 
 #include <vlc_network.h>
 #include <vlc_url.h>

+ 1 - 3
modules/gui/skins2/src/theme_loader.cpp

@@ -28,9 +28,7 @@
 
 #include <fcntl.h>
 #include <sys/stat.h>
-#ifdef HAVE_UNISTD_H
-#   include <unistd.h>
-#endif
+#include <unistd.h>
 
 #include <vlc_common.h>
 #include <vlc_fs.h>

+ 1 - 5
modules/gui/skins2/src/theme_repository.cpp

@@ -25,11 +25,7 @@
 #include "os_factory.hpp"
 #include "../commands/async_queue.hpp"
 #include "../commands/cmd_dialogs.hpp"
-#ifdef HAVE_UNISTD_H
-#   include <unistd.h>
-#elif defined( _WIN32 )
-#   include <direct.h>
-#endif
+#include <unistd.h>
 
 #include <fstream>
 

+ 2 - 4
modules/services_discovery/podcast.c

@@ -34,11 +34,9 @@
 #include <vlc_services_discovery.h>
 #include <vlc_playlist.h>
 #include <vlc_network.h>
-#include <assert.h>
 
-#ifdef HAVE_UNISTD_H
-#    include <unistd.h>
-#endif
+#include <assert.h>
+#include <unistd.h>
 
 /************************************************************************
  * Macros and definitions

+ 1 - 3
modules/services_discovery/sap.c

@@ -41,9 +41,7 @@
 #include <vlc_charset.h>
 
 #include <errno.h>
-#ifdef HAVE_UNISTD_H
-#    include <unistd.h>
-#endif
+#include <unistd.h>
 #ifdef HAVE_ARPA_INET_H
 # include <arpa/inet.h>
 #endif

+ 2 - 6
modules/stream_out/rtp.c

@@ -48,10 +48,8 @@
 
 #include "rtp.h"
 
-#ifdef HAVE_UNISTD_H
-#   include <sys/types.h>
-#   include <unistd.h>
-#endif
+#include <sys/types.h>
+#include <unistd.h>
 #ifdef HAVE_ARPA_INET_H
 #   include <arpa/inet.h>
 #endif
@@ -683,9 +681,7 @@ static void Close( vlc_object_t * p_this )
 
     if( p_sys->psz_sdp_file != NULL )
     {
-#ifdef HAVE_UNISTD_H
         unlink( p_sys->psz_sdp_file );
-#endif
         free( p_sys->psz_sdp_file );
     }
     free( p_sys->psz_vod_session );

+ 1 - 6
modules/text_renderer/svg.c

@@ -35,12 +35,7 @@
 #include <vlc_filter.h>
 
 #include <sys/types.h>
-
-#ifdef HAVE_UNISTD_H
-#    include <unistd.h>
-#elif defined( _WIN32 )
-#   include <io.h>
-#endif
+#include <unistd.h>
 
 #include <glib.h>
 #include <glib/gstdio.h>

+ 1 - 3
src/config/file.c

@@ -35,9 +35,7 @@
 #elif defined(HAVE_USELOCALE)
 #include <locale.h>
 #endif
-#ifdef HAVE_UNISTD_H
-# include <unistd.h>
-#endif
+#include <unistd.h>
 
 #include <vlc_common.h>
 #include "../libvlc.h"

+ 1 - 3
src/input/es_out_timeshift.c

@@ -35,9 +35,7 @@
 #  include <direct.h>
 #endif
 #include <sys/stat.h>
-#ifdef HAVE_UNISTD_H
-# include <unistd.h>
-#endif
+#include <unistd.h>
 
 #include <vlc_common.h>
 #include <vlc_fs.h>

+ 1 - 3
src/input/subtitles.c

@@ -32,9 +32,7 @@
 #endif
 
 #include <ctype.h> /* isalnum() */
-#ifdef HAVE_UNISTD_H
-#   include <unistd.h>
-#endif
+#include <unistd.h>
 #include <sys/stat.h>
 
 #include <vlc_common.h>

+ 0 - 3
src/interface/interface.c

@@ -38,9 +38,6 @@
 #endif
 
 #include <assert.h>
-#ifdef HAVE_UNISTD_H
-# include <unistd.h>
-#endif
 
 #include <vlc_common.h>
 #include <vlc_modules.h>

+ 1 - 3
src/misc/block.c

@@ -31,9 +31,7 @@
 #include <sys/stat.h>
 #include <assert.h>
 #include <errno.h>
-#ifdef HAVE_UNISTD_H
-# include <unistd.h>
-#endif
+#include <unistd.h>
 #include <fcntl.h>
 
 #include <vlc_common.h>

+ 1 - 3
src/misc/mtime.c

@@ -36,9 +36,7 @@
 #include <vlc_common.h>
 #include <assert.h>
 
-#ifdef HAVE_UNISTD_H
-# include <unistd.h>
-#endif
+#include <unistd.h>
 #if !defined (_POSIX_TIMERS) || defined (_WIN32)
 # define _POSIX_TIMERS (-1)
 #endif

+ 1 - 3
src/modules/bank.c

@@ -35,9 +35,7 @@
 
 #include <sys/types.h>
 #include <sys/stat.h>
-#ifdef HAVE_UNISTD_H
-#   include <unistd.h>
-#endif
+#include <unistd.h>
 
 #include <vlc_common.h>
 #include <vlc_plugin.h>

+ 1 - 3
src/modules/cache.c

@@ -33,9 +33,7 @@
 #include <string.h>
 #include <sys/types.h>
 #include <sys/stat.h>
-#ifdef HAVE_UNISTD_H
-#   include <unistd.h>
-#endif
+#include <unistd.h>
 #include <assert.h>
 
 #include <vlc_common.h>

+ 1 - 4
src/network/httpd.c

@@ -44,10 +44,7 @@
 
 #include <string.h>
 #include <errno.h>
-
-#ifdef HAVE_UNISTD_H
-#   include <unistd.h>
-#endif
+#include <unistd.h>
 
 #ifdef HAVE_POLL
 # include <poll.h>

+ 1 - 3
src/network/io.c

@@ -42,9 +42,7 @@
 #include <assert.h>
 
 #include <fcntl.h>
-#ifdef HAVE_UNISTD_H
-#   include <unistd.h>
-#endif
+#include <unistd.h>
 #ifdef HAVE_POLL
 #   include <poll.h>
 #endif

+ 1 - 4
src/network/tcp.c

@@ -34,10 +34,7 @@
 
 #include <errno.h>
 #include <assert.h>
-
-#ifdef HAVE_UNISTD_H
-#   include <unistd.h>
-#endif
+#include <unistd.h>
 #ifdef HAVE_POLL
 # include <poll.h>
 #endif

+ 1 - 3
src/text/filesystem.c

@@ -38,9 +38,7 @@
 #include <errno.h>
 #include <sys/types.h>
 #include <fcntl.h>
-#ifdef HAVE_UNISTD_H
-# include <unistd.h>
-#endif
+#include <unistd.h>
 
 /**
  * Opens a FILE pointer.