[vlc-devel] commit: Remove IS_WINNT macro (Geoffroy Couprie )

git version control git at videolan.org
Tue Sep 30 12:05:07 CEST 2008


vlc | branch: master | Geoffroy Couprie <geo.couprie at gmail.com> | Mon Sep 29 20:39:52 2008 +0200| [a490cbb698ba53db29b8e8c4eb44a95e627b521b] | committer: Geoffroy Couprie 

Remove IS_WINNT macro

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

 include/vlc_common.h          |    5 --
 include/vlc_threads.h         |   11 ++---
 modules/access/screen/win32.c |    2 +-
 modules/control/ntservice.c   |    3 -
 src/text/unicode.c            |   84 ++++++++++++++++++----------------------
 5 files changed, 44 insertions(+), 61 deletions(-)

diff --git a/include/vlc_common.h b/include/vlc_common.h
index d409082..c4b4f4e 100644
--- a/include/vlc_common.h
+++ b/include/vlc_common.h
@@ -498,11 +498,6 @@ typedef int ( * vlc_callback_t ) ( vlc_object_t *,      /* variable's object */
 #if defined( WIN32 ) || defined( UNDER_CE )
 #   define WIN32_LEAN_AND_MEAN
 #   include <windows.h>
-#   if defined( UNDER_CE )
-#      define IS_WINNT 0
-#   else
-#      define IS_WINNT ( GetVersion() < 0x80000000 )
-#   endif
 #endif
 
 #include "vlc_mtime.h"
diff --git a/include/vlc_threads.h b/include/vlc_threads.h
index de383f1..7b2f07b 100644
--- a/include/vlc_threads.h
+++ b/include/vlc_threads.h
@@ -79,15 +79,14 @@
 /* Define different priorities for WinNT/2K/XP and Win9x/Me */
 #   define VLC_THREAD_PRIORITY_LOW 0
 #   define VLC_THREAD_PRIORITY_INPUT \
-        (IS_WINNT ? THREAD_PRIORITY_ABOVE_NORMAL : 0)
+        THREAD_PRIORITY_ABOVE_NORMAL
 #   define VLC_THREAD_PRIORITY_AUDIO \
-        (IS_WINNT ? THREAD_PRIORITY_HIGHEST : 0)
-#   define VLC_THREAD_PRIORITY_VIDEO \
-        (IS_WINNT ? 0 : THREAD_PRIORITY_BELOW_NORMAL )
+        THREAD_PRIORITY_HIGHEST
+#   define VLC_THREAD_PRIORITY_VIDEO 0
 #   define VLC_THREAD_PRIORITY_OUTPUT \
-        (IS_WINNT ? THREAD_PRIORITY_ABOVE_NORMAL : 0)
+        THREAD_PRIORITY_ABOVE_NORMAL
 #   define VLC_THREAD_PRIORITY_HIGHEST \
-        (IS_WINNT ? THREAD_PRIORITY_TIME_CRITICAL : 0)
+        THREAD_PRIORITY_TIME_CRITICAL
 
 #else
 #   define VLC_THREAD_PRIORITY_LOW 0
diff --git a/modules/access/screen/win32.c b/modules/access/screen/win32.c
index 6b4ddbf..6ffa9f7 100644
--- a/modules/access/screen/win32.c
+++ b/modules/access/screen/win32.c
@@ -264,7 +264,7 @@ block_t *screen_Capture( demux_t *p_demux )
                  p_sys->fmt.video.i_width, p_data->i_fragment_size,
                  p_data->hdc_src, p_sys->i_left, p_sys->i_top +
                  p_data->i_fragment * p_data->i_fragment_size,
-                 IS_WINNT ? SRCCOPY | CAPTUREBLT : SRCCOPY ) )
+                 SRCCOPY | CAPTUREBLT ) )
     {
         msg_Err( p_demux, "error during BitBlt()" );
         return NULL;
diff --git a/modules/control/ntservice.c b/modules/control/ntservice.c
index 4b52a60..7432db8 100644
--- a/modules/control/ntservice.c
+++ b/modules/control/ntservice.c
@@ -107,9 +107,6 @@ static int Activate( vlc_object_t *p_this )
 {
     intf_thread_t *p_intf = (intf_thread_t*)p_this;
 
-    /* Only works on NT/2K/XP */
-    if( !IS_WINNT ) return VLC_EGENERIC;
-
     p_intf->pf_run = Run;
     return VLC_SUCCESS;
 }
diff --git a/src/text/unicode.c b/src/text/unicode.c
index 036027c..2fc7de7 100644
--- a/src/text/unicode.c
+++ b/src/text/unicode.c
@@ -262,25 +262,23 @@ char *ToLocaleDup (const char *utf8)
  */
 int utf8_open (const char *filename, int flags, mode_t mode)
 {
-#if defined (WIN32) || defined (UNDER_CE)
-    if (GetVersion() < 0x80000000)
+#ifdef WIN32
+    /* for Windows NT and above */
+    wchar_t wpath[MAX_PATH + 1];
+
+    if (!MultiByteToWideChar (CP_UTF8, 0, filename, -1, wpath, MAX_PATH))
     {
-        /* for Windows NT and above */
-        wchar_t wpath[MAX_PATH + 1];
+        errno = ENOENT;
+        return -1;
+    }
+    wpath[MAX_PATH] = L'\0';
 
-        if (!MultiByteToWideChar (CP_UTF8, 0, filename, -1, wpath, MAX_PATH))
-        {
-            errno = ENOENT;
-            return -1;
-        }
-        wpath[MAX_PATH] = L'\0';
+    /*
+        * open() cannot open files with non-“ANSI” characters on Windows.
+        * We use _wopen() instead. Same thing for mkdir() and stat().
+        */
+    return _wopen (wpath, flags, mode);
 
-        /*
-         * open() cannot open files with non-“ANSI” characters on Windows.
-         * We use _wopen() instead. Same thing for mkdir() and stat().
-         */
-        return _wopen (wpath, flags, mode);
-    }
 #endif
     const char *local_name = ToLocale (filename);
 
@@ -573,22 +571,19 @@ int utf8_scandir( const char *dirname, char ***namelist,
 static int utf8_statEx( const char *filename, struct stat *buf,
                         bool deref )
 {
-#if defined (WIN32) || defined (UNDER_CE)
-    /* retrieve Windows OS version */
-    if( GetVersion() < 0x80000000 )
+#if defined (WIN32)
+    /* for Windows NT and above */
+    wchar_t wpath[MAX_PATH + 1];
+
+    if( !MultiByteToWideChar( CP_UTF8, 0, filename, -1, wpath, MAX_PATH ) )
     {
-        /* for Windows NT and above */
-        wchar_t wpath[MAX_PATH + 1];
+        errno = ENOENT;
+        return -1;
+    }
+    wpath[MAX_PATH] = L'\0';
 
-        if( !MultiByteToWideChar( CP_UTF8, 0, filename, -1, wpath, MAX_PATH ) )
-        {
-            errno = ENOENT;
-            return -1;
-        }
-        wpath[MAX_PATH] = L'\0';
+    return _wstati64( wpath, buf );
 
-        return _wstati64( wpath, buf );
-    }
 #endif
 #ifdef HAVE_SYS_STAT_H
     const char *local_name = ToLocale( filename );
@@ -636,25 +631,22 @@ int utf8_lstat( const char *filename, struct stat *buf)
  */
 int utf8_unlink( const char *filename )
 {
-#if defined (WIN32) || defined (UNDER_CE)
-    if( GetVersion() < 0x80000000 )
-    {
-        /* for Windows NT and above */
-        wchar_t wpath[MAX_PATH + 1];
+#if defined (WIN32)
+    /* for Windows NT and above */
+    wchar_t wpath[MAX_PATH + 1];
 
-        if( !MultiByteToWideChar( CP_UTF8, 0, filename, -1, wpath, MAX_PATH ) )
-        {
-            errno = ENOENT;
-            return -1;
-        }
-        wpath[MAX_PATH] = L'\0';
-
-        /*
-         * unlink() cannot open files with non-“ANSI” characters on Windows.
-         * We use _wunlink() instead.
-         */
-        return _wunlink( wpath );
+    if( !MultiByteToWideChar( CP_UTF8, 0, filename, -1, wpath, MAX_PATH ) )
+    {
+        errno = ENOENT;
+        return -1;
     }
+    wpath[MAX_PATH] = L'\0';
+
+    /*
+        * unlink() cannot open files with non-“ANSI” characters on Windows.
+        * We use _wunlink() instead.
+        */
+    return _wunlink( wpath );
 #endif
     const char *local_name = ToLocale( filename );
 




More information about the vlc-devel mailing list