]> git.vpit.fr Git - perl/modules/Thread-Cleanup.git/commitdiff
{ENTER,LEAVE}_with_name are no longer needed starting perl 5.11.4
authorVincent Pit <vince@profvince.com>
Thu, 15 Apr 2010 23:28:52 +0000 (01:28 +0200)
committerVincent Pit <vince@profvince.com>
Thu, 15 Apr 2010 23:28:52 +0000 (01:28 +0200)
Cleanup.xs

index 948c38f767fa36330cb694dcb32f8c98386eb615..f41b2c865dc029904c2bf5d7c4f9badb1302f1f9 100644 (file)
@@ -9,12 +9,20 @@
 #define __PACKAGE__     "Thread::Cleanup"
 #define __PACKAGE_LEN__ (sizeof(__PACKAGE__)-1)
 
-#ifndef ENTER_with_name
-# define ENTER_with_name(N) ENTER
+#define TC_HAS_PERL(R, V, S) (PERL_REVISION > (R) || (PERL_REVISION == (R) && (PERL_VERSION > (V) || (PERL_VERSION == (V) && (PERL_SUBVERSION >= (S))))))
+
+#undef ENTERn
+#if defined(ENTER_with_name) && !TC_HAS_PERL(5, 11, 4)
+# define ENTERn(N) ENTER_with_name(N)
+#else
+# define ENTERn(N) ENTER
 #endif
 
-#ifndef LEAVE_with_name
-# define LEAVE_with_name(N) LEAVE
+#undef LEAVEn
+#if defined(LEAVE_with_name) && !TC_HAS_PERL(5, 11, 4)
+# define LEAVEn(N) LEAVE_with_name(N)
+#else
+# define LEAVEn(N) LEAVE
 #endif
 
 STATIC void tc_callback(pTHX_ void *);
@@ -60,7 +68,7 @@ CODE:
  {
   level = PerlMemShared_malloc(sizeof *level);
   *level = 1;
-  LEAVE_with_name("sub");
+  LEAVEn("sub");
   SAVEDESTRUCTOR_X(tc_callback, level);
-  ENTER_with_name("sub");
+  ENTERn("sub");
  }