From 7901d2073c8dfb6fc728cec434981fa6e2256d5b Mon Sep 17 00:00:00 2001
From: "Tobias S. Josefowitz" <tobij@tobij.de>
Date: Wed, 7 May 2014 17:36:09 +0200
Subject: [PATCH] Nettle/cipher.cmod: Don't define object storage within an
 #ifdef

precompile.pike apparently inserts the storage struct for a class at the
last PIKEVAR, which in the case of CipherBlock16 was inside an #ifdef.

Moved the PIKEVAR around so that Nettle/cipher.cmod also compiles on
systems without HAVE_NETTLE_GCM_H.
---
 src/post_modules/Nettle/cipher.cmod | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/post_modules/Nettle/cipher.cmod b/src/post_modules/Nettle/cipher.cmod
index 5ec0c3e0f3..3bcb991d42 100644
--- a/src/post_modules/Nettle/cipher.cmod
+++ b/src/post_modules/Nettle/cipher.cmod
@@ -1738,6 +1738,10 @@ PIKECLASS BlockCipher16
    */
   INHERIT Nettle_BlockCipher;
 
+#ifdef HAVE_NETTLE_GCM_H
+  PIKEVAR object(Nettle_AEAD) GCM;
+#endif
+
   /*! @module CCM
    *!
    *! Implementation of the Counter with Cipher Block Chaining
@@ -2269,6 +2273,7 @@ PIKECLASS BlockCipher16
    */
 
 #ifdef HAVE_NETTLE_GCM_H
+
 #include <nettle/gcm.h>
 
   /*! @module GCM
@@ -2294,8 +2299,6 @@ PIKECLASS BlockCipher16
    *!   @[CBC]
    */
 
-  PIKEVAR object(Nettle_AEAD) GCM;
-
   PIKECLASS _GCM
     program_flags PROGRAM_NEEDS_PARENT|PROGRAM_USES_PARENT;
   {
-- 
GitLab