[cvs] / xvidcore / src / portab.h Repository:
ViewVC logotype

Diff of /xvidcore/src/portab.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.21, Fri Jun 14 13:29:07 2002 UTC revision 1.23, Sun Jun 30 10:46:29 2002 UTC
# Line 1  Line 1 
1  #ifndef _PORTAB_H_  #ifndef _PORTAB_H_
2  #define _PORTAB_H_  #define _PORTAB_H_
3    
4    
5    // debug level masks
6    #define DPRINTF_ERROR           0x00000001
7    #define DPRINTF_STARTCODE       0x00000002
8    #define DPRINTF_HEADER          0x00000004
9    #define DPRINTF_TIMECODE        0x00000008
10    #define DPRINTF_MB                      0x00000010
11    #define DPRINTF_COEFF           0x00000020
12    #define DPRINTF_MV                      0x00000040
13    #define DPRINTF_DEBUG           0x80000000
14    
15    // debug level
16    #define DPRINTF_LEVEL           0
17    
18    
19    #define DPRINTF_BUF_SZ  1024
20    
21    
22  #if defined(WIN32)  #if defined(WIN32)
23    
24  #include <windows.h>  #include <windows.h>
25  #include <stdio.h>  #include <stdio.h>
26    
27    static __inline void
28  #define DPRINTF_BUF_SZ  1024  DPRINTF(int level, char *fmt,
 static void  
 dprintf(char *fmt,  
29                  ...)                  ...)
30  {  {
31            if ((DPRINTF_LEVEL & level))
32            {
33          va_list args;          va_list args;
34          char buf[DPRINTF_BUF_SZ];          char buf[DPRINTF_BUF_SZ];
35    
# Line 19  Line 37 
37          vsprintf(buf, fmt, args);          vsprintf(buf, fmt, args);
38          OutputDebugString(buf);          OutputDebugString(buf);
39          fprintf(stdout, "%s\n", buf);          fprintf(stdout, "%s\n", buf);
40                    fflush(stdout);
41            }
42  }  }
43    
44    
# Line 87  Line 107 
107    
108  #elif defined(LINUX) || defined(DJGPP) || defined(FREEBSD)  #elif defined(LINUX) || defined(DJGPP) || defined(FREEBSD)
109    
110    #include <stdio.h>
111    #include <stdarg.h>
112    
113    static __inline void
114    DPRINTF(int level, char *fmt,
115                    ...)
116    {
117            if ((DPRINTF_LEVEL & level)) {
118                    va_list args;
119                    char buf[DPRINTF_BUF_SZ];
120    
121                    va_start(args, fmt);
122                    vsprintf(buf, fmt, args);
123                    fprintf(stdout, "%s\n", buf);
124            }
125    }
126    
127  #ifdef _DEBUG  #ifdef _DEBUG
128    
129  #include <stdio.h>  #include <stdio.h>
# Line 215  Line 252 
252    
253  #else                                                   // OTHER OS  #else                                                   // OTHER OS
254    
255    
256    #include <stdio.h>
257    #include <stdarg.h>
258    
259    static __inline void
260    DPRINTF(int level, char *fmt, ...)
261    {
262            if ((DPRINTF_LEVEL & level)) {
263    
264                    va_list args;
265                    char buf[DPRINTF_BUF_SZ];
266    
267                    va_start(args, fmt);
268                    vsprintf(buf, fmt, args);
269                    fprintf(stdout, "%s\n", buf);
270            }
271    }
272    
273    
274  #define DEBUG(S)  #define DEBUG(S)
275  #define DEBUG1(S,I)  #define DEBUG1(S,I)
276  #define DEBUG2(X,A,B)  #define DEBUG2(X,A,B)

Legend:
Removed from v.1.21  
changed lines
  Added in v.1.23

No admin address has been configured
ViewVC Help
Powered by ViewVC 1.0.4