comparison configure @ 32144:7327d3c7e293

Mark local functions in configure tests as static; fixes the warnings: tmp.c:1: warning: no previous prototype for 'foo' tmp.c:2: warning: no previous prototype for 'func' tmp.c:3: warning: no previous prototype for 'catch'
author diego
date Tue, 14 Sep 2010 09:41:32 +0000
parents 1203050ff67f
children b97cd2b0dc07
comparison
equal deleted inserted replaced
32143:1203050ff67f 32144:7327d3c7e293
1745 if test "$1" = kernel_check ; then 1745 if test "$1" = kernel_check ; then
1746 echocheck "kernel support of $2" 1746 echocheck "kernel support of $2"
1747 cat > $TMPC <<EOF 1747 cat > $TMPC <<EOF
1748 #include <stdlib.h> 1748 #include <stdlib.h>
1749 #include <signal.h> 1749 #include <signal.h>
1750 void catch(int sig) { exit(1); } 1750 static void catch(int sig) { exit(1); }
1751 int main(void) { 1751 int main(void) {
1752 signal(SIGILL, catch); 1752 signal(SIGILL, catch);
1753 __asm__ volatile ("$3":::"memory"); return 0; 1753 __asm__ volatile ("$3":::"memory"); return 0;
1754 } 1754 }
1755 EOF 1755 EOF
3043 3043
3044 3044
3045 echocheck "__builtin_expect" 3045 echocheck "__builtin_expect"
3046 # GCC branch prediction hint 3046 # GCC branch prediction hint
3047 cat > $TMPC << EOF 3047 cat > $TMPC << EOF
3048 int foo(int a) { 3048 static int foo(int a) {
3049 a = __builtin_expect(a, 10); 3049 a = __builtin_expect(a, 10);
3050 return a == 10 ? 0 : 1; 3050 return a == 10 ? 0 : 1;
3051 } 3051 }
3052 int main(void) { return foo(10) && foo(0); } 3052 int main(void) { return foo(10) && foo(0); }
3053 EOF 3053 EOF
3617 THREAD_CFLAGS=-D_THREAD_SAFE 3617 THREAD_CFLAGS=-D_THREAD_SAFE
3618 fi 3618 fi
3619 if test "$_pthreads" = auto ; then 3619 if test "$_pthreads" = auto ; then
3620 cat > $TMPC << EOF 3620 cat > $TMPC << EOF
3621 #include <pthread.h> 3621 #include <pthread.h>
3622 void* func(void *arg) { return arg; } 3622 static void *func(void *arg) { return arg; }
3623 int main(void) { pthread_t tid; return pthread_create(&tid, 0, func, 0) == 0 ? 0 : 1; } 3623 int main(void) { pthread_t tid; return pthread_create(&tid, 0, func, 0) == 0 ? 0 : 1; }
3624 EOF 3624 EOF
3625 _pthreads=no 3625 _pthreads=no
3626 if ! hpux ; then 3626 if ! hpux ; then
3627 for _ld_tmp in "-lpthreadGC2" "" "-lpthread" "-pthread" ; do 3627 for _ld_tmp in "-lpthreadGC2" "" "-lpthread" "-pthread" ; do
5197 extra_ldflags="$extra_ldflags $_ld_gif" 5197 extra_ldflags="$extra_ldflags $_ld_gif"
5198 5198
5199 cat > $TMPC << EOF 5199 cat > $TMPC << EOF
5200 #include <signal.h> 5200 #include <signal.h>
5201 #include <gif_lib.h> 5201 #include <gif_lib.h>
5202 void catch(int sig) { exit(1); } 5202 static void catch(int sig) { exit(1); }
5203 int main(void) { 5203 int main(void) {
5204 signal(SIGSEGV, catch); // catch segfault 5204 signal(SIGSEGV, catch); // catch segfault
5205 printf("EGifPutExtensionFirst is at address %p\n", EGifPutExtensionFirst); 5205 printf("EGifPutExtensionFirst is at address %p\n", EGifPutExtensionFirst);
5206 EGifSetGifVersion("89a"); // this will segfault a buggy gif lib. 5206 EGifSetGifVersion("89a"); // this will segfault a buggy gif lib.
5207 return 0; 5207 return 0;