Subject: | [PATCH] Make Devel::Declare compile correctly under MSVC |
Hi there,
I was trying to install latest CPAN Devel::Declare on a windows vista
machine, perl 5.10.0, MSVC 2008 and it failed for me.
The problem seems to lie in the two variable declarations at the start
of the "BOOT" section. The following patch fixes the problem (maybe not
properly?) and passes all tests.
Subject: | dd-msvc.patch |
--- Declare.xs.orig Sat Aug 08 21:51:55 2009
+++ Declare.xs Sat Aug 08 21:49:19 2009
@@ -41,6 +41,10 @@
#define DD_AM_LEXING DD_AM_LEXING_CHECK
#endif
+/* static vars for the boot section, MSVC doesn't like them down there */
+static char *endptr;
+static char *debug_str;
+
/* thing that decides whether we're dealing with a declarator */
int dd_is_declarator(pTHX_ char* name) {
@@ -488,8 +492,7 @@
in_declare = value;
BOOT:
- char *endptr;
- char *debug_str = getenv ("DD_DEBUG");
+ debug_str = getenv ("DD_DEBUG");
if (debug_str) {
dd_debug = strtol (debug_str, &endptr, 10);
if (*endptr != '\0') {