2 * Macros used to cast between pointers and integers (e.g. when storing an int
3 * in ClientData), on 64-bit architectures they avoid gcc warning about "cast
4 * to/from pointer from/to integer of different size".
7 #if !defined(INT2PTR) && !defined(PTR2INT)
8 # if defined(HAVE_INTPTR_T) || defined(intptr_t)
9 # define INT2PTR(p) ((void *)(intptr_t)(p))
10 # define PTR2INT(p) ((int)(intptr_t)(p))
12 # define INT2PTR(p) ((void *)(p))
13 # define PTR2INT(p) ((int)(p))
16 #if !defined(UINT2PTR) && !defined(PTR2UINT)
17 # if defined(HAVE_UINTPTR_T) || defined(uintptr_t)
18 # define UINT2PTR(p) ((void *)(uintptr_t)(p))
19 # define PTR2UINT(p) ((unsigned int)(uintptr_t)(p))
21 # define UINT2PTR(p) ((void *)(p))
22 # define PTR2UINT(p) ((unsigned int)(p))