Skip to content

Commit

Permalink
Rely on C89 "const"
Browse files Browse the repository at this point in the history
The metaconfig probe for <db.h> previously relied on the d_const symbol set
by the "const" probe, so generating Configure here has been done against
metaconfig commit 1204d46 which changes
that.

Thanks to khw++ for pointing out this oversight in my attempt last year to
make the codebase rely on C89.
  • Loading branch information
arc committed Nov 27, 2018
1 parent daced5a commit 79ad520
Show file tree
Hide file tree
Showing 24 changed files with 3 additions and 153 deletions.
1 change: 1 addition & 0 deletions .metaconf-exclusions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ I_LIMITS
I_STDARG
index
rindex
const
35 changes: 0 additions & 35 deletions Configure
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,6 @@ d_clearenv=''
d_closedir=''
d_void_closedir=''
d_cmsghdr_s=''
d_const=''
d_copysign=''
d_copysignl=''
d_cplusplus=''
Expand Down Expand Up @@ -12054,27 +12053,6 @@ case "$d_cmsghdr_s" in
*) echo "No, it doesn't." ;;
esac

: check for const keyword
echo " "
echo 'Checking to see if your C compiler knows about "const"...' >&4
$cat >const.c <<'EOCP'
typedef struct spug { int drokk; } spug;
int main()
{
const char *foo;
const spug y = { 0 };
}
EOCP
if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
val="$define"
echo "Yup, it does."
else
val="$undef"
echo "Nope, it doesn't."
fi
set d_const
eval $setvar

: see if copysign exists
set copysign d_copysign
eval $inlibc
Expand Down Expand Up @@ -19856,10 +19834,6 @@ $define)
echo " "
echo "Checking Berkeley DB version ..." >&4
$cat >try.c <<EOCP
#$d_const HASCONST
#ifndef HASCONST
#define const
#endif
#include <sys/types.h>
#include <stdio.h>
#$i_stdlib I_STDLIB
Expand Down Expand Up @@ -19950,10 +19924,6 @@ define)
echo " "
echo "Checking return type needed for hash for Berkeley DB ..." >&4
$cat >try.c <<EOCP
#$d_const HASCONST
#ifndef HASCONST
#define const
#endif
#include <sys/types.h>
#include <db.h>

Expand Down Expand Up @@ -19994,10 +19964,6 @@ define)
echo " "
echo "Checking return type needed for prefix for Berkeley DB ..." >&4
cat >try.c <<EOCP
#$d_const HASCONST
#ifndef HASCONST
#define const
#endif
#include <sys/types.h>
#include <db.h>

Expand Down Expand Up @@ -23843,7 +23809,6 @@ d_class='$d_class'
d_clearenv='$d_clearenv'
d_closedir='$d_closedir'
d_cmsghdr_s='$d_cmsghdr_s'
d_const='$d_const'
d_copysign='$d_copysign'
d_copysignl='$d_copysignl'
d_cplusplus='$d_cplusplus'
Expand Down
1 change: 0 additions & 1 deletion Cross/config.sh-arm-linux
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ d_class='undef'
d_clearenv='define'
d_closedir='define'
d_cmsghdr_s='define'
d_const='define'
d_copysign='undef'
d_copysignl='define'
d_cplusplus='undef'
Expand Down
1 change: 0 additions & 1 deletion Cross/config.sh-arm-linux-n770
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ d_class='undef'
d_clearenv='define'
d_closedir='define'
d_cmsghdr_s='define'
d_const='define'
d_copysign='undef'
d_copysignl='define'
d_cplusplus='undef'
Expand Down
1 change: 0 additions & 1 deletion NetWare/config.wc
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ d_class='undef'
d_clearenv='undef'
d_closedir='define'
d_cmsghdr_s='undef'
d_const='define'
d_copysign='undef'
d_copysignl='undef'
d_cplusplus='undef'
Expand Down
11 changes: 0 additions & 11 deletions NetWare/config_H.wc
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,6 @@
*/
#define HAS_CHSIZE /**/

/* HASCONST:
* This symbol, if defined, indicates that this C compiler knows about
* the const type. There is no need to actually test for that symbol
* within your programs. The mere use of the "const" keyword will
* trigger the necessary tests.
*/
#define HASCONST /**/
#ifndef HASCONST
#define const
#endif

