OSDN Git Service

Please enter the commit message for your changes. Lines starting
[eos/base.git] / util / src / TclTk / tcl8.6.12 / pkgs / tdbcmysql1.1.3 / generic / int2ptr_ptr2int.h
1 /*
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".
5  */
6
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))
11 #   else
12 #       define INT2PTR(p) ((void *)(p))
13 #       define PTR2INT(p) ((int)(p))
14 #   endif
15 #endif
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))
20 #   else
21 #       define UINT2PTR(p) ((void *)(p))
22 #       define PTR2UINT(p) ((unsigned int)(p))
23 #   endif
24 #endif