]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.2.0912: hardcopy: prototypes are hand-written instead of generated v9.2.0912
authorHirohito Higashi <h.east.727@gmail.com>
Wed, 5 Aug 2026 18:52:06 +0000 (18:52 +0000)
committerChristian Brabandt <cb@256bit.org>
Wed, 5 Aug 2026 18:52:06 +0000 (18:52 +0000)
Problem:  The prototypes for the pango and PostScript hardcopy functions
          are written by hand in hardcopy_pango.h and
          hardcopy_postscript.h, instead of being generated into proto/
          like for every other source file.
Solution: Generate proto/hardcopy_pango.pro and
          proto/hardcopy_postscript.pro, include them from proto.h and
          drop the hand-written declarations.  hardcopy_pango.h only held
          prototypes and is removed; hardcopy_postscript.h keeps its
          defines and the mbfont_opts declaration.

closes: #20946

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Filelist
src/Make_mvc.mak
src/Makefile
src/hardcopy.c
src/hardcopy_pango.c
src/hardcopy_postscript.h
src/proto.h
src/proto/hardcopy_pango.pro [moved from src/hardcopy_pango.h with 57% similarity]
src/proto/hardcopy_postscript.pro [new file with mode: 0644]
src/version.c

index 7a2f1219baf1daf23679d9cda8a8aa5e0bd8c189..945c87e031c8768efb6c9faa0caf677de927d120 100644 (file)
--- a/Filelist
+++ b/Filelist
@@ -95,7 +95,6 @@ SRC_ALL =     \
                src/hardcopy.c \
                src/hardcopy.h \
                src/hardcopy_pango.c \
-               src/hardcopy_pango.h \
                src/hardcopy_postscript.c \
                src/hardcopy_postscript.h \
                src/hashtab.c \
@@ -316,6 +315,8 @@ SRC_ALL =   \
                src/proto/gui.pro \
                src/proto/gui_beval.pro \
                src/proto/hardcopy.pro \
+               src/proto/hardcopy_pango.pro \
+               src/proto/hardcopy_postscript.pro \
                src/proto/hashtab.pro \
                src/proto/help.pro \
                src/proto/highlight.pro \
index 92b6f4066a5529639c23c129b03b59994757728a..1b91f5b2924c439a162c08f9f0123b02a55a4dc1 100644 (file)
@@ -1990,6 +1990,8 @@ proto.h: \
        proto/gc.pro \
        proto/gui_xim.pro \
        proto/hardcopy.pro \
+       proto/hardcopy_pango.pro \
+       proto/hardcopy_postscript.pro \
        proto/hashtab.pro \
        proto/help.pro \
        proto/highlight.pro \
index a8a046da7f4adf5f8cabf2476ca534fa4f209a2e..04917c0641c881f264bf724caa00d8fc56b42d01 100644 (file)
@@ -1927,6 +1927,8 @@ PROTO_FILES = \
        proto/gui_gtk_gresources.pro \
        proto/gui_xim.pro \
        proto/hardcopy.pro \
+       proto/hardcopy_pango.pro \
+       proto/hardcopy_postscript.pro \
        proto/hashtab.pro \
        proto/help.pro \
        proto/highlight.pro \
@@ -4109,12 +4111,12 @@ objects/hardcopy.o: auto/osdef.h hardcopy.c vim.h protodef.h auto/config.h featu
  ascii.h keymap.h termdefs.h macros.h option.h beval.h \
  structs.h regexp.h gui.h libvterm/include/vterm.h \
  libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \
- globals.h errors.h version.h hardcopy.h hardcopy_pango.h hardcopy_postscript.h
+ globals.h errors.h version.h hardcopy.h hardcopy_postscript.h
 objects/hardcopy_pango.o: auto/osdef.h hardcopy_pango.c vim.h protodef.h auto/config.h feature.h os_unix.h \
  ascii.h keymap.h termdefs.h macros.h option.h beval.h \
  structs.h regexp.h gui.h libvterm/include/vterm.h \
  libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \
- globals.h errors.h hardcopy.h hardcopy_pango.h
+ globals.h errors.h hardcopy.h
 objects/hardcopy_postscript.o: auto/osdef.h hardcopy_postscript.c vim.h protodef.h auto/config.h feature.h os_unix.h \
  ascii.h keymap.h termdefs.h macros.h option.h beval.h \
  structs.h regexp.h gui.h libvterm/include/vterm.h \
@@ -4850,6 +4852,8 @@ proto/gui_beval.pro: gui_beval.c
 proto/gui_gtk_gresources.pro: auto/gui_gtk_gresources.c
 proto/gui_xim.pro: gui_xim.c
 proto/hardcopy.pro: hardcopy.c
+proto/hardcopy_pango.pro: hardcopy_pango.c
+proto/hardcopy_postscript.pro: hardcopy_postscript.c
 proto/hashtab.pro: hashtab.c
 proto/help.pro: help.c
 proto/highlight.pro: highlight.c
