summaryrefslogtreecommitdiff
path: root/conform
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2001-01-27 05:30:29 +0000
committerUlrich Drepper <drepper@redhat.com>2001-01-27 05:30:29 +0000
commitda23829807c8e5f4c5a179a3fa693250f9d7f6c1 (patch)
tree2de0ef3e874f36cd5f1c79cf5821f2ad77bb74b6 /conform
parent3eee1304546b2562810efb96d48299bba41a6cbe (diff)
downloadglibc-da23829807c8e5f4c5a179a3fa693250f9d7f6c1.tar.gz
Update.
* conform/conformtest.pl: Implement optional-element. Define $mustprepend{"sched.h"}. * conform/data/sched.h-data: Make sporadic scheduler definitions optional. * pwd/pwd.h: Don't define getpwent_r for XPG.
Diffstat (limited to 'conform')
-rw-r--r--conform/conformtest.pl43
-rw-r--r--conform/data/netinet/in.h-data2
-rw-r--r--conform/data/pwd.h-data2
-rw-r--r--conform/data/sched.h-data10
4 files changed, 49 insertions, 8 deletions
diff --git a/conform/conformtest.pl b/conform/conformtest.pl
index 6ac72af460..a121554d07 100644
--- a/conform/conformtest.pl
+++ b/conform/conformtest.pl
@@ -54,6 +54,7 @@ $CFLAGS{"XOPEN2K"} = "-I. '-D__attribute__(x)=' -D_XOPEN_SOURCE=600";
# Some headers need a bit more attention.
$mustprepend{'regex.h'} = "#include <sys/types.h>\n";
+$mustprepend{'sched.h'} = "#include <sys/types.h>\n";
$mustprepend{'wordexp.h'} = "#include <stddef.h>\n";
# Make a hash table from this information.
@@ -341,7 +342,47 @@ while ($#headers >= 0) {
close (TESTFILE);
compiletest ($fnamebase, "Testing for type of member $member",
- "Member \"$member\" does not have the correct type.", $res);
+ "Member \"$member\" does not have the correct type.",
+ $res, 0);
+ } elsif (/^optional-element *({([^}]*)}|([^{ ]*)) *({([^}]*)}|([^{ ]*)) *([A-Za-z0-9_]*) *(.*)/) {
+ my($struct) = "$2$3";
+ my($type) = "$5$6";
+ my($member) = "$7";
+ my($rest) = "$8";
+ my($res) = $missing;
+
+ # Remember that this name is allowed.
+ push @allow, $member;
+
+ # Generate a program to test for the availability of this member.
+ open (TESTFILE, ">$fnamebase.c");
+ print TESTFILE "$prepend";
+ print TESTFILE "#include <$h>\n";
+ print TESTFILE "$struct a;\n";
+ print TESTFILE "$struct b;\n";
+ print TESTFILE "extern void xyzzy (__typeof__ (&b.$member), __typeof__ (&a.$member), unsigned);\n";
+ print TESTFILE "void foobarbaz (void) {\n";
+ print TESTFILE " xyzzy (&a.$member, &b.$member, sizeof (a.$member));\n";
+ print TESTFILE "}\n";
+ close (TESTFILE);
+
+ $res = compiletest ($fnamebase, "Testing for member $member",
+ "NOT AVAILABLE.", $res, 1);
+
+ if ($res == 0 || $missing != 0) {
+ # Test the types of the members.
+ open (TESTFILE, ">$fnamebase.c");
+ print TESTFILE "$prepend";
+ print TESTFILE "#include <$h>\n";
+ print TESTFILE "$struct a;\n";
+ print TESTFILE "extern $type b$rest;\n";
+ print TESTFILE "extern __typeof__ (a.$member) b;\n";
+ close (TESTFILE);
+
+ compiletest ($fnamebase, "Testing for type of member $member",
+ "Member \"$member\" does not have the correct type.",
+ $res, 0);
+ }
} elsif (/^optional-constant *([a-zA-Z0-9_]*) ([>=<]+) ([A-Za-z0-9_]*)/) {
my($const) = $1;
my($op) = $2;
diff --git a/conform/data/netinet/in.h-data b/conform/data/netinet/in.h-data
index 5228cc46f7..edbfaa7a4c 100644
--- a/conform/data/netinet/in.h-data
+++ b/conform/data/netinet/in.h-data
@@ -39,7 +39,7 @@ macro IN6ADDR_LOOPBACK_INIT
type {struct ipv6_mreq}
-element {struct ipv6_mreq} {struct int6_addr} ipv6mr_multiaddr
+element {struct ipv6_mreq} {struct in6_addr} ipv6mr_multiaddr
element {struct ipv6_mreq} {unsigned int} ipv6mr_interface
macro IPPROTO_IP
diff --git a/conform/data/pwd.h-data b/conform/data/pwd.h-data
index bd517b4cc5..1267708b98 100644
--- a/conform/data/pwd.h-data
+++ b/conform/data/pwd.h-data
@@ -17,7 +17,7 @@ function int getpwnam_r (const char*, struct passwd*, char*, size_t, struct pass
function int getpwuid_r (uid_t, struct passwd*, char*, size_t, struct passwd**)
function void endpwent (void)
function {struct passwd*} getpwent (void)
-funciton void setpwent (void)
+function void setpwent (void)
allow pw_*
allow *_t
diff --git a/conform/data/sched.h-data b/conform/data/sched.h-data
index 4cc11efdc8..d4c5ae72cd 100644
--- a/conform/data/sched.h-data
+++ b/conform/data/sched.h-data
@@ -1,14 +1,14 @@
#ifndef ISO
type {struct sched_param}
element {struct sched_param} int sched_priority
-element {struct sched_param} int sched_ss_low_priority
-element {struct sched_param} {struct timespec} sched_ss_repl_period
-element {struct sched_param} {struct timespec} sched_ss_init_budget
-element {struct sched_param} int sched_ss_max_repl
+optional-element {struct sched_param} int sched_ss_low_priority
+optional-element {struct sched_param} {struct timespec} sched_ss_repl_period
+optional-element {struct sched_param} {struct timespec} sched_ss_init_budget
+optional-element {struct sched_param} int sched_ss_max_repl
constant SCHED_FIFO
constant SCHED_RR
-constant SCHED_SPORADIC
+optional-constant SCHED_SPORADIC
constant SCHED_OTHER
function int sched_get_priority_max (int)