gallium: WinCE portability fixes.

This commit is contained in:
José Fonseca
2008-03-10 13:04:13 +00:00
parent b041dbe901
commit b721bc8792
6 changed files with 24 additions and 6 deletions

View File

@@ -129,7 +129,7 @@ static void unfilled_tri( struct draw_stage *stage,
points( stage, header ); points( stage, header );
break; break;
default: default:
abort(); assert(0);
} }
} }

View File

@@ -57,11 +57,15 @@ int rpl_vsnprintf(char *, size_t, const char *, va_list);
void debug_vprintf(const char *format, va_list ap) void debug_vprintf(const char *format, va_list ap)
{ {
#ifdef WIN32 #ifdef WIN32
#ifndef WINCE
/* EngDebugPrint does not handle float point arguments, so we need to use /* EngDebugPrint does not handle float point arguments, so we need to use
* our own vsnprintf implementation */ * our own vsnprintf implementation */
char buf[512 + 1]; char buf[512 + 1];
rpl_vsnprintf(buf, sizeof(buf), format, ap); rpl_vsnprintf(buf, sizeof(buf), format, ap);
rpl_EngDebugPrint("%s", buf); rpl_EngDebugPrint("%s", buf);
#else
/* TODO: Implement debug print for WINCE */
#endif
#else #else
vfprintf(stderr, format, ap); vfprintf(stderr, format, ap);
#endif #endif
@@ -80,7 +84,11 @@ void debug_printf(const char *format, ...)
static INLINE void debug_abort(void) static INLINE void debug_abort(void)
{ {
#ifdef WIN32 #ifdef WIN32
#ifndef WINCE
EngDebugBreak(); EngDebugBreak();
#else
_asm {int 3};
#endif
#else #else
abort(); abort();
#endif #endif

View File

@@ -72,7 +72,7 @@ alpha_test_quad(struct quad_stage *qs, struct quad_header *quad)
passMask = MASK_ALL; passMask = MASK_ALL;
break; break;
default: default:
abort(); assert(0);
} }
quad->mask &= passMask; quad->mask &= passMask;

View File

@@ -392,7 +392,7 @@ blend_quad(struct quad_stage *qs, struct quad_header *quad)
assert(0); /* to do */ assert(0); /* to do */
break; break;
default: default:
abort(); assert(0);
} }
/* /*
@@ -464,7 +464,7 @@ blend_quad(struct quad_stage *qs, struct quad_header *quad)
} }
break; break;
default: default:
abort(); assert(0);
} }
@@ -716,7 +716,7 @@ blend_quad(struct quad_stage *qs, struct quad_header *quad)
VEC4_MAX(quadColor[3], source[3], dest[3]); /* A */ VEC4_MAX(quadColor[3], source[3], dest[3]); /* A */
break; break;
default: default:
abort(); assert(0);
} }
/* pass blended quad to next stage */ /* pass blended quad to next stage */

View File

@@ -185,7 +185,7 @@ sp_depth_test_quad(struct quad_stage *qs, struct quad_header *quad)
zmask = MASK_ALL; zmask = MASK_ALL;
break; break;
default: default:
abort(); assert(0);
} }
quad->mask &= zmask; quad->mask &= zmask;

View File

@@ -54,7 +54,12 @@ EngFreeMem(
static INLINE void * static INLINE void *
MALLOC( unsigned size ) MALLOC( unsigned size )
{ {
#ifdef WINCE
/* TODO: Need to abstract this */
return malloc( size );
#else
return EngAllocMem( 0, size, 'D3AG' ); return EngAllocMem( 0, size, 'D3AG' );
#endif
} }
static INLINE void * static INLINE void *
@@ -71,7 +76,12 @@ static INLINE void
FREE( void *ptr ) FREE( void *ptr )
{ {
if( ptr ) { if( ptr ) {
#ifdef WINCE
/* TODO: Need to abstract this */
free( ptr );
#else
EngFreeMem( ptr ); EngFreeMem( ptr );
#endif
} }
} }