index d7f2298950056e2a74837ae2cacb295273ae5651..8387deabb8c5cd05ad1f446010454a938d5a928a 100644 (file)
@@ -20,9 +20,6 @@
 #ifdef FEAT_POSTSCRIPT
 # include "hardcopy_postscript.h"
 #endif
-#ifdef FEAT_PRINT_PANGO
-# include "hardcopy_pango.h"
-#endif
 
 /*
  * To implement printing on a platform, the following functions must be
index e3d46a57b7889b2050ff72f1d9e72002f00374d3..29c6118b8a298b36ee99b62ed4f4d0e475564d69 100644 (file)
@@ -21,7 +21,6 @@
 #ifdef FEAT_PRINT_PANGO
 
 #include "hardcopy.h"
-#include "hardcopy_pango.h"
 
 #include <cairo/cairo-ps.h>
 #include <cairo/cairo-pdf.h>
index fe41df8f87be3278f0cb7a7ae8752ba76c67f008..1134889c2914136800d6898da4c3a1f22c52adb6 100644 (file)
 
 extern option_table_T mbfont_opts[OPT_MBFONT_NUM_OPTIONS];
 
-void mch_print_cleanup(void);
-int mch_print_init(prt_settings_T *psettings, char_u *jobname, int forceit);
-int mch_print_begin(prt_settings_T *psettings);
-void mch_print_end(prt_settings_T *psettings);
-int mch_print_end_page(void);
-int mch_print_begin_page(char_u *str);
-int mch_print_blank_page(void);
-void mch_print_start_line(int margin, int page_line);
-int mch_print_text_out(char_u *textp, int len);
-void mch_print_set_font(int iBold, int iItalic, int iUnderline);
-void mch_print_set_bg(long_u bgcol);
-void mch_print_set_fg(long_u fgcol);
-
 #endif
 
 #endif
index a06b82622c44e1e6a52a5b941040c4ef54829979..fa0ca9cc2c2f43e996d0cc77b659e13193456475 100644 (file)
@@ -98,6 +98,12 @@ extern int _stricoll(char *a, char *b);
 # include "gc.pro"
 # include "gui_xim.pro"
 # include "hardcopy.pro"
+# ifdef FEAT_PRINT_PANGO
+#  include "hardcopy_pango.pro"
+# endif
+# ifdef FEAT_POSTSCRIPT
+#  include "hardcopy_postscript.pro"
+# endif
 # include "hashtab.pro"
 # include "help.pro"
 # include "highlight.pro"
similarity index 57%
rename from src/hardcopy_pango.h
rename to src/proto/hardcopy_pango.pro
index 26a4c227a63891101a2ad61f99bbac64ab3e60b3..072faa55a9c2e6770ac70f25eb2e5d347ebd104a 100644 (file)
@@ -1,19 +1,4 @@
-/* vi:set ts=8 sts=4 sw=4 noet:
- *
- * VIM - Vi IMproved   by Bram Moolenaar
- *
- * Do ":help uganda"  in Vim to read copying and usage conditions.
- * Do ":help credits" in Vim to see a list of people who contributed.
- * See README.txt for an overview of the Vim source code.
- */
-
-#ifndef HARDCOPY_PANGO_H
-#define HARDCOPY_PANGO_H
-
-#include "vim.h"
-
-#if defined(FEAT_PRINT_PANGO)
-
+/* hardcopy_pango.c */
 int mch_print_init(prt_settings_T *psettings, char_u *jobname, int forceit);
 int mch_print_begin(prt_settings_T *psettings);
 void mch_print_end(prt_settings_T *psettings);
@@ -26,7 +11,4 @@ void mch_print_set_font(int bold, int italic, int underline);
 void mch_print_set_bg(long_u bgcol);
 void mch_print_set_fg(long_u fgcol);
 void mch_print_cleanup(void);
-
-#endif
-
-#endif
+/* vim: set ft=c : */
diff --git a/src/proto/hardcopy_postscript.pro b/src/proto/hardcopy_postscript.pro
new file mode 100644 (file)
index 0000000..70d7bb8
--- /dev/null
@@ -0,0 +1,14 @@
+/* hardcopy_postscript.c */
+void mch_print_cleanup(void);
+int mch_print_init(prt_settings_T *psettings, char_u *jobname, int forceit);
+int mch_print_begin(prt_settings_T *psettings);
+void mch_print_end(prt_settings_T *psettings);
+int mch_print_end_page(void);
+int mch_print_begin_page(char_u *str);
+int mch_print_blank_page(void);
+void mch_print_start_line(int margin, int page_line);
+int mch_print_text_out(char_u *textp, int len);
+void mch_print_set_font(int iBold, int iItalic, int iUnderline);
+void mch_print_set_bg(long_u bgcol);
+void mch_print_set_fg(long_u fgcol);
+/* vim: set ft=c : */
index e65bb14ea2e8ec2effbbfcfbe1f4f8c9bfa0e29c..ef0edee5ec9f943bf221bf25aa0a3fe6172f40c4 100644 (file)
@@ -763,6 +763,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    912,
 /**/
     911,
 /**/