mariadb/dbug/my_main.c
Jon Olav Hauglid aee88a4cc6 Bug#12779790 COMPILATION FAILS OS X 10.7 - IMPLICIT DECLARATION OF
FUNCTION 'PTHREAD_INIT' 

The problem was that compilation would fail with a warning:
Implicit declaration of function 'pthread_init' if MySQL was
compiled on OS X 10.7 (Lion). The reason was that pthread_init()
is now part of an internal OS X pthread library so it was found
by CMake.

This patch fixes the problem by removing HAVE_PTHREAD_INIT and
related code. pthread_init() was specific to MIT-pthreads which
has not been supported since 4.1 and was therefore no longer
relevant.

No test case added.
2011-07-21 17:45:38 +02:00

38 lines
811 B
C

/*
this is modified version of the original example main.c
fixed so that it could compile and run in MySQL source tree
*/
#ifdef DBUG_OFF /* We are testing dbug */
#undef DBUG_OFF
#endif
#include <my_global.h> /* This includes dbug.h */
#include <my_pthread.h>
int main (argc, argv)
int argc;
char *argv[];
{
register int result, ix;
extern int factorial(int);
my_thread_global_init();
{
DBUG_ENTER ("main");
DBUG_PROCESS (argv[0]);
for (ix = 1; ix < argc && argv[ix][0] == '-'; ix++) {
switch (argv[ix][1]) {
case '#':
DBUG_PUSH (&(argv[ix][2]));
break;
}
}
for (; ix < argc; ix++) {
DBUG_PRINT ("args", ("argv[%d] = %s", ix, argv[ix]));
result = factorial (atoi(argv[ix]));
printf ("%d\n", result);
}
DBUG_RETURN (0);
}
}