summaryrefslogtreecommitdiff
path: root/perl.h
diff options
context:
space:
mode:
authorRobin Barker <RMBarker@cpan.org>2005-07-28 14:57:31 +0100
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2005-07-28 12:59:55 +0000
commite91e3b10e63de8f75d881ff2701d550f199a5a25 (patch)
tree0e22bef5697a788842f8129d02f7031f7a26c13c /perl.h
parente24bffee9086641f77b10c82b8a314dbe095fbbe (diff)
downloadperl-e91e3b10e63de8f75d881ff2701d550f199a5a25.tar.gz
silence compiler warning in mg.c POSIX.xs
Message-ID: <533D273D4014D411AB1D00062938C4D90849C75B@hotel.npl.co.uk> p4raw-id: //depot/perl@25236
Diffstat (limited to 'perl.h')
-rw-r--r--perl.h19
1 files changed, 12 insertions, 7 deletions
diff --git a/perl.h b/perl.h
index 63eba706a1..73979b6bf9 100644
--- a/perl.h
+++ b/perl.h
@@ -1497,20 +1497,25 @@ typedef UVTYPE UV;
#else
# if PTRSIZE == LONGSIZE
# define PTRV unsigned long
+# define PTR2ul(p) (unsigned long)(p)
# else
# define PTRV unsigned
# endif
+#endif
+
+#ifndef INT2PTR
# define INT2PTR(any,d) (any)(PTRV)(d)
#endif
+
+#ifndef PTR2ul
+# define PTR2ul(p) INT2PTR(unsigned long,p)
+#endif
+
#define NUM2PTR(any,d) (any)(PTRV)(d)
#define PTR2IV(p) INT2PTR(IV,p)
#define PTR2UV(p) INT2PTR(UV,p)
#define PTR2NV(p) NUM2PTR(NV,p)
-#if PTRSIZE == LONGSIZE
-# define PTR2ul(p) (unsigned long)(p)
-#else
-# define PTR2ul(p) INT2PTR(unsigned long,p)
-#endif
+#define PTR2nat(p) (PTRV)(p) /* pointer to integer of PTRSIZE */
/* According to strict ANSI C89 one cannot freely cast between
* data pointers and function (code) pointers. There are at least
@@ -1522,8 +1527,8 @@ typedef UVTYPE UV;
* The only feasible use is probably temporarily storing
* function pointers in a data pointer (such as a void pointer). */
-#define DPTR2FPTR(t,p) ((t)(PTRV)(p)) /* data pointer to function pointer */
-#define FPTR2DPTR(t,p) ((t)(PTRV)(p)) /* function pointer to data pointer */
+#define DPTR2FPTR(t,p) ((t)PTR2nat(p)) /* data pointer to function pointer */
+#define FPTR2DPTR(t,p) ((t)PTR2nat(p)) /* function pointer to data pointer */
#ifdef USE_LONG_DOUBLE
# if defined(HAS_LONG_DOUBLE) && LONG_DOUBLESIZE == DOUBLESIZE