Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6f14eff

Browse files
committed
New versions of mingw have gettimeofday(), so add an autoconf test
for this.
1 parentf9e83a5 commit6f14eff

File tree

5 files changed

+126
-10
lines changed

5 files changed

+126
-10
lines changed

‎configure

Lines changed: 110 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16962,14 +16962,118 @@ esac
1696216962

1696316963
# Win32 support
1696416964
if test "$PORTNAME" = "win32"; then
16965-
case $LIBOBJS in
16966-
"gettimeofday.$ac_objext" | \
16967-
*" gettimeofday.$ac_objext" | \
16968-
"gettimeofday.$ac_objext "* | \
16969-
*" gettimeofday.$ac_objext "* ) ;;
16970-
*) LIBOBJS="$LIBOBJS gettimeofday.$ac_objext" ;;
16965+
16966+
for ac_func in gettimeofday
16967+
do
16968+
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
16969+
echo "$as_me:$LINENO: checking for $ac_func" >&5
16970+
echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
16971+
if eval "test \"\${$as_ac_var+set}\" = set"; then
16972+
echo $ECHO_N "(cached) $ECHO_C" >&6
16973+
else
16974+
cat >conftest.$ac_ext <<_ACEOF
16975+
/* confdefs.h. */
16976+
_ACEOF
16977+
cat confdefs.h >>conftest.$ac_ext
16978+
cat >>conftest.$ac_ext <<_ACEOF
16979+
/* end confdefs.h. */
16980+
/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
16981+
For example, HP-UX 11i <limits.h> declares gettimeofday. */
16982+
#define $ac_func innocuous_$ac_func
16983+
16984+
/* System header to define __stub macros and hopefully few prototypes,
16985+
which can conflict with char $ac_func (); below.
16986+
Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
16987+
<limits.h> exists even on freestanding compilers. */
16988+
16989+
#ifdef __STDC__
16990+
# include <limits.h>
16991+
#else
16992+
# include <assert.h>
16993+
#endif
16994+
16995+
#undef $ac_func
16996+
16997+
/* Override any gcc2 internal prototype to avoid an error. */
16998+
#ifdef __cplusplus
16999+
extern "C"
17000+
{
17001+
#endif
17002+
/* We use char because int might match the return type of a gcc2
17003+
builtin and then its argument prototype would still apply. */
17004+
char $ac_func ();
17005+
/* The GNU C library defines this for functions which it implements
17006+
to always fail with ENOSYS. Some functions are actually named
17007+
something starting with __ and the normal name is an alias. */
17008+
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
17009+
choke me
17010+
#else
17011+
char (*f) () = $ac_func;
17012+
#endif
17013+
#ifdef __cplusplus
17014+
}
17015+
#endif
17016+
17017+
int
17018+
main ()
17019+
{
17020+
return f != $ac_func;
17021+
;
17022+
return 0;
17023+
}
17024+
_ACEOF
17025+
rm -f conftest.$ac_objext conftest$ac_exeext
17026+
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
17027+
(eval $ac_link) 2>conftest.er1
17028+
ac_status=$?
17029+
grep -v '^ *+' conftest.er1 >conftest.err
17030+
rm -f conftest.er1
17031+
cat conftest.err >&5
17032+
echo "$as_me:$LINENO: \$? = $ac_status" >&5
17033+
(exit $ac_status); } &&
17034+
{ ac_try='test -z "$ac_c_werror_flag"
17035+
|| test ! -s conftest.err'
17036+
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
17037+
(eval $ac_try) 2>&5
17038+
ac_status=$?
17039+
echo "$as_me:$LINENO: \$? = $ac_status" >&5
17040+
(exit $ac_status); }; } &&
17041+
{ ac_try='test -s conftest$ac_exeext'
17042+
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
17043+
(eval $ac_try) 2>&5
17044+
ac_status=$?
17045+
echo "$as_me:$LINENO: \$? = $ac_status" >&5
17046+
(exit $ac_status); }; }; then
17047+
eval "$as_ac_var=yes"
17048+
else
17049+
echo "$as_me: failed program was:" >&5
17050+
sed 's/^/| /' conftest.$ac_ext >&5
17051+
17052+
eval "$as_ac_var=no"
17053+
fi
17054+
rm -f conftest.err conftest.$ac_objext \
17055+
conftest$ac_exeext conftest.$ac_ext
17056+
fi
17057+
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
17058+
echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
17059+
if test `eval echo '${'$as_ac_var'}'` = yes; then
17060+
cat >>confdefs.h <<_ACEOF
17061+
#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
17062+
_ACEOF
17063+
17064+
else
17065+
case $LIBOBJS in
17066+
"$ac_func.$ac_objext" | \
17067+
*" $ac_func.$ac_objext" | \
17068+
"$ac_func.$ac_objext "* | \
17069+
*" $ac_func.$ac_objext "* ) ;;
17070+
*) LIBOBJS="$LIBOBJS $ac_func.$ac_objext" ;;
1697117071
esac
1697217072

