fix a C declaration after statement
Zefram [Thu, 8 Dec 2011 20:28:40 +0000 (20:28 +0000)]
Changes
Declare.xs

diff --git a/Changes b/Changes
index 44ec6f5..70ca955 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,5 +1,8 @@
 Changes for Devel-Declare
 
+  - Fix a C declaration after statement, which broke compatibility with
+    older compilers (Jan Dubois).
+
 0.006008 - 05 Nov 2011
   - Adjust toke_scan_str logic to always leave the prefix part of
     linestr unchanged.
index fc8e0e6..5869056 100644 (file)
@@ -490,13 +490,15 @@ STATIC void dd_initialize(pTHX) {
   if (!initialized) {
     initialized = 1;
 #if DD_GROW_VIA_BLOCKHOOK
-    static BHK bhk;
+    {
+      static BHK bhk;
 #if PERL_VERSION_GE(5,13,6)
-    BhkENTRY_set(&bhk, bhk_start, dd_block_start);
+      BhkENTRY_set(&bhk, bhk_start, dd_block_start);
 #else /* <5.13.6 */
-    BhkENTRY_set(&bhk, start, dd_block_start);
+      BhkENTRY_set(&bhk, start, dd_block_start);
 #endif /* <5.13.6 */
-    Perl_blockhook_register(aTHX_ &bhk);
+      Perl_blockhook_register(aTHX_ &bhk);
+    }
 #else /* !DD_GROW_VIA_BLOCKHOOK */
     hook_op_check(OP_ENTEREVAL, dd_ck_entereval, NULL);
 #endif /* !DD_GROW_VIA_BLOCKHOOK */