[vlc-devel] commit: Remove useless (very partially used) check for errno.h ( Rémi Denis-Courmont )

git version control git at videolan.org
Fri Apr 10 17:03:01 CEST 2009


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Fri Apr 10 16:31:25 2009 +0300| [4fb633f74495deba6b5fe78fc7a3c5b74c583bb1] | committer: Rémi Denis-Courmont 

Remove useless (very partially used) check for errno.h

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=4fb633f74495deba6b5fe78fc7a3c5b74c583bb1
---

 configure.ac                |    2 +-
 modules/access/cdda.c       |    2 --
 modules/access/cdda/info.c  |    4 +---
 modules/control/http/http.h |    4 +---
 modules/demux/mp4/drms.c    |   12 +++---------
 src/extras/dirent.c         |   12 +-----------
 6 files changed, 7 insertions(+), 29 deletions(-)

diff --git a/configure.ac b/configure.ac
index 5a1666a..d7a435f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -829,7 +829,7 @@ AC_EGREP_HEADER(strncasecmp,strings.h,[
   AC_MSG_RESULT(no)])
 
 dnl Check for headers
-AC_CHECK_HEADERS(time.h errno.h stdint.h getopt.h strings.h locale.h)
+AC_CHECK_HEADERS(time.h stdint.h getopt.h strings.h locale.h)
 AC_CHECK_HEADERS(sys/sockio.h fcntl.h sys/types.h sys/time.h sys/times.h sys/ioctl.h sys/stat.h xlocale.h)
 AC_CHECK_HEADERS([arpa/inet.h netinet/in.h netinet/udplite.h sys/eventfd.h])
 AC_CHECK_HEADERS([net/if.h], [], [],
diff --git a/modules/access/cdda.c b/modules/access/cdda.c
index f4d980f..5bddc08 100644
--- a/modules/access/cdda.c
+++ b/modules/access/cdda.c
@@ -50,9 +50,7 @@
 #include <cddb/cddb.h>
 #endif
 
-#ifdef HAVE_ERRNO_H
 #include <errno.h>
-#endif
 
 /*****************************************************************************
  * Module descriptior
diff --git a/modules/access/cdda/info.c b/modules/access/cdda/info.c
index 9aec7ae..78c7f76 100644
--- a/modules/access/cdda/info.c
+++ b/modules/access/cdda/info.c
@@ -36,9 +36,7 @@
 #include <cdio/cd_types.h>
 #include "info.h"
 
-#ifdef HAVE_ERRNO_H
-#   include <errno.h>
-#endif
+#include <errno.h>
 #include <assert.h>
 
 static char *CDDAFormatStr( const access_t *p_access, cdda_data_t *p_cdda,
diff --git a/modules/control/http/http.h b/modules/control/http/http.h
index f069ee4..038b36b 100644
--- a/modules/control/http/http.h
+++ b/modules/control/http/http.h
@@ -48,9 +48,7 @@
 #ifdef HAVE_SYS_STAT_H
 #   include <sys/stat.h>
 #endif
-#ifdef HAVE_ERRNO_H
-#   include <errno.h>
-#endif
+#include <errno.h>
 #ifdef HAVE_FCNTL_H
 #   include <fcntl.h>
 #endif
diff --git a/modules/demux/mp4/drms.c b/modules/demux/mp4/drms.c
index 9cacb52..ca4d9c6 100644
--- a/modules/demux/mp4/drms.c
+++ b/modules/demux/mp4/drms.c
@@ -41,9 +41,7 @@
 #   include <stdio.h>
 #endif
 
-#ifdef HAVE_ERRNO_H
-#   include <errno.h>
-#endif
+#include <errno.h>
 
 #ifdef WIN32
 #   if !defined( UNDER_CE )
@@ -1573,14 +1571,10 @@ static int WriteUserKey( void *_p_drms, uint32_t *p_user_key )
     snprintf( psz_path, PATH_MAX - 1,
               "%s/" DRMS_DIRNAME, p_drms->psz_homedir );
 
-#if defined( HAVE_ERRNO_H )
-#   if defined( WIN32 )
+#if defined( WIN32 )
     if( !mkdir( psz_path ) || errno == EEXIST )
-#   else
-    if( !mkdir( psz_path, 0755 ) || errno == EEXIST )
-#   endif
 #else
-    if( !mkdir( psz_path ) )
+    if( !mkdir( psz_path, 0755 ) || errno == EEXIST )
 #endif
     {
         snprintf( psz_path, PATH_MAX - 1, "%s/" DRMS_DIRNAME "/%08X.%03d",
diff --git a/src/extras/dirent.c b/src/extras/dirent.c
index d0a0f33..d19b762 100644
--- a/src/extras/dirent.c
+++ b/src/extras/dirent.c
@@ -20,17 +20,7 @@
 #include <stdlib.h>
 #include <stdio.h>
 
-#ifdef HAVE_ERRNO_H
-#   include <errno.h>
-#else
-    static int errno;
-    /* FIXME: anything clever to put here? */
-#   define EFAULT 12
-#   define ENOTDIR 12
-#   define ENOENT 12
-#   define ENOMEM 12
-#   define EINVAL 12
-#endif
+#include <errno.h>
 #include <string.h>
 #ifndef UNDER_CE
 #   include <io.h>




More information about the vlc-devel mailing list