diff options
author | Brian Paul <[email protected]> | 2001-06-08 15:46:30 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 2001-06-08 15:46:30 +0000 |
commit | fabc30cfdd6576a1d1edee4ad4ee01e41fabb3fa (patch) | |
tree | a88392d7e0e18d97d9169f61e3d21d81153194c7 /src | |
parent | 36822c50ad84d255f1e7c94b56cfff1cd8bcef85 (diff) |
only copy GLubyte[4] as a GLuint on x86
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/main/macros.h | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/src/mesa/main/macros.h b/src/mesa/main/macros.h index fb9f029ac26..7823654d126 100644 --- a/src/mesa/main/macros.h +++ b/src/mesa/main/macros.h @@ -1,4 +1,4 @@ -/* $Id: macros.h,v 1.22 2001/06/08 12:49:38 brianp Exp $ */ +/* $Id: macros.h,v 1.23 2001/06/08 15:46:30 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -122,27 +122,19 @@ do { \ (DST)[3] = (SRC)[3]; \ } while (0) -#if defined(__sparc__) -/* Using the GLuint cast fails if DST or SRC are not dword-aligned */ +#if defined(__i386__) +#define COPY_4UBV(DST, SRC) \ +do { \ + *((GLuint*)(DST)) = *((GLuint*)(SRC)); \ +} while (0) +#else +/* The GLuint cast might fail if DST or SRC are not dword-aligned (RISC) */ do { \ (DST)[0] = (SRC)[0]; \ (DST)[1] = (SRC)[1]; \ (DST)[2] = (SRC)[2]; \ (DST)[3] = (SRC)[3]; \ } while (0) -#else -#define COPY_4UBV(DST, SRC) \ -do { \ - if (sizeof(GLuint)==4*sizeof(GLubyte)) { \ - *((GLuint*)(DST)) = *((GLuint*)(SRC)); \ - } \ - else { \ - (DST)[0] = (SRC)[0]; \ - (DST)[1] = (SRC)[1]; \ - (DST)[2] = (SRC)[2]; \ - (DST)[3] = (SRC)[3]; \ - } \ -} while (0) #endif #define COPY_2FV( DST, SRC ) \ |