
Raymond Toy pushed to branch issue-365-add-strerror at cmucl / cmucl Commits: 1b20dfa0 by Raymond Toy at 2025-02-10T07:38:48-08:00 Remove lisp/create-errno.c We don't use this file anymore; it's not used. - - - - - f17af880 by Raymond Toy at 2025-02-10T07:40:11-08:00 Undo changes to makefile and configs Since we removed create-errno.c, we can remove all the make rules in GNUmakefile and Config.x86_linux*. - - - - - 4 changed files: - src/lisp/Config.x86_linux - src/lisp/Config.x86_linux_clang - src/lisp/GNUmakefile - − src/lisp/create-errno.c Changes: ===================================== src/lisp/Config.x86_linux ===================================== @@ -14,6 +14,3 @@ OS_LINK_FLAGS = -m32 -rdynamic -Xlinker --export-dynamic -Xlinker -Map -Xlinker OS_LINK_FLAGS += -Wl,-z,noexecstack EXEC_FINAL_OBJ = exec-final.o - -../code/unix-errno.lisp : create-errno - ./create-errno /usr/include/asm-generic/errno* | uniq > $@ ===================================== src/lisp/Config.x86_linux_clang ===================================== @@ -19,6 +19,3 @@ OS_LINK_FLAGS = -m32 -rdynamic -Xlinker --export-dynamic -Xlinker -Map -Xlinker OS_LINK_FLAGS += -Wl,-z,noexecstack EXEC_FINAL_OBJ = exec-final.o - -../code/unix-errno.lisp : create-errno - ./create-errno /usr/include/asm-generic/errno* | uniq > $@ ===================================== src/lisp/GNUmakefile ===================================== @@ -66,9 +66,9 @@ endif version: echo 0 > version -#internals.h internals.inc: -# @echo "You must run genesis to create internals.h!" -# @false +internals.h internals.inc: + @echo "You must run genesis to create internals.h!" + @false clean: $(RM) Depends *.o lisp lisp.nm core lisp.a @@ -139,7 +139,3 @@ translations-update: done; done -# Compile program that creates the unix-error.lisp file. Actual -# generation of the file is OS-dependent. -create-errno : create-errno.c - $(CC) -o $@ $^ ===================================== src/lisp/create-errno.c deleted ===================================== @@ -1,91 +0,0 @@ -#include <regex.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> - -struct Err { - char *name; - int num; -#if 0 - char *descr; -#endif -} err[256]; - -int nerr = 0; - -regex_t reg; - -void match(const char *line) { - regmatch_t match[3]; - regoff_t len; - - if (regexec(®, line, 3, match, 0) == REG_NOMATCH) - return; - - len = match[1].rm_eo - match[1].rm_so; - err[nerr].name = malloc(len + 1); - sprintf(err[nerr].name, "%.*s", len, line + match[1].rm_so); - - err[nerr].num = atoi(line + match[2].rm_so); - -#if 0 - err[nerr].descr = strerror(err[nerr].num); -#endif - - nerr++; -} - -int cmp(const void *a, const void *b) { - return ((struct Err *)a)->num - ((struct Err *)b)->num; -} - -int main(int argc, char **argv) -{ - int i; - FILE *fp; - char line[1024]; - - regcomp(®, "^#define[ \t]*(E[A-Z0-9]+)[ \t]*([0-9]+)", REG_EXTENDED); - - for (i = 1; i < argc; i++) { - if ((fp = fopen(argv[i], "r")) == NULL) { - perror("fopen"); - exit(1); - } - while (fgets(line, sizeof(line), fp) != NULL) - match(line); - fclose(fp); - } - - qsort(err, nerr, sizeof(*err), cmp); - - /* - * Print out CMUCL-style file header - */ - puts(";;; -*- Package: UNIX -*-\n\ -;;;\n\ -;;; **********************************************************************\n\ -;;; This code was written as part of the CMU Common Lisp project at\n\ -;;; Carnegie Mellon University, and has been placed in the public domain.\n\ -;;;\n\ -(ext:file-comment\n\ - \"$Header: src/code/unix-errno.lisp $\")\n\ -;;;\n\ -;;; **********************************************************************\n\ -;;;\n\ -;;; This file contains the values of the UNIX errno values.\n\ -;;;\n \ -;;; DO NOT EDIT! This is auto-generated from create-errno.\n\ -;;;\n"); - - puts("(in-package \"UNIX\")\n"); - for (i = 0; i < nerr; i++) { -#if 0 - printf("(def-unix-error %s %d \"%s\")\n", err[i].name, err[i].num, err[i].descr); -#else - printf("(def-unix-error %s %d)\n", err[i].name, err[i].num); -#endif - } - - return 0; -} View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/5e784f728d0699fced6079d... -- View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/5e784f728d0699fced6079d... You're receiving this email because of your account on gitlab.common-lisp.net.