summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2013-02-08 01:50:09 +0100
committerDarren Tucker <dtucker@zip.com.au>2013-02-08 01:50:09 +0100
commit951b53b1bede98fdcfeeac8c5c00dbf3948d9b75 (patch)
tree669491e147904e17ea43fe7f66453bc45876aedb
parent - (djm) [contrib/redhat/sshd.init] treat RETVAL as an integer; (diff)
downloadopenssh-951b53b1bede98fdcfeeac8c5c00dbf3948d9b75.tar.xz
openssh-951b53b1bede98fdcfeeac8c5c00dbf3948d9b75.zip
- (dtucker) [configure.ac openbsd-compat/sys-tree.h] Test if compiler allows
__attribute__ on return values and work around if necessary. ok djm@
-rw-r--r--ChangeLog2
-rw-r--r--configure.ac16
-rw-r--r--openbsd-compat/sys-tree.h5
3 files changed, 21 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 6c569b81d..5e832e7d5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,8 @@
20130208
- (djm) [contrib/redhat/sshd.init] treat RETVAL as an integer;
patch from Iain Morgan in bz#2059
+ - (dtucker) [configure.ac openbsd-compat/sys-tree.h] Test if compiler allows
+ __attribute__ on return values and work around if necessary. ok djm@
20130207
- (djm) [configure.ac] Don't probe seccomp capability of running kernel
diff --git a/configure.ac b/configure.ac
index f61106441..6df09e210 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,4 +1,4 @@
-# $Id: configure.ac,v 1.501 2013/02/06 23:11:05 djm Exp $
+# $Id: configure.ac,v 1.502 2013/02/08 00:50:09 dtucker Exp $
#
# Copyright (c) 1999-2004 Damien Miller
#
@@ -15,7 +15,7 @@
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
AC_INIT([OpenSSH], [Portable], [openssh-unix-dev@mindrot.org])
-AC_REVISION($Revision: 1.501 $)
+AC_REVISION($Revision: 1.502 $)
AC_CONFIG_SRCDIR([ssh.c])
AC_LANG([C])
@@ -238,6 +238,18 @@ if test "$GCC" = "yes" || test "$GCC" = "egcs"; then
fi
fi
+AC_MSG_CHECKING([if compiler allows __attribute__ on return types])
+AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[
+#include <stdlib.h>
+__attribute__((__unused__)) static void foo(void){return;}]],
+ [[ exit(0); ]])],
+ [ AC_MSG_RESULT([yes]) ],
+ [ AC_MSG_RESULT([no])
+ AC_DEFINE(NO_ATTRIBUTE_ON_RETURN_TYPE, 1,
+ [compiler does not accept __attribute__ on return types]) ]
+)
+
if test "x$no_attrib_nonnull" != "x1" ; then
AC_DEFINE([HAVE_ATTRIBUTE__NONNULL__], [1], [Have attribute nonnull])
fi
diff --git a/openbsd-compat/sys-tree.h b/openbsd-compat/sys-tree.h
index 058fa3b23..7f7546ecd 100644
--- a/openbsd-compat/sys-tree.h
+++ b/openbsd-compat/sys-tree.h
@@ -26,6 +26,11 @@
/* OPENBSD ORIGINAL: sys/sys/tree.h */
+#include "config.h"
+#ifdef NO_ATTRIBUTE_ON_RETURN_TYPE
+# define __attribute__(x)
+#endif
+
#ifndef _SYS_TREE_H_
#define _SYS_TREE_H_