17073+
fi
17074+
done
17075+
17076+
1697317077
case $LIBOBJS in
1697417078
"kill.$ac_objext" | \
1697517079
*" kill.$ac_objext" | \

‎configure.in

Lines changed: 2 additions & 2 deletions
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.531 2007/10/27 00:22:42tgl Exp $
2+
dnl $PostgreSQL: pgsql/configure.in,v 1.532 2007/10/29 11:25:42mha Exp $
33
dnl
44
dnl Developers, please strive to achieve this order:
55
dnl
@@ -1110,7 +1110,7 @@ esac
11101110

11111111
# Win32 support
11121112
if test "$PORTNAME" = "win32"; then
1113-
AC_LIBOBJ(gettimeofday)
1113+
AC_REPLACE_FUNCS(gettimeofday)
11141114
AC_LIBOBJ(kill)
11151115
AC_LIBOBJ(open)
11161116
AC_LIBOBJ(rand)

‎src/include/pg_config.h.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,9 @@
175175
/* Define to 1 if you have the `getrusage' function. */
176176
#undef HAVE_GETRUSAGE
177177

178+
/* Define to 1 if you have the `gettimeofday' function. */
179+
#undef HAVE_GETTIMEOFDAY
180+
178181
/* Define to 1 if you have the <gssapi/gssapi.h> header file. */
179182
#undef HAVE_GSSAPI_GSSAPI_H
180183

‎src/include/port.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
77
* Portions Copyright (c) 1994, Regents of the University of California
88
*
9-
* $PostgreSQL: pgsql/src/include/port.h,v 1.113 2007/09/28 22:25:49 tgl Exp $
9+
* $PostgreSQL: pgsql/src/include/port.h,v 1.114 2007/10/29 11:25:42 mha Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -296,8 +296,11 @@ extern FILE *pgwin32_fopen(const char *, const char *);
296296
externlonglrand48(void);
297297
externvoidsrand48(longseed);
298298

299+
/* New versions of MingW have gettimeofday, old mingw and msvc don't */
300+
#ifndefHAVE_GETTIMEOFDAY
299301
/* Last parameter not used */
300302
externintgettimeofday(structtimeval*tp,structtimezone*tzp);
303+
#endif
301304
#else/* !WIN32 */
302305

303306
/*

‎src/include/port/win32.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $PostgreSQL: pgsql/src/include/port/win32.h,v 1.77 2007/10/26 21:50:10 mha Exp $ */
1+
/* $PostgreSQL: pgsql/src/include/port/win32.h,v 1.78 2007/10/29 11:25:42 mha Exp $ */
22

33
#if defined(_MSC_VER)|| defined(__BORLANDC__)
44
#defineWIN32_ONLY_COMPILER
@@ -167,11 +167,17 @@
167167
#defineSIGUSR231
168168
#endif
169169

170+
/*
171+
* New versions of mingw have gettimeofday() and also declare
172+
* struct timezone to support it.
173+
*/
174+
#ifndefHAVE_GETTIMEOFDAY
170175
structtimezone
171176
{
172177
inttz_minuteswest;/* Minutes west of GMT. */
173178
inttz_dsttime;/* Nonzero if DST is ever in effect. */
174179
};
180+
#endif
175181

176182
/* for setitimer in backend/port/win32/timer.c */
177183
#defineITIMER_REAL 0

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp