comparison mp_msg.c @ 8573:b2e4f9dab7ad

codec-cfg cannot be built when the gui is enabled - it fails to link with a couple of undefined external references. Problem is that mp_msg.c is included in the codec-cfg binary, but for codec-cfg the gui code in mp_msg.c shouldn't be compiled in.
author jkeil
date Fri, 27 Dec 2002 16:17:57 +0000
parents 9d11474c39af
children c1247b33c424
comparison
equal deleted inserted replaced
8572:46dbfa8c1999 8573:b2e4f9dab7ad
5 #include <stdlib.h> 5 #include <stdlib.h>
6 #include <stdarg.h> 6 #include <stdarg.h>
7 7
8 #include "config.h" 8 #include "config.h"
9 9
10 #ifdef HAVE_NEW_GUI 10 #if defined(FOR_MENCODER) || defined(CODECS2HTML)
11 #undef ENABLE_GUI_CODE
12 #elif defined(HAVE_NEW_GUI)
13 #define ENABLE_GUI_CODE HAVE_NEW_GUI
14 #else
15 #undef ENABLE_GUI_CODE
16 #endif
17
18 #if ENABLE_GUI_CODE
11 #include "Gui/mplayer/widgets.h" 19 #include "Gui/mplayer/widgets.h"
12 extern void gtkMessageBox( int type,char * str ); 20 extern void gtkMessageBox( int type,char * str );
13 extern int use_gui; 21 extern int use_gui;
14 #endif 22 #endif
15 #include "mp_msg.h" 23 #include "mp_msg.h"
56 va_start(va, format); 64 va_start(va, format);
57 vsnprintf(tmp, MSGSIZE_MAX, mp_gettext(format), va); 65 vsnprintf(tmp, MSGSIZE_MAX, mp_gettext(format), va);
58 va_end(va); 66 va_end(va);
59 tmp[MSGSIZE_MAX-1] = 0; 67 tmp[MSGSIZE_MAX-1] = 0;
60 68
61 #if defined(HAVE_NEW_GUI) && !defined(FOR_MENCODER) 69 #if ENABLE_GUI_CODE
62 if(use_gui) 70 if(use_gui)
63 { 71 {
64 switch(x & 255) 72 switch(x & 255)
65 { 73 {
66 case MSGL_FATAL: 74 case MSGL_FATAL:
104 112
105 #else 113 #else
106 va_list va; 114 va_list va;
107 if((x&255)>mp_msg_levels[x>>8]) return; // do not display 115 if((x&255)>mp_msg_levels[x>>8]) return; // do not display
108 va_start(va, format); 116 va_start(va, format);
109 #if defined( HAVE_NEW_GUI ) && !defined( FOR_MENCODER ) 117 #if ENABLE_GUI_CODE
110 if(use_gui){ 118 if(use_gui){
111 char tmp[16*80]; 119 char tmp[16*80];
112 vsnprintf( tmp,8*80,format,va ); tmp[8*80-1]=0; 120 vsnprintf( tmp,8*80,format,va ); tmp[8*80-1]=0;
113 switch( x&255 ) { 121 switch( x&255 ) {
114 case MSGL_FATAL: 122 case MSGL_FATAL: