engines/afalg: make it compile with backward compatibility headers.
authorAndy Polyakov <appro@openssl.org>
Sun, 4 Sep 2016 20:53:22 +0000 (22:53 +0200)
committerAndy Polyakov <appro@openssl.org>
Thu, 8 Sep 2016 07:16:20 +0000 (09:16 +0200)
Reviewed-by: Tim Hudson <tjh@openssl.org>
(cherry picked from commit 4e3997293b3825ed19de20d5484f8c0f66fce534)

engines/afalg/e_afalg.c

index 2ea5ba5232a1996ba09e1ee7c3ba773cde543264..2c13ba80ed071708730192d3f70149b78fa6d2f3 100644 (file)
@@ -8,7 +8,9 @@
  */
 
 /* Required for vmsplice */
-#define _GNU_SOURCE
+#ifndef _GNU_SOURCE
+# define _GNU_SOURCE
+#endif
 #include <stdio.h>
 #include <string.h>
 #include <unistd.h>
 #include <openssl/async.h>
 #include <openssl/err.h>
 
+#include <sys/socket.h>
 #include <linux/version.h>
 #define K_MAJ   4
 #define K_MIN1  1
 #define K_MIN2  0
-#if LINUX_VERSION_CODE <= KERNEL_VERSION(K_MAJ, K_MIN1, K_MIN2)
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(K_MAJ, K_MIN1, K_MIN2) || \
+    !defined(AF_ALG)
 # warning "AFALG ENGINE requires Kernel Headers >= 4.1.0"
 # warning "Skipping Compilation of AFALG engine"
 void engine_load_afalg_int(void)
@@ -30,7 +34,6 @@ void engine_load_afalg_int(void)
 #else
 
 # include <linux/if_alg.h>
-# include <sys/socket.h>
 # include <fcntl.h>
 # include <sys/utsname.h>