gbranden pushed a commit to branch master
in repository groff.
commit 18fbc2203e196ae74f85bf4d4d6df4ff6cef1cad
Author: G. Branden Robinson <[email protected]>
AuthorDate: Sun Mar 29 19:05:36 2026 -0500
[libgroff]: Improve #include discipline (1/5).
* src/libs/libgroff/mksdir.cpp: Improve header file inclusion
discipline. Use preprocessor to include "lib.h" header, which
declares the `mkdsir()` function defined here.
---
ChangeLog | 6 ++++++
src/include/lib.h | 1 +
src/libs/libgroff/mksdir.cpp | 6 +++++-
3 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/ChangeLog b/ChangeLog
index bdf4afe69..92db5f672 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2026-03-29 G. Branden Robinson <[email protected]>
+
+ * src/libs/libgroff/mksdir.cpp: Improve header file
+ inclusion discipline. Use preprocessor to include "lib.h"
+ header, which declares the `mkdsir()` function defined here.
+
2026-03-29 G. Branden Robinson <[email protected]>
* src/libs/libgroff/relocate.cpp (msw2posixpath): Declare as
diff --git a/src/include/lib.h b/src/include/lib.h
index 09d8d0752..2eeea136f 100644
--- a/src/include/lib.h
+++ b/src/include/lib.h
@@ -72,6 +72,7 @@ extern "C" {
int mkstemp(char *tmpl);
#endif /* HAVE_MKSTEMP */
+// libgroff/mksdir.cpp
int mksdir(char *tmpl);
#ifdef __cplusplus
diff --git a/src/libs/libgroff/mksdir.cpp b/src/libs/libgroff/mksdir.cpp
index c43b0b7b8..d492a7456 100644
--- a/src/libs/libgroff/mksdir.cpp
+++ b/src/libs/libgroff/mksdir.cpp
@@ -17,10 +17,14 @@ for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-
/* This file is heavily based on the file mkstemp.c which is part of the
fileutils package. */
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "lib.h" // mksdir()
extern int gen_tempname(char *, int = 0);
_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit