]> git.sesse.net Git - vlc/commitdiff
Do not create a console under Wine
authorRémi Denis-Courmont <remi@remlab.net>
Thu, 28 Jul 2011 19:59:20 +0000 (22:59 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Thu, 28 Jul 2011 20:00:42 +0000 (23:00 +0300)
Not only is an extra console obnoxious, but freopen() crashes.

include/vlc_interface.h
src/libvlc.c

index 55cebe696eb4d6c8c11564101eff9c45f16a5b73..2e02f6baa604a903f50ffda753df8ba00758c1bb 100644 (file)
@@ -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 */
index 7c053fc21423c9943c03a2ffa9cbf285d499152a..4a90f9a9b738514c198d7b7e9b0353446e7e96d7 100644 (file)
@@ -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();