Move the declaration of alloca() so it's ony declared when really
authorRichard Levitte <levitte@openssl.org>
Mon, 27 Sep 2004 21:59:44 +0000 (21:59 +0000)
committerRichard Levitte <levitte@openssl.org>
Mon, 27 Sep 2004 21:59:44 +0000 (21:59 +0000)
necessary.

crypto/engine/eng_padlock.c

index 81884ef6bf0c1f853a858cfa942f52a631087d41..ca311657870c4fb6474cd8bd18028be3d6c35efe 100644 (file)
 #include <openssl/aes.h>
 #include <openssl/rand.h>
 
-#ifdef OPENSSL_SYS_VMS
-# include <builtins.h>
-# define alloca __ALLOCA
-#else
-# include <malloc.h>
-# ifdef _MSC_VER
-#  define alloca _alloca
-# endif
-#endif
-
 #ifndef OPENSSL_NO_HW
 #ifndef OPENSSL_NO_HW_PADLOCK
 
@@ -126,6 +116,13 @@ void ENGINE_load_padlock (void)
 }
 
 #ifdef COMPILE_HW_PADLOCK
+/* We do these includes here to avoid header problems on platforms that
+   do not have the VIA padlock anyway... */
+#include <malloc.h>
+#ifdef _MSC_VER
+# define alloca _alloca
+#endif
+
 /* Function for ENGINE detection and control */
 static int padlock_available(void);
 static int padlock_init(ENGINE *e);