* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/tools/thread/thread_test.c,v 1.28 2004/04/27 18:40:50 momjian Exp $
+ * $PostgreSQL: pgsql/src/tools/thread/thread_test.c,v 1.29 2004/04/27 19:51:12 momjian Exp $
*
* This program tests to see if your standard libc functions use
* pthread_setspecific()/pthread_getspecific() to be thread-safe.
*-------------------------------------------------------------------------
*/
+#ifndef IN_CONFIGURE
#include "postgres.h"
+#else
+/* From src/include/c.h" */
+#ifndef bool
+typedef char bool;
+#endif
+
+#ifndef true
+#define true ((bool) 1)
+#endif
+
+#ifndef false
+#define false ((bool) 0)
+#endif
+#endif
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <errno.h>
-#ifndef ENABLE_THREAD_SAFETY
+#if !defined(ENABLE_THREAD_SAFETY) && !defined(IN_CONFIGURE)
int
main(int argc, char *argv[])
{
return 1;
}
+#ifdef IN_CONFIGURE
+ /* Send stdout to 'config.log' */
+ close(1);
+ dup(5);
+#endif
+
/* Make temp filenames, might not have strdup() */
temp_filename_1 = malloc(strlen(TEMP_FILENAME_1) + 1);
strcpy(temp_filename_1, TEMP_FILENAME_1);
pthread_mutex_lock(&init_mutex); /* wait for parent to test */
pthread_mutex_unlock(&init_mutex);
}
-#endif /* !ENABLE_THREAD_SAFETY */
-
+#endif /* !ENABLE_THREAD_SAFETY && !IN_CONFIGURE */