diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2022-03-29 13:40:05 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2022-03-29 13:40:05 (GMT) |
commit | ad983c6d746da6b31a177f9137e0f0fd1b4b46f9 (patch) | |
tree | 98fe02e4ba63f0ec93bb7f8911091cfbbe23d5d8 /generic/tclInt.h | |
parent | e62fbde58cf1c61130e3675d2f262b2939e6599a (diff) | |
download | tcl-ad983c6d746da6b31a177f9137e0f0fd1b4b46f9.zip tcl-ad983c6d746da6b31a177f9137e0f0fd1b4b46f9.tar.gz tcl-ad983c6d746da6b31a177f9137e0f0fd1b4b46f9.tar.bz2 |
Don't bother UINT2PTR, since INT2PTR is just as good.
Diffstat (limited to 'generic/tclInt.h')
-rw-r--r-- | generic/tclInt.h | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/generic/tclInt.h b/generic/tclInt.h index 3f2d1ad..af839fc 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -128,21 +128,24 @@ typedef int ptrdiff_t; * to/from pointer from/to integer of different size". */ -#if !defined(INT2PTR) && !defined(PTR2INT) +#if !defined(INT2PTR) # if defined(HAVE_INTPTR_T) || defined(intptr_t) # define INT2PTR(p) ((void *)(intptr_t)(p)) -# define PTR2INT(p) ((intptr_t)(p)) # else # define INT2PTR(p) ((void *)(p)) +# endif +#endif +#if !defined(PTR2INT) +# if defined(HAVE_INTPTR_T) || defined(intptr_t) +# define PTR2INT(p) ((intptr_t)(p)) +# else # define PTR2INT(p) ((long)(p)) # endif #endif -#if !defined(UINT2PTR) && !defined(PTR2UINT) +#if !defined(PTR2UINT) # if defined(HAVE_UINTPTR_T) || defined(uintptr_t) -# define UINT2PTR(p) ((void *)(uintptr_t)(p)) # define PTR2UINT(p) ((uintptr_t)(p)) # else -# define UINT2PTR(p) ((void *)(p)) # define PTR2UINT(p) ((unsigned long)(p)) # endif #endif |