[vlc-commits] Do not create a console under Wine

Rémi Denis-Courmont git at videolan.org
Thu Jul 28 22:01:15 CEST 2011


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu Jul 28 22:59:20 2011 +0300| [f44e0d5980485116deae6624b10a73c8ae278a29] | committer: Rémi Denis-Courmont

Do not create a console under Wine

Not only is an extra console obnoxious, but freopen() crashes.

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

 include/vlc_interface.h |    4 ++--
 src/libvlc.c            |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/include/vlc_interface.h b/include/vlc_interface.h
index 55cebe6..2e02f6b 100644
--- a/include/vlc_interface.h
+++ b/include/vlc_interface.h
@@ -114,7 +114,7 @@ VLC_API void libvlc_Quit( libvlc_int_t * );
  *****************************************************************************/
 #if defined( WIN32 ) && !defined( UNDER_CE )
 #    define CONSOLE_INTRO_MSG \
-         if( !getenv( "PWD" ) || !getenv( "PS1" ) ) /* detect cygwin shell */ \
+         if( !getenv( "PWD" ) ) /* detect Cygwin shell or Wine */ \
          { \
          AllocConsole(); \
          freopen( "CONOUT$", "w", stdout ); \
@@ -128,7 +128,7 @@ VLC_API void libvlc_Quit( libvlc_int_t * );
                              "directory where you installed VLC and run " \
                              "\"vlc -I qt\"\n") )
 #else
-#    define CONSOLE_INTRO_MSG
+#    define CONSOLE_INTRO_MSG (void)0
 #endif
 
 /* Interface dialog ids for dialog providers */
diff --git a/src/libvlc.c b/src/libvlc.c
index 7c053fc..4a90f9a 100644
--- a/src/libvlc.c
+++ b/src/libvlc.c
@@ -1894,7 +1894,7 @@ static void ShowConsole( bool b_dofile )
 #   ifndef UNDER_CE
     FILE *f_help = NULL;
 
-    if( getenv( "PWD" ) && getenv( "PS1" ) ) return; /* cygwin shell */
+    if( getenv( "PWD" ) ) return; /* Cygwin shell or Wine */
 
     AllocConsole();
     /* Use the ANSI code page (e.g. Windows-1252) as expected by the LibVLC
@@ -1928,7 +1928,7 @@ static void PauseConsole( void )
 {
 #   ifndef UNDER_CE
 
-    if( getenv( "PWD" ) && getenv( "PS1" ) ) return; /* cygwin shell */
+    if( getenv( "PWD" ) ) return; /* Cygwin shell or Wine */
 
     utf8_fprintf( stderr, _("\nPress the RETURN key to continue...\n") );
     getchar();



More information about the vlc-commits mailing list