-/* Copyright (C) 2002, 2003, 2004, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2004, 2007, 2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
return PTHFCT_CALL (ptr_##name, params); \
}
+/* Same as FORWARD2, only without return. */
+#define FORWARD_NORETURN(name, rettype, decl, params, defaction) \
+rettype \
+name decl \
+{ \
+ if (!__libc_pthread_functions_init) \
+ defaction; \
+ \
+ PTHFCT_CALL (ptr_##name, params); \
+}
+
#define FORWARD(name, decl, params, defretval) \
FORWARD2 (name, int, decl, params, return defretval)
(thread1, thread2), 1)
-/* Use an alias to avoid warning, as pthread_exit is declared noreturn. */
-FORWARD2 (__pthread_exit, void, (void *retval), (retval), exit (EXIT_SUCCESS))
+FORWARD_NORETURN (__pthread_exit, void, (void *retval), (retval),
+ exit (EXIT_SUCCESS))
strong_alias (__pthread_exit, pthread_exit);
FORWARD (pthread_setcanceltype, (int type, int *oldtype), (type, oldtype), 0)
-#define return /* value is void */
-FORWARD2(__pthread_unwind,
+FORWARD_NORETURN(__pthread_unwind,
void attribute_hidden __attribute ((noreturn)) __cleanup_fct_attribute
attribute_compat_text_section,
(__pthread_unwind_buf_t *buf), (buf), {
INTERNAL_SYSCALL_DECL (err);
INTERNAL_SYSCALL (kill, err, 1, SIGKILL);
})
-#undef return