Skip to content
Snippets Groups Projects
Commit b615f6c9 authored by Dmitry Simonenko's avatar Dmitry Simonenko
Browse files

Remove old pthread.h checking.

g++ (not gcc) works correctly when dealing with
extern __inline and __extern_inline constructions, thus
this hack is not necessary now.
parent f9697c24
No related branches found
No related tags found
No related merge requests found
......@@ -79,27 +79,6 @@ check_function_exists(memrchr HAVE_MEMRCHR)
# stack. Find whether or not it's present.
check_library_exists("" __libc_stack_end "" HAVE_LIBC_STACK_END)
set(HAVE_NON_C99_PTHREAD_H 0)
if (CMAKE_COMPILER_IS_GNUCC)
set(CMAKE_REQUIRED_FLAGS "-std=gnu99 -Wall -fexceptions -pthread")
check_symbol_exists(__pthread_cleanup_routine pthread.h test1)
set(HAVE_NON_C99_PTHREAD_H OFF)
if (test1)
try_compile(HAVE_NON_C99_PTHREAD_H ${CMAKE_BINARY_DIR}
${CMAKE_SOURCE_DIR}/cmake/pthread-broken-inline-test.c
COMPILE_DEFINITIONS "-std=gnu99 -Wall -fexceptions")
endif()
unset(test1)
if (HAVE_NON_C99_PTHREAD_H)
message(WARNING "The system pthread.h is not compatible with the C99 mode."
"A special workaround will be used during compilation."
"If it does not work for you, please update system glibc.")
endif()
endif()
#
# Enable 'make TAGS' target.
#
......
#include <setjmp.h>
#include <pthread.h>
struct __pthread_cleanup_frame;
extern __inline void
__pthread_cleanup_routine(struct __pthread_cleanup_frame *__frame);
int main()
{
return 0;
}
......@@ -31,27 +31,7 @@
#include "config.h"
#if defined(HAVE_NON_C99_PTHREAD_H)
/*
* Old versions of glibc (pre-2006) use "extern __inline" for this function.
* This definition, of course, does not work properly with C99 mode when
* multiple compilation units are used.
*
* By defining "static inline" prototype we force GCC think that
* this method is "static" and no global symbols must be produced for it.
*
* See http://gcc.gnu.org/ml/gcc-patches/2006-11/msg01030.html
* http://gcc.gnu.org/ml/gcc-patches/2008-07/msg02449.html
*/
struct __pthread_cleanup_frame;
static inline void
__pthread_cleanup_routine(struct __pthread_cleanup_frame *__frame);
#define __inline
#endif /* HAVE_NON_C99_PTHREAD_H */
#include <pthread.h>
#include <util.h>
#include <say.h>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment