diff options
Diffstat (limited to 'libpthread/nptl')
-rw-r--r-- | libpthread/nptl/allocatestack.c | 16 | ||||
-rw-r--r-- | libpthread/nptl/pt-cleanup.c | 4 | ||||
-rw-r--r-- | libpthread/nptl/unwind.c | 2 |
3 files changed, 11 insertions, 11 deletions
diff --git a/libpthread/nptl/allocatestack.c b/libpthread/nptl/allocatestack.c index 1c549cee1..6a4e252e8 100644 --- a/libpthread/nptl/allocatestack.c +++ b/libpthread/nptl/allocatestack.c @@ -316,10 +316,10 @@ change_stack_perm (struct pthread *pd + (((((pd->stackblock_size - pd->guardsize) / 2) & pagemask) + pd->guardsize) & pagemask)); size_t len = pd->stackblock + pd->stackblock_size - stack; -#elif _STACK_GROWS_DOWN +#elif defined _STACK_GROWS_DOWN void *stack = pd->stackblock + pd->guardsize; size_t len = pd->stackblock_size - pd->guardsize; -#elif _STACK_GROWS_UP +#elif defined _STACK_GROWS_UP void *stack = pd->stackblock; size_t len = (uintptr_t) pd - pd->guardsize - (uintptr_t) pd->stackblock; #else @@ -591,9 +591,9 @@ allocate_stack (const struct pthread_attr *attr, struct pthread **pdp, { #ifdef NEED_SEPARATE_REGISTER_STACK char *guard = mem + (((size - guardsize) / 2) & ~pagesize_m1); -#elif _STACK_GROWS_DOWN +#elif defined _STACK_GROWS_DOWN char *guard = mem; -# elif _STACK_GROWS_UP +#elif defined _STACK_GROWS_UP char *guard = (char *) (((uintptr_t) pd - guardsize) & ~pagesize_m1); #endif if (mprotect (guard, guardsize, PROT_NONE) != 0) @@ -641,11 +641,11 @@ allocate_stack (const struct pthread_attr *attr, struct pthread **pdp, oldguard + pd->guardsize - guard - guardsize, prot) != 0) goto mprot_error; -#elif _STACK_GROWS_DOWN +#elif defined _STACK_GROWS_DOWN if (mprotect ((char *) mem + guardsize, pd->guardsize - guardsize, prot) != 0) goto mprot_error; -#elif _STACK_GROWS_UP +#elif defined _STACK_GROWS_UP if (mprotect ((char *) pd - pd->guardsize, pd->guardsize - guardsize, prot) != 0) goto mprot_error; @@ -688,9 +688,9 @@ allocate_stack (const struct pthread_attr *attr, struct pthread **pdp, #ifdef NEED_SEPARATE_REGISTER_STACK *stack = pd->stackblock; *stacksize = stacktop - *stack; -#elif _STACK_GROWS_DOWN +#elif defined _STACK_GROWS_DOWN *stack = stacktop; -#elif _STACK_GROWS_UP +#elif defined _STACK_GROWS_UP *stack = pd->stackblock; assert (*stack > 0); #endif diff --git a/libpthread/nptl/pt-cleanup.c b/libpthread/nptl/pt-cleanup.c index 97673b6c5..d7394ae44 100644 --- a/libpthread/nptl/pt-cleanup.c +++ b/libpthread/nptl/pt-cleanup.c @@ -39,13 +39,13 @@ __pthread_cleanup_upto (__jmp_buf target, char *targetframe) cbuf != NULL && _JMPBUF_UNWINDS_ADJ (target, cbuf, adj); cbuf = cbuf->__prev) { -#if _STACK_GROWS_DOWN +#ifdef _STACK_GROWS_DOWN if ((uintptr_t) cbuf - adj <= targetframe_adj) { cbuf = NULL; break; } -#elif _STACK_GROWS_UP +#elif defined _STACK_GROWS_UP if ((uintptr_t) cbuf - adj >= targetframe_adj) { cbuf = NULL; diff --git a/libpthread/nptl/unwind.c b/libpthread/nptl/unwind.c index c7e01e764..0322a6023 100644 --- a/libpthread/nptl/unwind.c +++ b/libpthread/nptl/unwind.c @@ -30,7 +30,7 @@ #ifdef _STACK_GROWS_DOWN # define FRAME_LEFT(frame, other, adj) \ ((uintptr_t) frame - adj >= (uintptr_t) other - adj) -#elif _STACK_GROWS_UP +#elif defined _STACK_GROWS_UP # define FRAME_LEFT(frame, other, adj) \ ((uintptr_t) frame - adj <= (uintptr_t) other - adj) #else |