diff mbox series

[hurd,commited,1/3] hurd: Fix allocalim build

Message ID 20180128184045.5892-2-samuel.thibault@ens-lyon.org
State New
Headers show
Series hurd: build fixes | expand

Commit Message

Samuel Thibault Jan. 28, 2018, 6:40 p.m. UTC
* sysdeps/pthread/allocalim.h [!defined PTHREAD_STACK_MIN]: Do not
check size against PTHREAD_STACK_MIN.
---
 ChangeLog                   | 2 ++
 sysdeps/pthread/allocalim.h | 7 +++++--
 2 files changed, 7 insertions(+), 2 deletions(-)

Comments

Joseph Myers Jan. 29, 2018, 4:36 p.m. UTC | #1
On Sun, 28 Jan 2018, Samuel Thibault wrote:

> +#ifdef PTHREAD_STACK_MIN
> +          __builtin_expect (size <= PTHREAD_STACK_MIN / 4, 1) ||

I think the rule of having operators at the start of line, not the end of 
line, applies even in this case (so should have a second line with just 
appropriately-indented ||).
diff mbox series

Patch

diff --git a/ChangeLog b/ChangeLog
index 3223ff58ea..59fc5f950d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -92,6 +92,8 @@ 
 	_hurd_userlink_link, _hurd_userlink_unlink, _hurd_userlink_clear.
 	* sysdeps/mach/hurd/bits/posix_opt.h (_POSIX_CHOWN_RESTRICTED,
 	_POSIX_NO_TRUNC): Define to 0.
+	* sysdeps/pthread/allocalim.h [!defined PTHREAD_STACK_MIN]: Do not
+	check size against PTHREAD_STACK_MIN.
 
 2008-12-18  Thomas Schwinge  <tschwinge@gnu.org>
 
diff --git a/sysdeps/pthread/allocalim.h b/sysdeps/pthread/allocalim.h
index b265d6f269..fdae0c251f 100644
--- a/sysdeps/pthread/allocalim.h
+++ b/sysdeps/pthread/allocalim.h
@@ -24,6 +24,9 @@  extern __always_inline
 int
 __libc_use_alloca (size_t size)
 {
-  return (__builtin_expect (size <= PTHREAD_STACK_MIN / 4, 1)
-	  || __builtin_expect (__libc_alloca_cutoff (size), 1));
+  return (
+#ifdef PTHREAD_STACK_MIN
+          __builtin_expect (size <= PTHREAD_STACK_MIN / 4, 1) ||
+#endif
+          __builtin_expect (__libc_alloca_cutoff (size), 1));
 }