/* HAS_CRYPT:
* This symbol, if defined, indicates that the crypt routine is available
* to encrypt passwords and the like.
Expand Down
5 changes: 0 additions & 5 deletions Porting/Glossary
Original file line number Diff line number Diff line change
Expand Up @@ -584,11 +584,6 @@ d_cmsghdr_s (d_cmsghdr_s.U):
This variable conditionally defines the HAS_STRUCT_CMSGHDR symbol,
which indicates that the struct cmsghdr is supported.

d_const (d_const.U):
This variable conditionally defines the HASCONST symbol, which
indicates to the C program that this C compiler knows about the
const type.

d_copysign (d_copysign.U):
This variable conditionally defines the HAS_COPYSIGN symbol, which
indicates to the C program that the copysign() routine is available.
Expand Down
1 change: 0 additions & 1 deletion Porting/config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ d_class='undef'
d_clearenv='define'
d_closedir='define'
d_cmsghdr_s='define'
d_const='define'
d_copysign='define'
d_copysignl='define'
d_cplusplus='undef'
Expand Down
11 changes: 0 additions & 11 deletions Porting/config_H
Original file line number Diff line number Diff line change
Expand Up @@ -1483,17 +1483,6 @@
*/
#define HAS_BACKTRACE /**/

/* HASCONST:
* This symbol, if defined, indicates that this C compiler knows about
* the const type. There is no need to actually test for that symbol
* within your programs. The mere use of the "const" keyword will
* trigger the necessary tests.
*/
#define HASCONST /**/
#ifndef HASCONST
#define const
#endif

/* HAS_CSH:
* This symbol, if defined, indicates that the C-shell exists.
*/
Expand Down
11 changes: 0 additions & 11 deletions config_h.SH
Original file line number Diff line number Diff line change
Expand Up @@ -1514,17 +1514,6 @@ sed <<!GROK!THIS! >$CONFIG_H -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un
*/
#$d_backtrace HAS_BACKTRACE /**/
/* HASCONST:
* This symbol, if defined, indicates that this C compiler knows about
* the const type. There is no need to actually test for that symbol
* within your programs. The mere use of the "const" keyword will
* trigger the necessary tests.
*/
#$d_const HASCONST /**/
#ifndef HASCONST
#define const
#endif
/* HAS_CSH:
* This symbol, if defined, indicates that the C-shell exists.
*/
Expand Down
1 change: 0 additions & 1 deletion configure.com
Original file line number Diff line number Diff line change
Expand Up @@ -5969,7 +5969,6 @@ $ WC "d_chsize='undef'"
$ WC "d_class='undef'"
$ WC "d_closedir='define'"
$ WC "d_cmsghdr_s='undef'"
$ WC "d_const='define'"
$ WC "d_copysign='" + d_copysign + "'"
$ WC "d_copysignl='define'"
$ WC "d_cplusplus='" + d_cplusplus + "'"
Expand Down
11 changes: 0 additions & 11 deletions plan9/config.plan9
Original file line number Diff line number Diff line change
Expand Up @@ -110,17 +110,6 @@
*/
/*#define HAS_CHSIZE / **/

/* HASCONST:
* This symbol, if defined, indicates that this C compiler knows about
* the const type. There is no need to actually test for that symbol
* within your programs. The mere use of the "const" keyword will
* trigger the necessary tests.
*/
#define HASCONST /**/
#ifndef HASCONST
#define const
#endif

/* HAS_CUSERID:
* This symbol, if defined, indicates that the cuserid routine is
* available to get character login names.
Expand Down
11 changes: 0 additions & 11 deletions plan9/config_h.sample
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,6 @@
*/
/*#define HAS_CHSIZE / **/

/* HASCONST:
* This symbol, if defined, indicates that this C compiler knows about
* the const type. There is no need to actually test for that symbol
* within your programs. The mere use of the "const" keyword will
* trigger the necessary tests.
*/
#define HASCONST /**/
#ifndef HASCONST
#define const
#endif

/* HAS_CUSERID:
* This symbol, if defined, indicates that the cuserid routine is
* available to get character login names.
Expand Down
1 change: 0 additions & 1 deletion plan9/config_sh.sample
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ d_class='undef'
d_clearenv='undef'
d_closedir='define'
d_cmsghdr_s='undef'
d_const='define'
d_copysign='undef'
d_copysignl='undef'
d_cplusplus='undef'
Expand Down
1 change: 0 additions & 1 deletion symbian/config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ d_class='undef'
d_clearenv='undef'
d_closedir='undef'
d_cmsghdr_s='undef'
d_const='define'
d_copysign='undef'
d_copysignl='undef'
d_cplusplus='undef'
Expand Down
15 changes: 2 additions & 13 deletions uconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -1479,17 +1479,6 @@
*/
/*#define HAS_BACKTRACE / **/

