INT2PTR/PTR2IV defined twice.
Jarkko Hietaniemi [Thu, 30 May 2002 19:40:14 +0000 (19:40 +0000)]
p4raw-id: //depot/perl@16900

ext/Devel/PPPort/PPPort.pm

index ea3bdc2..1b4d585 100644 (file)
@@ -434,14 +434,44 @@ __DATA__
 #    define aTHX_
 #endif         
 
-#ifndef PTR2IV
-#    define PTR2IV(d)   (IV)(d)
+#ifndef UVSIZE
+#   define UVSIZE IVSIZE
 #endif
+
+#ifndef NVTYPE
+#   if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
+#       define NVTYPE long double
+#   else
+#       define NVTYPE double
+#   endif
+typedef NVTYPE NV;
+#endif
+
 #ifndef INT2PTR
-#    define INT2PTR(any,d)      (any)(d)
+
+#if (IVSIZE == PTRSIZE) && (UVSIZE == PTRSIZE)
+#  define PTRV                  UV
+#  define INT2PTR(any,d)        (any)(d)
+#else
+#  if PTRSIZE == LONGSIZE
+#    define PTRV                unsigned long
+#  else
+#    define PTRV                unsigned
+#  endif
+#  define INT2PTR(any,d)        (any)(PTRV)(d)
+#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
 
+#endif /* !INT2PTR */
+
 #ifndef boolSV
 #      define boolSV(b) ((b) ? &PL_sv_yes : &PL_sv_no)
 #endif
@@ -668,44 +698,6 @@ SV *sv;
 #   endif
 #endif
 
-#ifndef UVSIZE
-#   define UVSIZE IVSIZE
-#endif
-
-#ifndef NVTYPE
-#   if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
-#       define NVTYPE long double
-#   else
-#       define NVTYPE double
-#   endif
-typedef NVTYPE NV;
-#endif
-
-#ifndef INT2PTR
-
-#if (IVSIZE == PTRSIZE) && (UVSIZE == PTRSIZE)
-#  define PTRV                  UV
-#  define INT2PTR(any,d)        (any)(d)
-#else
-#  if PTRSIZE == LONGSIZE
-#    define PTRV                unsigned long
-#  else
-#    define PTRV                unsigned
-#  endif
-#  define INT2PTR(any,d)        (any)(PTRV)(d)
-#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
-
-#endif /* !INT2PTR */
-
 #ifndef AvFILLp                        /* Older perls (<=5.003) lack AvFILLp */
 #   define AvFILLp AvFILL
 #endif