Skip to content

Commit 15b330b

Browse files
committed
Properly set NEED_REENTRANT_FUNCS for threaded libpq/ecpg.
Without this patch, no thread locking or *_r functions were being used.
1 parent ac4ad7b commit 15b330b

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

configure

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13243,6 +13243,11 @@ fi
1324313243
# functions are marked "not found", which is perfect.
1324413244
#
1324513245
if test "$enable_thread_safety" = yes -a "$NEED_REENTRANT_FUNCS" = yes ; then
13246+
13247+
cat >>confdefs.h <<\_ACEOF
13248+
#define NEED_REENTRANT_FUNCS 1
13249+
_ACEOF
13250+
1324613251
_CFLAGS="$CFLAGS"
1324713252
_LIBS="$LIBS"
1324813253
CFLAGS="$CFLAGS $THREAD_CPPFLAGS"

configure.in

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
dnl Process this file with autoconf to produce a configure script.
2-
dnl $PostgreSQL: pgsql/configure.in,v 1.314 2004/02/10 19:55:45 tgl Exp $
2+
dnl $PostgreSQL: pgsql/configure.in,v 1.315 2004/02/11 17:29:01 momjian Exp $
33
dnl
44
dnl Developers, please strive to achieve this order:
55
dnl
@@ -1003,6 +1003,7 @@ AC_SUBST(THREAD_LIBS)
10031003
# functions are marked "not found", which is perfect.
10041004
#
10051005
if test "$enable_thread_safety" = yes -a "$NEED_REENTRANT_FUNCS" = yes ; then
1006+
AC_DEFINE(NEED_REENTRANT_FUNCS, 1, [Define if non *_r libc functions are not thread safe])
10061007
_CFLAGS="$CFLAGS"
10071008
_LIBS="$LIBS"
10081009
CFLAGS="$CFLAGS $THREAD_CPPFLAGS"

src/include/pg_config.h.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -554,6 +554,9 @@
554554
/* Define as the maximum alignment requirement of any C data type. */
555555
#undef MAXIMUM_ALIGNOF
556556

557+
/* Define if non *_r libc functions are not thread safe */
558+
#undef NEED_REENTRANT_FUNCS
559+
557560
/* Define to the address where bug reports for this package should be sent. */
558561
#undef PACKAGE_BUGREPORT
559562

0 commit comments

Comments
 (0)