
Raymond Toy pushed to branch issue-386-generate-def-unix-error at cmucl / cmucl Commits: 30f4504e by Raymond Toy at 2025-03-01T08:01:43-08:00 Want the second definition for duplicates Modify script so that if we find a duplicate, we mark the old as something to be skipped on output. We want the second (last) definition. This is needed on Darwin where we want the second definition of EOPNOTSUPP. Tested this with a simple C program on Darwin to print the value of EOPNOTSUPP. It is 102, not ENOTSUP (45). - - - - - 1 changed file: - bin/create-def-unix-error.awk Changes: ===================================== bin/create-def-unix-error.awk ===================================== @@ -4,27 +4,26 @@ BEGIN { # Find anything that matches '#define Efoo value' /^#define[ \t]+(E[A-Z0-9]+)[ \t]+([A-Z0-9]+).*$/ { - # If we haven't found $2 in errno before, add it to the table. - # This is to catch any duplicates. We assume the latter value is - # NOT what we want. This happens on Darwin where EOPNOSUPP is - # defined twice due to #if's. found = 0 + # Search to see if the current key, $2, is already in the table. + # If so, we mark it as something to skip. This happens on Darwin + # where EOPNTOSUPP is seen twice. We want the second entry. for (key in errno) { if (errno[key] == $2) { - printf ";; Ignoring dup of %s: old value %d, new value %\n", $2, errno[key], $3; + printf ";; Ignoring dup of %s: old value %s, new value %s\n", $2, value[key], $3; found = 1; + skip[key] = 1; break; } } - if (!found) { - errno[count] = $2; - value[count] = $3; - ++count; - } + errno[count] = $2; + value[count] = $3; + ++count; } END { for (k = 0; k < count; ++k) { - printf "(def-unix-error %s %s)\n", errno[k], value[k]; + printf "%s(def-unix-error %s %s)\n", + (skip[k] != 1) ? "": ";; ", errno[k], value[k]; } } View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/30f4504e9f7b3bc1e45c375b... -- View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/30f4504e9f7b3bc1e45c375b... You're receiving this email because of your account on gitlab.common-lisp.net.
participants (1)
-
Raymond Toy (@rtoy)