I'd like to propose the attached patch to 1.0.2d which avoids problems
with strict ISO conforming compiler/options, which do not define 'sun' only
'__sun' as usual... such as gcc/clang -std=c99
This affects the build itself, but also any user of openssl/opensslconf.h
--
Richard PALO
>From 95695ef607535135da38f6f7cdd62238aa55a97b Mon Sep 17 00:00:00 2001
From: Richard PALO <[email protected]>
Date: Tue, 17 Nov 2015 14:34:16 +0100
Subject: [PATCH] Use '__sun' instead of 'sun' for strict ISO conforming
compiler/options
Signed-off-by: Richard PALO <[email protected]>
---
crypto/bf/bf_opts.c | 2 +-
crypto/bf/bfspeed.c | 2 +-
crypto/bn/bnspeed.c | 2 +-
crypto/bn/expspeed.c | 2 +-
crypto/cast/cast_spd.c | 2 +-
crypto/cast/castopts.c | 2 +-
crypto/des/des_opts.c | 2 +-
crypto/des/speed.c | 2 +-
crypto/idea/idea_spd.c | 2 +-
crypto/opensslconf.h.in | 2 +-
crypto/rc2/rc2speed.c | 2 +-
crypto/rc4/rc4speed.c | 2 +-
crypto/rc5/rc5speed.c | 2 +-
e_os.h | 4 ++--
14 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/crypto/bf/bf_opts.c b/crypto/bf/bf_opts.c
index f85495c..a583c33 100644
--- a/crypto/bf/bf_opts.c
+++ b/crypto/bf/bf_opts.c
@@ -92,7 +92,7 @@ OPENSSL_DECLARE_EXIT
#ifndef TIMES
# include <sys/timeb.h>
#endif
-#if defined(sun) || defined(__ultrix)
+#if defined(__sun) || defined(__ultrix)
# define _POSIX_SOURCE
# include <limits.h>
# include <sys/param.h>
diff --git a/crypto/bf/bfspeed.c b/crypto/bf/bfspeed.c
index 305ad8b..ac2f957 100644
--- a/crypto/bf/bfspeed.c
+++ b/crypto/bf/bfspeed.c
@@ -90,7 +90,7 @@ OPENSSL_DECLARE_EXIT
#ifndef TIMES
# include <sys/timeb.h>
#endif
-#if defined(sun) || defined(__ultrix)
+#if defined(__sun) || defined(__ultrix)
# define _POSIX_SOURCE
# include <limits.h>
# include <sys/param.h>
diff --git a/crypto/bn/bnspeed.c b/crypto/bn/bnspeed.c
index e387fdf..ff86336 100644
--- a/crypto/bn/bnspeed.c
+++ b/crypto/bn/bnspeed.c
@@ -97,7 +97,7 @@
# include <sys/timeb.h>
#endif
-#if defined(sun) || defined(__ultrix)
+#if defined(__sun) || defined(__ultrix)
# define _POSIX_SOURCE
# include <limits.h>
# include <sys/param.h>
diff --git a/crypto/bn/expspeed.c b/crypto/bn/expspeed.c
index 513a568..249a4c2 100644
--- a/crypto/bn/expspeed.c
+++ b/crypto/bn/expspeed.c
@@ -123,7 +123,7 @@ static void genprime_cb(int p, int n, void *arg);
# include <sys/timeb.h>
#endif
-#if defined(sun) || defined(__ultrix)
+#if defined(__sun) || defined(__ultrix)
# define _POSIX_SOURCE
# include <limits.h>
# include <sys/param.h>
diff --git a/crypto/cast/cast_spd.c b/crypto/cast/cast_spd.c
index 91d2ce2..e157f46 100644
--- a/crypto/cast/cast_spd.c
+++ b/crypto/cast/cast_spd.c
@@ -90,7 +90,7 @@ OPENSSL_DECLARE_EXIT
#ifndef TIMES
# include <sys/timeb.h>
#endif
-#if defined(sun) || defined(__ultrix)
+#if defined(__sun) || defined(__ultrix)
# define _POSIX_SOURCE
# include <limits.h>
# include <sys/param.h>
diff --git a/crypto/cast/castopts.c b/crypto/cast/castopts.c
index 42687f2..55684e7 100644
--- a/crypto/cast/castopts.c
+++ b/crypto/cast/castopts.c
@@ -92,7 +92,7 @@ OPENSSL_DECLARE_EXIT
#ifndef TIMES
# include <sys/timeb.h>
#endif
-#if defined(sun) || defined(__ultrix)
+#if defined(__sun) || defined(__ultrix)
# define _POSIX_SOURCE
# include <limits.h>
# include <sys/param.h>
diff --git a/crypto/des/des_opts.c b/crypto/des/des_opts.c
index ec50e94..1ccd432 100644
--- a/crypto/des/des_opts.c
+++ b/crypto/des/des_opts.c
@@ -100,7 +100,7 @@ extern void exit();
# include <sys/timeb.h>
#endif
-#if defined(sun) || defined(__ultrix)
+#if defined(__sun) || defined(__ultrix)
# define _POSIX_SOURCE
# include <limits.h>
# include <sys/param.h>
diff --git a/crypto/des/speed.c b/crypto/des/speed.c
index 9a3d929..a1d801b 100644
--- a/crypto/des/speed.c
+++ b/crypto/des/speed.c
@@ -91,7 +91,7 @@ OPENSSL_DECLARE_EXIT
#ifndef TIMES
# include <sys/timeb.h>
#endif
-#if defined(sun) || defined(__ultrix)
+#if defined(__sun) || defined(__ultrix)
# define _POSIX_SOURCE
# include <limits.h>
# include <sys/param.h>
diff --git a/crypto/idea/idea_spd.c b/crypto/idea/idea_spd.c
index 59acc40..70ec3eb 100644
--- a/crypto/idea/idea_spd.c
+++ b/crypto/idea/idea_spd.c
@@ -90,7 +90,7 @@ OPENSSL_DECLARE_EXIT
#ifndef TIMES
# include <sys/timeb.h>
#endif
-#if defined(sun) || defined(__ultrix)
+#if defined(__sun) || defined(__ultrix)
# define _POSIX_SOURCE
# include <limits.h>
# include <sys/param.h>
diff --git a/crypto/opensslconf.h.in b/crypto/opensslconf.h.in
index 814309b..d8e6abc 100644
--- a/crypto/opensslconf.h.in
+++ b/crypto/opensslconf.h.in
@@ -120,7 +120,7 @@
optimization options. Older Sparc's work better with only UNROLL, but
there's no way to tell at compile time what it is you're running on */
-#if defined( sun ) /* Newer Sparc's */
+#if defined( __sun ) /* Newer Sparc's */
# define DES_PTR
# define DES_RISC1
# define DES_UNROLL
diff --git a/crypto/rc2/rc2speed.c b/crypto/rc2/rc2speed.c
index 3e45eb0..bce854c 100644
--- a/crypto/rc2/rc2speed.c
+++ b/crypto/rc2/rc2speed.c
@@ -90,7 +90,7 @@ OPENSSL_DECLARE_EXIT
#ifndef TIMES
# include <sys/timeb.h>
#endif
-#if defined(sun) || defined(__ultrix)
+#if defined(__sun) || defined(__ultrix)
# define _POSIX_SOURCE
# include <limits.h>
# include <sys/param.h>
diff --git a/crypto/rc4/rc4speed.c b/crypto/rc4/rc4speed.c
index 3f13a2b..8fcecb8 100644
--- a/crypto/rc4/rc4speed.c
+++ b/crypto/rc4/rc4speed.c
@@ -90,7 +90,7 @@ OPENSSL_DECLARE_EXIT
#ifndef TIMES
# include <sys/timeb.h>
#endif
-#if defined(sun) || defined(__ultrix)
+#if defined(__sun) || defined(__ultrix)
# define _POSIX_SOURCE
# include <limits.h>
# include <sys/param.h>
diff --git a/crypto/rc5/rc5speed.c b/crypto/rc5/rc5speed.c
index 3f59570..b6c95ac 100644
--- a/crypto/rc5/rc5speed.c
+++ b/crypto/rc5/rc5speed.c
@@ -90,7 +90,7 @@ OPENSSL_DECLARE_EXIT
#ifndef TIMES
# include <sys/timeb.h>
#endif
-#if defined(sun) || defined(__ultrix)
+#if defined(__sun) || defined(__ultrix)
# define _POSIX_SOURCE
# include <limits.h>
# include <sys/param.h>
diff --git a/e_os.h b/e_os.h
index 45fef69..8ac3673 100644
--- a/e_os.h
+++ b/e_os.h
@@ -619,7 +619,7 @@ struct servent *PASCAL getservbyname(const char *, const char *);
# include <sys/select.h>
# endif
-# if defined(sun)
+# if defined(__sun)
# include <sys/filio.h>
# else
# ifndef VMS
@@ -661,7 +661,7 @@ struct servent *PASCAL getservbyname(const char *, const char *);
# endif
-# if defined(sun) && !defined(__svr4__) && !defined(__SVR4)
+# if defined(__sun) && !defined(__svr4__) && !defined(__SVR4)
/* include headers first, so our defines don't break it */
# include <stdlib.h>
# include <string.h>
--
2.6.3
_______________________________________________
openssl-bugs-mod mailing list
[email protected]
https://mta.openssl.org/mailman/listinfo/openssl-bugs-mod
_______________________________________________
openssl-dev mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-dev