Re: [AD] PATCH: updated mprotect patch for allegro-4.2.1 which also work on Linux |
[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]
Chris wrote:On Sunday 12 March 2006 01:08, Hans de Goede wrote:+ char *p = (char *)((unsigned long)_scratch_mem & ~(PAGE_SIZE-1ul));C99 and Allegro define uintptr_t for casting pointers to int types. Would probably be better if you used that instead.Makes no difference this always hold: sizeof(long) == sizeof(void *) Regards, Hans
No, this does not hold for 64 bit windows, where sizeof(void *) = 8 and sizeof(long) = 4 (the 64 bit datatype is long long, and not long as in 64 bit linux). The portable way would be using uintptr_t as suggested.
Mail converted by MHonArc 2.6.19+ | http://listengine.tuxfamily.org/ |