
Raymond Toy pushed to branch issue-365-add-strerror-with-generated-errno-pkg at cmucl / cmucl Commits: 064b90cd by Raymond Toy at 2025-02-22T21:15:34-08:00 Use plain awk and sort to create the file Modify gen-errno-exports just to print the errno symbols in any order without the defpackage form. Modify create-errno-pkg.sh to sort the output from awk and print the defpackage form. Hopefully this will work on osx without having to install gawk. - - - - - 2 changed files: - bin/create-errno-pkg.sh - bin/gen-errno-exports.gawk Changes: ===================================== bin/create-errno-pkg.sh ===================================== @@ -6,5 +6,11 @@ case `uname -s` in Linux) ERRNO_FILES=/usr/include/asm-generic/errno*.h ;; esac - -gawk -f bin/gen-errno-exports.gawk ${ERRNO_FILES} + +cat <<EOF +(defpackage "UNIX-ERRNO" + (:export +`awk -f bin/gen-errno-exports.gawk ${ERRNO_FILES} | sort ` + )) + +EOF ===================================== bin/gen-errno-exports.gawk ===================================== @@ -1,18 +1,3 @@ -BEGIN { - count = 0 -} - /^#define[ \t]+(E[A-Z0-9]+)[ \t]+([A-Z0-9]+).*$/ { - errlist[count] = $2; - ++count; -} - -END { - asort(errlist) - print "(defpackage \"UNIX-ERRNO\"" - print " (:export" - for (k = 1; k < count; ++k) { - printf " \"%s\"\n", errlist[k]; - } - print " ))\n" + printf " \"%s\"\n", $2 } View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/064b90cd180467e1379827c8... -- View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/064b90cd180467e1379827c8... You're receiving this email because of your account on gitlab.common-lisp.net.
participants (1)
-
Raymond Toy (@rtoy)