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

Commit18ab41e

Browse files
committed
Add configure-time check whether sig_atomic_t is defined; if not,
provide a default definition equating it to 'int'. Should trigger onlyon machines with pre-ANSI-C header files, eg SunOS 4.1.x.
1 parent4ea2b8f commit18ab41e

File tree

4 files changed

+76
-27
lines changed

4 files changed

+76
-27
lines changed

‎configure

Lines changed: 62 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -8281,21 +8281,23 @@ EOF
82818281

82828282

82838283
# Some platforms predefine the types int8, int16, etc. Only check
8284-
# a (hopefully) representative subset.
8284+
# a (hopefully) representative subset. We also check for sig_atomic_t,
8285+
# which *should* be defined per ANSI C, but is missing on some old platforms.
82858286

82868287
pgac_type_includes="\
82878288
#include <stdio.h>
8289+
#include <signal.h>
82888290
#ifdef HAVE_SUPPORTDEFS_H
82898291
#include <SupportDefs.h>
82908292
#endif"
82918293

82928294
echo$ac_n"checking for int8""...$ac_c"1>&6
8293-
echo"configure:8294: checking for int8">&5
8295+
echo"configure:8296: checking for int8">&5
82948296
ifeval"test\"`echo'$''{'pgac_cv_have_int8'+set}'`\" = set";then
82958297
echo$ac_n"(cached)$ac_c"1>&6
82968298
else
82978299
cat> conftest.$ac_ext<<EOF
8298-
#line8299 "configure"
8300+
#line8301 "configure"
82998301
#include "confdefs.h"
83008302
$pgac_type_includes
83018303
int main() {
@@ -8305,7 +8307,7 @@ if (sizeof (int8))
83058307
return 0;
83068308
; return 0; }
83078309
EOF
8308-
if { (evalecho configure:8309:\"$ac_compile\")1>&5; (eval$ac_compile)2>&5; };then
8310+
if { (evalecho configure:8311:\"$ac_compile\")1>&5; (eval$ac_compile)2>&5; };then
83098311
rm -rf conftest*
83108312
pgac_cv_have_int8=yes
83118313
else
@@ -8326,12 +8328,12 @@ EOF
83268328
fi
83278329

83288330
echo$ac_n"checking for uint8""...$ac_c"1>&6
8329-
echo"configure:8330: checking for uint8">&5
8331+
echo"configure:8332: checking for uint8">&5
83308332
ifeval"test\"`echo'$''{'pgac_cv_have_uint8'+set}'`\" = set";then
83318333
echo$ac_n"(cached)$ac_c"1>&6
83328334
else
83338335
cat> conftest.$ac_ext<<EOF
8334-
#line8335 "configure"
8336+
#line8337 "configure"
83358337
#include "confdefs.h"
83368338
$pgac_type_includes
83378339
int main() {
@@ -8341,7 +8343,7 @@ if (sizeof (uint8))
83418343
return 0;
83428344
; return 0; }
83438345
EOF
8344-
if { (evalecho configure:8345:\"$ac_compile\")1>&5; (eval$ac_compile)2>&5; };then
8346+
if { (evalecho configure:8347:\"$ac_compile\")1>&5; (eval$ac_compile)2>&5; };then
83458347
rm -rf conftest*
83468348
pgac_cv_have_uint8=yes
83478349
else
@@ -8362,12 +8364,12 @@ EOF
83628364
fi
83638365

83648366
echo$ac_n"checking for int64""...$ac_c"1>&6
8365-
echo"configure:8366: checking for int64">&5
8367+
echo"configure:8368: checking for int64">&5
83668368
ifeval"test\"`echo'$''{'pgac_cv_have_int64'+set}'`\" = set";then
83678369
echo$ac_n"(cached)$ac_c"1>&6
83688370
else
83698371
cat> conftest.$ac_ext<<EOF
8370-
#line8371 "configure"
8372+
#line8373 "configure"
83718373
#include "confdefs.h"
83728374
$pgac_type_includes
83738375
int main() {
@@ -8377,7 +8379,7 @@ if (sizeof (int64))
83778379
return 0;
83788380
; return 0; }
83798381
EOF
8380-
if { (evalecho configure:8381:\"$ac_compile\")1>&5; (eval$ac_compile)2>&5; };then
8382+
if { (evalecho configure:8383:\"$ac_compile\")1>&5; (eval$ac_compile)2>&5; };then
83818383
rm -rf conftest*
83828384
pgac_cv_have_int64=yes
83838385
else
@@ -8398,12 +8400,12 @@ EOF
83988400
fi
83998401

84008402
echo$ac_n"checking for uint64""...$ac_c"1>&6
8401-
echo"configure:8402: checking for uint64">&5
8403+
echo"configure:8404: checking for uint64">&5
84028404
ifeval"test\"`echo'$''{'pgac_cv_have_uint64'+set}'`\" = set";then
84038405
echo$ac_n"(cached)$ac_c"1>&6
84048406
else
84058407
cat> conftest.$ac_ext<<EOF
8406-
#line8407 "configure"
8408+
#line8409 "configure"
84078409
#include "confdefs.h"
84088410
$pgac_type_includes
84098411
int main() {
@@ -8413,7 +8415,7 @@ if (sizeof (uint64))
84138415
return 0;
84148416
; return 0; }
84158417
EOF
8416-
if { (evalecho configure:8417:\"$ac_compile\")1>&5; (eval$ac_compile)2>&5; };then
8418+
if { (evalecho configure:8419:\"$ac_compile\")1>&5; (eval$ac_compile)2>&5; };then
84178419
rm -rf conftest*
84188420
pgac_cv_have_uint64=yes
84198421
else
@@ -8433,15 +8435,51 @@ EOF
84338435

84348436
fi
84358437

8438+
echo$ac_n"checking for sig_atomic_t""...$ac_c"1>&6
8439+
echo"configure:8440: checking for sig_atomic_t">&5
8440+
ifeval"test\"`echo'$''{'pgac_cv_have_sig_atomic_t'+set}'`\" = set";then
8441+
echo$ac_n"(cached)$ac_c"1>&6
8442+
else
8443+
cat> conftest.$ac_ext<<EOF
8444+
#line 8445 "configure"
8445+
#include "confdefs.h"
8446+
$pgac_type_includes
8447+
int main() {
8448+
if ((sig_atomic_t *) 0)
8449+
return 0;
8450+
if (sizeof (sig_atomic_t))
8451+
return 0;
8452+
; return 0; }
8453+
EOF
8454+
if { (evalecho configure:8455:\"$ac_compile\")1>&5; (eval$ac_compile)2>&5; };then
8455+
rm -rf conftest*
8456+
pgac_cv_have_sig_atomic_t=yes
8457+
else
8458+
echo"configure: failed program was:">&5
8459+
cat conftest.$ac_ext>&5
8460+
rm -rf conftest*
8461+
pgac_cv_have_sig_atomic_t=no
8462+
fi
8463+
rm -f conftest*
8464+
fi
8465+
8466+
echo"$ac_t""$pgac_cv_have_sig_atomic_t"1>&6
8467+
iftest"$pgac_cv_have_sig_atomic_t" = yes;then
8468+
cat>> confdefs.h<<\EOF
8469+
#define HAVE_SIG_ATOMIC_T 1
8470+
EOF
8471+
8472+
fi
8473+
84368474

84378475

84388476
echo$ac_n"checking for POSIX signal interface""...$ac_c"1>&6
8439-
echo"configure:8440: checking for POSIX signal interface">&5
8477+
echo"configure:8478: checking for POSIX signal interface">&5
84408478
ifeval"test\"`echo'$''{'pgac_cv_func_posix_signals'+set}'`\" = set";then
84418479
echo$ac_n"(cached)$ac_c"1>&6
84428480
else
84438481
cat> conftest.$ac_ext<<EOF
8444-
#line8445 "configure"
8482+
#line8483 "configure"
84458483
#include "confdefs.h"
84468484
#include <signal.h>
84478485
@@ -8452,7 +8490,7 @@ act.sa_flags = SA_RESTART;
84528490
sigaction(0, &act, &oact);
84538491
; return 0; }
84548492
EOF
8455-
if { (evalecho configure:8456:\"$ac_link\")1>&5; (eval$ac_link)2>&5; }&&test -s conftest${ac_exeext};then
8493+
if { (evalecho configure:8494:\"$ac_link\")1>&5; (eval$ac_link)2>&5; }&&test -s conftest${ac_exeext};then
84568494
rm -rf conftest*
84578495
pgac_cv_func_posix_signals=yes
84588496
else
@@ -8482,7 +8520,7 @@ do
84828520
# Extract the first word of "$ac_prog", so it can be a program name with args.
84838521
set dummy$ac_prog; ac_word=$2
84848522
echo$ac_n"checking for$ac_word""...$ac_c"1>&6
8485-
echo"configure:8486: checking for$ac_word">&5
8523+
echo"configure:8524: checking for$ac_word">&5
84868524
ifeval"test\"`echo'$''{'ac_cv_path_TCLSH'+set}'`\" = set";then
84878525
echo$ac_n"(cached)$ac_c"1>&6
84888526
else
@@ -8518,7 +8556,7 @@ test -n "$TCLSH" && break
85188556
done
85198557

85208558
echo$ac_n"checking for tclConfig.sh""...$ac_c"1>&6
8521-
echo"configure:8522: checking for tclConfig.sh">&5
8559+
echo"configure:8560: checking for tclConfig.sh">&5
85228560
# Let user override test
85238561
iftest -z"$TCL_CONFIG_SH";then
85248562
pgac_test_dirs="$with_tclconfig"
@@ -8551,7 +8589,7 @@ fi
85518589
# Check for Tk configuration script tkConfig.sh
85528590
iftest"$with_tk" = yes;then
85538591
echo$ac_n"checking for tkConfig.sh""...$ac_c"1>&6
8554-
echo"configure:8555: checking for tkConfig.sh">&5
8592+
echo"configure:8593: checking for tkConfig.sh">&5
85558593
# Let user override test
85568594
iftest -z"$TK_CONFIG_SH";then
85578595
pgac_test_dirs="$with_tkconfig$with_tclconfig"
@@ -8590,7 +8628,7 @@ do
85908628
# Extract the first word of "$ac_prog", so it can be a program name with args.
85918629
set dummy$ac_prog; ac_word=$2
85928630
echo$ac_n"checking for$ac_word""...$ac_c"1>&6
8593-
echo"configure:8594: checking for$ac_word">&5
8631+
echo"configure:8632: checking for$ac_word">&5
85948632
ifeval"test\"`echo'$''{'ac_cv_prog_NSGMLS'+set}'`\" = set";then
85958633
echo$ac_n"(cached)$ac_c"1>&6
85968634
else
@@ -8626,7 +8664,7 @@ do
86268664
# Extract the first word of "$ac_prog", so it can be a program name with args.
86278665
set dummy$ac_prog; ac_word=$2
86288666
echo$ac_n"checking for$ac_word""...$ac_c"1>&6
8629-
echo"configure:8630: checking for$ac_word">&5
8667+
echo"configure:8668: checking for$ac_word">&5
86308668
ifeval"test\"`echo'$''{'ac_cv_prog_JADE'+set}'`\" = set";then
86318669
echo$ac_n"(cached)$ac_c"1>&6
86328670
else
@@ -8657,7 +8695,7 @@ done
86578695

86588696

86598697
echo$ac_n"checking for DocBook V3.1""...$ac_c"1>&6
8660-
echo"configure:8661: checking for DocBook V3.1">&5
8698+
echo"configure:8699: checking for DocBook V3.1">&5
86618699
ifeval"test\"`echo'$''{'pgac_cv_check_docbook'+set}'`\" = set";then
86628700
echo$ac_n"(cached)$ac_c"1>&6
86638701
else
@@ -8690,7 +8728,7 @@ have_docbook=$pgac_cv_check_docbook
86908728

86918729

86928730
echo$ac_n"checking for DocBook stylesheets""...$ac_c"1>&6
8693-
echo"configure:8694: checking for DocBook stylesheets">&5
8731+
echo"configure:8732: checking for DocBook stylesheets">&5
86948732
ifeval"test\"`echo'$''{'pgac_cv_path_stylesheets'+set}'`\" = set";then
86958733
echo$ac_n"(cached)$ac_c"1>&6
86968734
else
@@ -8729,7 +8767,7 @@ do
87298767
# Extract the first word of "$ac_prog", so it can be a program name with args.
87308768
set dummy$ac_prog; ac_word=$2
87318769
echo$ac_n"checking for$ac_word""...$ac_c"1>&6
8732-
echo"configure:8733: checking for$ac_word">&5
8770+
echo"configure:8771: checking for$ac_word">&5
87338771
ifeval"test\"`echo'$''{'ac_cv_prog_SGMLSPL'+set}'`\" = set";then
87348772
echo$ac_n"(cached)$ac_c"1>&6
87358773
else

‎configure.in

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1171,10 +1171,12 @@ AC_DEFINE_UNQUOTED(MAXIMUM_ALIGNOF, $MAX_ALIGNOF, [Define as the maximum alignme
11711171

11721172

11731173
# Some platforms predefine the types int8, int16, etc. Only check
1174-
# a (hopefully) representative subset.
1174+
# a (hopefully) representative subset. We also check for sig_atomic_t,
1175+
# which *should* be defined per ANSI C, but is missing on some old platforms.
11751176

11761177
pgac_type_includes="\
11771178
#include <stdio.h>
1179+
#include <signal.h>
11781180
#ifdef HAVE_SUPPORTDEFS_H
11791181
#include <SupportDefs.h>
11801182
#endif"
@@ -1183,6 +1185,7 @@ PGAC_CHECK_TYPE(int8, [], [], [$pgac_type_includes])
11831185
PGAC_CHECK_TYPE(uint8, [], [], [$pgac_type_includes])
11841186
PGAC_CHECK_TYPE(int64, [], [], [$pgac_type_includes])
11851187
PGAC_CHECK_TYPE(uint64, [], [], [$pgac_type_includes])
1188+
PGAC_CHECK_TYPE(sig_atomic_t, [], [], [$pgac_type_includes])
11861189

11871190

11881191
PGAC_FUNC_POSIX_SIGNALS

‎src/include/c.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
1313
* Portions Copyright (c) 1994, Regents of the University of California
1414
*
15-
* $Id: c.h,v 1.112 2001/12/02 11:38:40 petere Exp $
15+
* $Id: c.h,v 1.113 2001/12/03 17:44:52 tgl Exp $
1616
*
1717
*-------------------------------------------------------------------------
1818
*/
@@ -302,6 +302,11 @@ typedef unsigned long int uint64;
302302

303303
#endif/* not HAVE_LONG_INT_64 and not HAVE_LONG_LONG_INT_64 */
304304

305+
/* sig_atomic_t is required by ANSI C, but may be missing on old platforms */
306+
#ifndefHAVE_SIG_ATOMIC_T
307+
typedefintsig_atomic_t;
308+
#endif
309+
305310
/*
306311
* Size
307312
*Size of any memory resident object, as returned by sizeof.

‎src/include/pg_config.h.in

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* or in pg_config.h afterwards. Of course, if you edit pg_config.h, then your
99
* changes will be overwritten the next time you run configure.
1010
*
11-
* $Id: pg_config.h.in,v 1.14 2001/12/02 11:38:40 petere Exp $
11+
* $Id: pg_config.h.in,v 1.15 2001/12/03 17:44:52 tgl Exp $
1212
*/
1313

1414
#ifndefPG_CONFIG_H
@@ -697,10 +697,13 @@ extern int fdatasync(int fildes);
697697
/* Define if you have on_exit() */
698698
#undef HAVE_ON_EXIT
699699

700+
/* Define if the corresponding types are defined in standard headers */
700701
#undef HAVE_INT8
701702
#undef HAVE_UINT8
702703
#undef HAVE_INT64
703704
#undef HAVE_UINT64
705+
#undef HAVE_SIG_ATOMIC_T
706+
704707

705708
/*
706709
*------------------------------------------------------------------------

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp