core/sourcehook/sh_memory.h
changeset 654 b91f45b92fe5
parent 633 153e2d943cc3
child 684 8015336442cb
     1.1 --- a/core/sourcehook/sh_memory.h	Mon Dec 29 11:42:44 2008 -0600
     1.2 +++ b/core/sourcehook/sh_memory.h	Wed Feb 25 22:40:11 2009 -0600
     1.3 @@ -26,6 +26,7 @@
     1.4  #		include <stdio.h>
     1.5  #		include <signal.h>
     1.6  #		include <setjmp.h>
     1.7 +#		include <stdint.h>
     1.8  // http://www.die.net/doc/linux/man/man2/mprotect.2.html
     1.9  #		include <limits.h>
    1.10  #		ifndef PAGESIZE
    1.11 @@ -37,8 +38,8 @@
    1.12  
    1.13  // We need to align addr down to pagesize on linux
    1.14  // We assume PAGESIZE is a power of two
    1.15 -#		define SH_LALIGN(x) (void*)((intptr_t)(x) & ~(PAGESIZE-1))
    1.16 -#		define SH_LALDIF(x) ((intptr_t)(x) % PAGESIZE)
    1.17 +#		define SH_LALIGN(x) (void*)((uintptr_t)(x) & ~(PAGESIZE-1))
    1.18 +#		define SH_LALDIF(x) ((uintptr_t)(x) % PAGESIZE)
    1.19  # else
    1.20  #		error Unsupported OS/Compiler
    1.21  # endif