0
0
mirror of https://github.com/vim/vim.git synced 2025-10-22 08:34:29 -04:00

patch 9.1.1662: Issues with proto files: missing or inconsistent prototypes.

Problem:  Issues with proto files: missing or inconsistent prototypes.
Solution: Update ifdefs, move typedefs, fix prototype declaration
          (Hirohito Higashi)

This change focuses on fixes and tweaks found while working on #18045 for
the proto/*.pro files.

The following fixes and tweaks have been made:

- Fixed a prototype declaration where the variable name differed from
  the function definition.
- Removed a prototype declaration without a function body.
- Fixed a problem where a prototype declaration was not created for a
  function definition enclosed in a #if directive because it lacked ||
  defined(PROTO).
- Moved typedef struct soundcb_S soundcb_T; from proto/sound.pro to
  vim.h.
- Other small tweaks.

The make proto mechanism remains unchanged.

closes: #18058

Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Hirohito Higashi
2025-08-20 22:08:13 +02:00
committed by Christian Brabandt
parent c0a3eda6ba
commit d839a5b3b0
27 changed files with 46 additions and 49 deletions

View File

@@ -199,7 +199,7 @@
#endif
#if defined(HAVE_WAYLAND) && defined(WANT_WAYLAND)
#define FEAT_WAYLAND
# define FEAT_WAYLAND
#endif
#ifdef NO_X11_INCLUDES
@@ -264,7 +264,7 @@
#if (defined(UNIX) || defined(VMS)) \
&& (!defined(MACOS_X) || defined(HAVE_CONFIG_H))
# include "os_unix.h" // bring lots of system header files
#else
#elif !defined(PROTO)
// For all non-Unix systems: use old-fashioned signal().
# define mch_signal(signum, sighandler) signal(signum, sighandler)
#endif
@@ -1917,7 +1917,7 @@ typedef void *vim_acl_T; // dummy to pass an ACL to a function
# define USE_INPUT_BUF
#endif
#ifndef EINTR
#if !defined(EINTR) && !defined(PROTO)
# define read_eintr(fd, buf, count) vim_read((fd), (buf), (count))
# define write_eintr(fd, buf, count) vim_write((fd), (buf), (count))
#endif
@@ -2355,6 +2355,8 @@ typedef struct _stat64 stat_T;
typedef struct stat stat_T;
#endif
typedef struct soundcb_S soundcb_T;
#if (defined(__GNUC__) || defined(__clang__)) && !defined(__MINGW32__)
# define ATTRIBUTE_FORMAT_PRINTF(fmt_idx, arg_idx) \
__attribute__((format(printf, fmt_idx, arg_idx)))
@@ -2519,7 +2521,7 @@ typedef int (*opt_expand_cb_T)(optexpand_T *args, int *numMatches, char_u ***mat
// This must come after including proto.h.
// For VMS this is defined in macros.h.
#if !defined(MSWIN) && !defined(VMS)
#if !defined(MSWIN) && !defined(VMS) && !defined(PROTO)
# define mch_open(n, m, p) open((n), (m), (p))
# define mch_fopen(n, p) fopen((n), (p))
#endif
@@ -2776,7 +2778,7 @@ typedef int (*opt_expand_cb_T)(optexpand_T *args, int *numMatches, char_u ***mat
// values for vim_handle_signal() that are not a signal
#define SIGNAL_BLOCK (-1)
#define SIGNAL_UNBLOCK (-2)
#if !defined(UNIX) && !defined(VMS)
#if !defined(UNIX) && !defined(VMS) && !defined(PROTO)
# define vim_handle_signal(x) 0
#endif