summaryrefslogtreecommitdiff
path: root/src/gallium/include/pipe/p_util.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/include/pipe/p_util.h')
-rw-r--r--src/gallium/include/pipe/p_util.h44
1 files changed, 9 insertions, 35 deletions
diff --git a/src/gallium/include/pipe/p_util.h b/src/gallium/include/pipe/p_util.h
index d7da2801c9..3b32ba1d24 100644
--- a/src/gallium/include/pipe/p_util.h
+++ b/src/gallium/include/pipe/p_util.h
@@ -30,16 +30,17 @@
#include "p_compiler.h"
#include "p_debug.h"
+#include "p_pointer.h"
#include <math.h>
-#ifdef WIN32
-
#ifdef __cplusplus
-extern "C"
-{
+extern "C" {
#endif
+
+#ifdef WIN32
+
void * __stdcall
EngAllocMem(
unsigned long Flags,
@@ -50,10 +51,6 @@ void __stdcall
EngFreeMem(
void *Mem );
-#ifdef __cplusplus
-}
-#endif
-
static INLINE void *
MALLOC( unsigned size )
{
@@ -115,33 +112,6 @@ REALLOC( void *old_ptr, unsigned old_size, unsigned new_size )
/**
- * Return a pointer aligned to next multiple of N bytes.
- */
-static INLINE void *
-align_pointer( void *unaligned, uint alignment )
-{
- if (sizeof(void *) == 64) {
- union {
- void *p;
- uint64 u;
- } pu;
- pu.p = unaligned;
- pu.u = (pu.u + alignment - 1) & ~(uint64) (alignment - 1);
- return pu.p;
- }
- else {
- /* 32-bit pointers */
- union {
- void *p;
- uint u;
- } pu;
- pu.p = unaligned;
- pu.u = (pu.u + alignment - 1) & ~(alignment - 1);
- return pu.p;
- }
-}
-
-/**
* Return memory on given byte alignment
*/
static INLINE void *
@@ -405,4 +375,8 @@ extern void pipe_copy_rect(ubyte * dst, unsigned cpp, unsigned dst_pitch,
int src_pitch, unsigned src_x, int src_y);
+#ifdef __cplusplus
+}
+#endif
+
#endif