0
0
mirror of https://github.com/vim/vim.git synced 2025-11-16 23:24:03 -05:00

patch 9.1.1840: Generating prototype files does not work on all platforms

Problem:  Generating prototype files does not work on all platforms
Solution: Rework prototypes generation using python instead of cproto,
          enable it in CI to test it for each PR (Hirohito Higashi).

closes: #18045

Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Hirohito Higashi
2025-10-08 18:31:13 +00:00
committed by Christian Brabandt
parent ce5f9f45af
commit e7c765fe59
160 changed files with 1751 additions and 1551 deletions

View File

@@ -19,71 +19,17 @@
#include <signal.h>
#include <limits.h>
// cproto fails on missing include files
#ifndef PROTO
# include <process.h>
# include <direct.h>
#include <process.h>
#include <direct.h>
# if !defined(FEAT_GUI_MSWIN)
# include <shellapi.h>
# endif
#if !defined(FEAT_GUI_MSWIN)
# include <shellapi.h>
#endif
# if defined(FEAT_PRINTER) && !defined(FEAT_POSTSCRIPT)
# include <dlgs.h>
# include <winspool.h>
# include <commdlg.h>
# endif
#endif // PROTO
/*
* When generating prototypes for Win32 on Unix, these lines make the syntax
* errors disappear. They do not need to be correct.
*/
#ifdef PROTO
# define WINAPI
# define WINBASEAPI
typedef int BOOL;
typedef int CALLBACK;
typedef int COLORREF;
typedef int CONSOLE_CURSOR_INFO;
typedef int COORD;
typedef int DWORD;
typedef int ENUMLOGFONTW;
typedef int HANDLE;
typedef int HDC;
typedef int HFONT;
typedef int HICON;
typedef int HWND;
typedef int INPUT_RECORD;
typedef int INT_PTR;
typedef int KEY_EVENT_RECORD;
typedef int LOGFONTW;
typedef int LPARAM;
typedef int LPBOOL;
typedef int LPCSTR;
typedef int LPCWSTR;
typedef int LPDWORD;
typedef int LPSTR;
typedef int LPTSTR;
typedef int LPVOID;
typedef int LPWSTR;
typedef int LRESULT;
typedef int MOUSE_EVENT_RECORD;
typedef int NEWTEXTMETRICW;
typedef int PACL;
typedef int PRINTDLGW;
typedef int PSECURITY_DESCRIPTOR;
typedef int PSID;
typedef int SECURITY_INFORMATION;
typedef int SHORT;
typedef int SMALL_RECT;
typedef int TEXTMETRIC;
typedef int UINT;
typedef int WCHAR;
typedef int WNDENUMPROC;
typedef int WORD;
typedef int WPARAM;
typedef void VOID;
#if defined(FEAT_PRINTER) && !defined(FEAT_POSTSCRIPT)
# include <dlgs.h>
# include <winspool.h>
# include <commdlg.h>
#endif
// Record all output and all keyboard & mouse input
@@ -117,7 +63,7 @@ SaveInst(HINSTANCE hInst)
g_hinst = hInst;
}
#if defined(FEAT_GUI_MSWIN) || defined(PROTO)
#if defined(FEAT_GUI_MSWIN)
/*
* GUI version of mch_exit().
* Shut down and exit with status `r'
@@ -563,7 +509,7 @@ vim_stat(const char *name, stat_T *stp)
return stat_impl(name, stp, TRUE);
}
#if (defined(FEAT_GUI_MSWIN) && !defined(VIMDLL)) || defined(PROTO)
#if defined(FEAT_GUI_MSWIN) && !defined(VIMDLL)
void
mch_settmode(tmode_T tmode UNUSED)
{
@@ -603,7 +549,7 @@ mch_suspend(void)
suspend_shell();
}
#if defined(USE_MCH_ERRMSG) || defined(PROTO)
#if defined(USE_MCH_ERRMSG)
# ifdef display_errors
# undef display_errors
@@ -743,7 +689,7 @@ mch_char_avail(void)
return TRUE;
}
# if defined(FEAT_TERMINAL) || defined(PROTO)
# if defined(FEAT_TERMINAL)
/*
* Check for any pending input or messages.
*/
@@ -757,7 +703,7 @@ mch_check_messages(void)
#endif
#if defined(FEAT_LIBCALL) || defined(PROTO)
#if defined(FEAT_LIBCALL)
/*
* Call a DLL routine which takes either a string or int param
* and returns an allocated string.
@@ -1020,7 +966,7 @@ Trace(
#endif //_DEBUG
#if !defined(FEAT_GUI) || defined(VIMDLL) || defined(PROTO)
#if !defined(FEAT_GUI) || defined(VIMDLL)
extern HWND g_hWnd; // This is in os_win32.c.
/*
@@ -1072,7 +1018,7 @@ mch_set_winpos(int x, int y)
}
#endif
#if (defined(FEAT_PRINTER) && !defined(FEAT_POSTSCRIPT)) || defined(PROTO)
#if defined(FEAT_PRINTER) && !defined(FEAT_POSTSCRIPT)
//=================================================================
// Win32 printer stuff
@@ -1749,10 +1695,8 @@ mch_print_set_fg(long_u fgcol)
#if defined(FEAT_SHORTCUT) || defined(PROTO)
# ifndef PROTO
# include <shlobj.h>
# endif
#if defined(FEAT_SHORTCUT)
# include <shlobj.h>
# define is_path_sep(c) ((c) == L'\\' || (c) == L'/')
@@ -1934,7 +1878,7 @@ mch_resolve_path(char_u *fname, int reparse_point)
}
#endif
#if (defined(FEAT_EVAL) && (!defined(FEAT_GUI) || defined(VIMDLL))) || defined(PROTO)
#if defined(FEAT_EVAL) && (!defined(FEAT_GUI) || defined(VIMDLL))
/*
* Bring ourselves to the foreground. Does work if the OS doesn't allow it.
*/
@@ -1947,7 +1891,7 @@ win32_set_foreground(void)
}
#endif
#if defined(FEAT_CLIENTSERVER) || defined(PROTO)
#if defined(FEAT_CLIENTSERVER)
/*
* Client-server code for Vim
*
@@ -2681,8 +2625,7 @@ serverProcessPendingMessages(void)
#endif // FEAT_CLIENTSERVER
#if defined(FEAT_GUI) || (defined(FEAT_PRINTER) && !defined(FEAT_POSTSCRIPT)) \
|| defined(PROTO)
#if defined(FEAT_GUI) || (defined(FEAT_PRINTER) && !defined(FEAT_POSTSCRIPT))
struct charset_pair
{
@@ -3291,7 +3234,7 @@ theend:
#endif // defined(FEAT_GUI) || defined(FEAT_PRINTER)
#if defined(FEAT_JOB_CHANNEL) || defined(PROTO)
#if defined(FEAT_JOB_CHANNEL)
/*
* Initialize the Winsock dll.
*/