summaryrefslogtreecommitdiff
path: root/src/env
diff options
context:
space:
mode:
authorSzabolcs Nagy <nsz@port70.net>2014-08-13 17:07:44 +0200
committerSzabolcs Nagy <nsz@port70.net>2014-08-13 17:07:44 +0200
commitd86af2a0803cace7b0f616f2a696fb3e25e9b628 (patch)
tree4f1d554bea162891fa1652da8adb131e86da79fc /src/env
parentd146d4dc1104aa3472daf81d2581aca65df54d13 (diff)
downloadmusl-d86af2a0803cace7b0f616f2a696fb3e25e9b628.tar.gz
musl-d86af2a0803cace7b0f616f2a696fb3e25e9b628.tar.bz2
musl-d86af2a0803cace7b0f616f2a696fb3e25e9b628.tar.xz
musl-d86af2a0803cace7b0f616f2a696fb3e25e9b628.zip
fix #ifdef inside a macro argument list in __init_tls.c
C99 6.10.3p11 disallows such constructs so use an #ifdef outside of the argument list of __syscall
Diffstat (limited to 'src/env')
-rw-r--r--src/env/__init_tls.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/env/__init_tls.c b/src/env/__init_tls.c
index 6cca9685..ddc2a736 100644
--- a/src/env/__init_tls.c
+++ b/src/env/__init_tls.c
@@ -91,12 +91,11 @@ void __init_tls(size_t *aux)
libc.tls_size = 2*sizeof(void *)+T.size+T.align+sizeof(struct pthread);
if (libc.tls_size > sizeof builtin_tls) {
+#ifndef SYS_mmap2
+#define SYS_mmap2 SYS_mmap
+#endif
mem = (void *)__syscall(
-#ifdef SYS_mmap2
SYS_mmap2,
-#else
- SYS_mmap,
-#endif
0, libc.tls_size, PROT_READ|PROT_WRITE,
MAP_ANONYMOUS|MAP_PRIVATE, -1, 0);
/* -4095...-1 cast to void * will crash on dereference anyway,