From c7221b96104ecea19adea8953069950a86aa423e Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 15 Aug 2026 11:34:59 -0700 Subject: [PATCH] sed: remove basicdefs.h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It is now so small that separating it is more trouble than it’s worth. * Makefile.am (noinst_HEADERS): Remove basicdefs.h. * basicdefs.h: Remove. * sed/sed.h: Do not include basicdefs.h. Instead, include gettext.h and define ‘_’. * sed/utils.c: Include utils.h first, to check that it’s standalone. Do not include idx.h, since utils.h does that for us. Include gettext.h and define ‘_’. * sed/utils.h: Include idx.h instead of basicdefs.h. --- Makefile.am | 2 +- basicdefs.h | 26 -------------------------- sed/sed.h | 5 ++++- sed/utils.c | 7 +++++-- sed/utils.h | 2 +- 5 files changed, 11 insertions(+), 31 deletions(-) delete mode 100644 basicdefs.h diff --git a/Makefile.am b/Makefile.am index 03cb9f8..27479b7 100644 --- a/Makefile.am +++ b/Makefile.am @@ -35,7 +35,7 @@ SUFFIXES = bin_PROGRAMS = noinst_LIBRARIES = noinst_DATA = -noinst_HEADERS = basicdefs.h +noinst_HEADERS = DISTCLEANFILES = EXTRA_DIST += BUGS THANKS.in \ diff --git a/basicdefs.h b/basicdefs.h deleted file mode 100644 index f16f7ae..0000000 --- a/basicdefs.h +++ /dev/null @@ -1,26 +0,0 @@ -/* GNU SED, a batch stream editor. - Copyright (C) 1998-2026 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; If not, see . */ - -#ifndef BASICDEFS_H -#define BASICDEFS_H - -#include -#define _(String) gettext(String) - -#include "idx.h" -#include "xalloc.h" - -#endif /*!BASICDEFS_H*/ diff --git a/sed/sed.h b/sed/sed.h index 3b05901..9078e35 100644 --- a/sed/sed.h +++ b/sed/sed.h @@ -15,7 +15,7 @@ along with this program; If not, see . */ #include -#include "basicdefs.h" + #include "dfa.h" #include "localeinfo.h" #include "mcel.h" @@ -26,6 +26,9 @@ #include "utils.h" +#include +#define _(msgid) gettext (msgid) + _GL_INLINE_HEADER_BEGIN #ifndef SED_INLINE diff --git a/sed/utils.c b/sed/utils.c index 67529e6..fbd4be9 100644 --- a/sed/utils.c +++ b/sed/utils.c @@ -16,6 +16,8 @@ #include +#include "utils.h" + #include #include #include @@ -28,15 +30,16 @@ #include "binary-io.h" #include "min-eloop-threshold.h" -#include "idx.h" #include "minmax.h" #include "quotearg.h" #include "unlocked-io.h" -#include "utils.h" #include "progname.h" #include "fwriting.h" #include "xalloc.h" +#include +#define _(msgid) gettext (msgid) + #ifdef SSIZE_MAX # define SSIZE_IDX_MAX MIN (SSIZE_MAX, IDX_MAX) #else diff --git a/sed/utils.h b/sed/utils.h index 7a54f4d..039ffa0 100644 --- a/sed/utils.h +++ b/sed/utils.h @@ -16,7 +16,7 @@ #include -#include "basicdefs.h" +#include "idx.h" enum exit_codes { /* EXIT_SUCCESS is already defined as 0 */