[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.26.2.5, Sun Jan 5 03:31:26 2003 UTC revision 1.26.2.8, Sat Feb 15 08:39:17 2003 UTC
# Line 76  Line 76 
76    
77  /* debug level for this library */  /* debug level for this library */
78  #ifdef _DEBUG  #ifdef _DEBUG
79  #define DPRINTF_LEVEL           (DPRINTF_RC|0x0000000f)  #define DPRINTF_LEVEL           (DPRINTF_RC|0x0000007F)
80  #else  #else
81  #define DPRINTF_LEVEL           DPRINTF_RC  #define DPRINTF_LEVEL           DPRINTF_RC
82  #endif  #endif
# Line 101  Line 101 
101   | msvc (lacks such a header file)   | msvc (lacks such a header file)
102   *---------------------------------------------------------------------------*/   *---------------------------------------------------------------------------*/
103    
104  #elif defined(_MSC_VER)  #elif defined(_MSC_VER) || defined (__WATCOMC__)
105  #    define int8_t   char  #    define int8_t   char
106  #    define uint8_t  unsigned char  #    define uint8_t  unsigned char
107  #    define int16_t  short  #    define int16_t  short
# Line 167  Line 167 
167  #include <windows.h>  #include <windows.h>
168  #include <stdio.h>  #include <stdio.h>
169    
170            /* non-ansi function mapping */
171    #       define snprintf _snprintf
172    #       define vsnprintf _vsnprintf
173    
174      /*      /*
175       * This function must be declared/defined all the time because MSVC does       * This function must be declared/defined all the time because MSVC does
176       * not support C99 variable arguments macros       * not support C99 variable arguments macros
# Line 363  Line 367 
367  #    endif /* Architecture checking */  #    endif /* Architecture checking */
368    
369  /*****************************************************************************  /*****************************************************************************
370     *  OPEN WATCOM C/C++ compiler
371     ****************************************************************************/
372    #elif defined(__WATCOMC__)
373    
374    #       include <stdio.h>
375    #       include <stdarg.h>
376    
377        static __inline void DPRINTF(int level, char *fmt, ...)
378        {
379                    if (DPRINTF_LEVEL & level) {
380                va_list args;
381                char buf[DPRINTF_BUF_SZ];
382                va_start(args, fmt);
383                vsprintf(buf, fmt, args);
384                            fprintf(stderr, "%s\n", buf);
385                    }
386            }
387    
388    #       define DECLARE_ALIGNED_MATRIX(name,sizex,sizey,type,alignment) \
389                    type name##_storage[(sizex)*(sizey)+(alignment)-1]; \
390                    type * name = (type *) (((int32_t) name##_storage+(alignment - 1)) & ~((int32_t)(alignment)-1))
391    
392    /*----------------------------------------------------------------------------
393     | watcom x86 specific macros/functions
394     *---------------------------------------------------------------------------*/
395    #       if defined(ARCH_X86)
396    
397    #               define BSWAP(a)  __asm mov eax,a __asm bswap eax __asm mov a, eax
398    
399                    static __inline int64_t read_counter(void)
400                    {
401                            int64_t ts;
402                            uint32_t ts1, ts2;
403                            __asm {
404                                    rdtsc
405                                    mov ts1, eax
406                                    mov ts2, edx
407                            }
408                            ts = ((uint64_t) ts2 << 32) | ((uint64_t) ts1);
409                            return ts;
410                    }
411    
412    /*----------------------------------------------------------------------------
413     | watcom unsupported architecture
414     *---------------------------------------------------------------------------*/
415    #       else
416    
417    #               define BSWAP(x) \
418                            x = ((((x) & 0xff000000) >> 24) | \
419                                    (((x) & 0x00ff0000) >>  8) | \
420                                    (((x) & 0x0000ff00) <<  8) | \
421                                    (((x) & 0x000000ff) << 24))
422    
423                    static int64_t read_counter() { return 0; }
424    
425    #       endif
426    /*****************************************************************************
427   *  Unknown compiler   *  Unknown compiler
428   ****************************************************************************/   ****************************************************************************/
429  #else /* Compiler test */  #else /* Compiler test */

Legend:
Removed from v.1.26.2.5  
changed lines
  Added in v.1.26.2.8

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