/* HASCONST:
* This symbol, if defined, indicates that this C compiler knows about
* the const type. There is no need to actually test for that symbol
* within your programs. The mere use of the "const" keyword will
* trigger the necessary tests.
*/
/*#define HASCONST / **/
#ifndef HASCONST
#define const
#endif

/* HAS_CSH:
* This symbol, if defined, indicates that the C-shell exists.
*/
Expand Down Expand Up @@ -5230,6 +5219,6 @@
#endif

/* Generated from:
* 86429d6dea8cb2d81b30da9d916693eb4c04ebeb21969c8df6f470ac77cd5c92 config_h.SH
* fd30f4a36ebf71b0b366649cee58bb37d9d61863201e087e8f40e4ceae0abf1d uconfig.sh
* 875df2221ab768da0a87740ad45e12bbc9e3b483bfa1a913727e982350ad74cf config_h.SH
* 24ca29f990de08f8119ad2c15f060361b86fc407caab088289d7d5ac3e0f117a uconfig.sh
* ex: set ro: */
1 change: 0 additions & 1 deletion uconfig.sh
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ d_class='undef'
d_clearenv='undef'
d_closedir='define'
d_cmsghdr_s='undef'
d_const='undef'
d_copysign='undef'
d_copysignl='undef'
d_cplusplus='undef'
Expand Down
1 change: 0 additions & 1 deletion uconfig64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ d_class='undef'
d_clearenv='undef'
d_closedir='define'
d_cmsghdr_s='undef'
d_const='undef'
d_copysign='undef'
d_copysignl='undef'
d_cplusplus='undef'
Expand Down
1 change: 0 additions & 1 deletion win32/config.ce
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ d_class='undef'
d_clearenv='undef'
d_closedir='define'
d_cmsghdr_s='undef'
d_const='define'
d_copysign='undef'
d_copysignl='undef'
d_cplusplus='undef'
Expand Down
1 change: 0 additions & 1 deletion win32/config.gc
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ d_class='undef'
d_clearenv='undef'
d_closedir='define'
d_cmsghdr_s='undef'
d_const='define'
d_copysign='undef'
d_copysignl='undef'
d_cplusplus='undef'
Expand Down
1 change: 0 additions & 1 deletion win32/config.vc
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ d_class='undef'
d_clearenv='undef'
d_closedir='define'
d_cmsghdr_s='undef'
d_const='define'
d_copysign='undef'
d_copysignl='undef'
d_cplusplus='undef'
Expand Down
11 changes: 0 additions & 11 deletions win32/config_H.ce
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,6 @@
*/
#define HAS_CHSIZE /**/

/* HASCONST:
* This symbol, if defined, indicates that this C compiler knows about
* the const type. There is no need to actually test for that symbol
* within your programs. The mere use of the "const" keyword will
* trigger the necessary tests.
*/
#define HASCONST /**/
#ifndef HASCONST
#define const
#endif

/* HAS_CUSERID:
* This symbol, if defined, indicates that the cuserid routine is
* available to get character login names.
Expand Down
11 changes: 0 additions & 11 deletions win32/config_H.gc
Original file line number Diff line number Diff line change
Expand Up @@ -1474,17 +1474,6 @@
*/
/*#define HAS_BACKTRACE / **/

/* HASCONST:
* This symbol, if defined, indicates that this C compiler knows about
* the const type. There is no need to actually test for that symbol
* within your programs. The mere use of the "const" keyword will
* trigger the necessary tests.
*/
#define HASCONST /**/
#ifndef HASCONST
#define const
#endif

/* HAS_CSH:
* This symbol, if defined, indicates that the C-shell exists.
*/
Expand Down
11 changes: 0 additions & 11 deletions win32/config_H.vc
Original file line number Diff line number Diff line change
Expand Up @@ -1467,17 +1467,6 @@
*/
/*#define HAS_BACKTRACE / **/

/* HASCONST:
* This symbol, if defined, indicates that this C compiler knows about
* the const type. There is no need to actually test for that symbol
* within your programs. The mere use of the "const" keyword will
* trigger the necessary tests.
*/
#define HASCONST /**/
#ifndef HASCONST
#define const
#endif

/* HAS_CSH:
* This symbol, if defined, indicates that the C-shell exists.
*/
Expand Down

0 comments on commit 79ad520

Please sign in to comment.