summaryrefslogtreecommitdiffstats
path: root/generic/tkInt.h
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2007-10-15 18:38:32 (GMT)
committerdgp <dgp@users.sourceforge.net>2007-10-15 18:38:32 (GMT)
commitc1bdc631fe9cbf391d13b23956e038bef596cbbf (patch)
treee3487a278609005db397864c3267df8c395d36ba /generic/tkInt.h
parent1b633c1a2c27d0385c2c8ceaa76592f1257ab869 (diff)
downloadtk-c1bdc631fe9cbf391d13b23956e038bef596cbbf.zip
tk-c1bdc631fe9cbf391d13b23956e038bef596cbbf.tar.gz
tk-c1bdc631fe9cbf391d13b23956e038bef596cbbf.tar.bz2
merge updates from HEAD
Diffstat (limited to 'generic/tkInt.h')
-rw-r--r--generic/tkInt.h27
1 files changed, 26 insertions, 1 deletions
diff --git a/generic/tkInt.h b/generic/tkInt.h
index ee44aab..29a476f 100644
--- a/generic/tkInt.h
+++ b/generic/tkInt.h
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: $Id: tkInt.h,v 1.77.2.1 2007/06/25 19:12:13 dgp Exp $
+ * RCS: $Id: tkInt.h,v 1.77.2.2 2007/10/15 18:38:33 dgp Exp $
*/
#ifndef _TKINT
@@ -67,6 +67,31 @@
#endif
/*
+ * Macros used to cast between pointers and integers (e.g. when storing an int
+ * in ClientData), on 64-bit architectures they avoid gcc warning about "cast
+ * to/from pointer from/to integer of different size".
+ */
+
+#if !defined(INT2PTR) && !defined(PTR2INT)
+# if defined(HAVE_INTPTR_T) || defined(intptr_t)
+# define INT2PTR(p) ((void*)(intptr_t)(p))
+# define PTR2INT(p) ((int)(intptr_t)(p))
+# else
+# define INT2PTR(p) ((void*)(p))
+# define PTR2INT(p) ((int)(p))
+# endif
+#endif
+#if !defined(UINT2PTR) && !defined(PTR2UINT)
+# if defined(HAVE_UINTPTR_T) || defined(uintptr_t)
+# define UINT2PTR(p) ((void*)(uintptr_t)(p))
+# define PTR2UINT(p) ((unsigned int)(uintptr_t)(p))
+# else
+# define UINT2PTR(p) ((void*)(p))
+# define PTR2UINT(p) ((unsigned int)(p))
+# endif
+#endif
+
+/*
* Opaque type declarations:
*/