diff options
| author | bfredl <bjorn.linse@gmail.com> | 2024-07-13 17:22:59 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-07-13 17:22:59 +0200 |
| commit | eab535e10edd69a2224a10f789bf3c2be6f0ba36 (patch) | |
| tree | 3c4d8cb0307953ed023a9b453db4b9d4b901b655 /src/nvim/os | |
| parent | 2ad84286375112524e118a4f6ced68782b285a52 (diff) | |
| parent | 7dffc36e61c46e6adc92cff5944e876446f3c40e (diff) | |
| download | rneovim-eab535e10edd69a2224a10f789bf3c2be6f0ba36.tar.gz rneovim-eab535e10edd69a2224a10f789bf3c2be6f0ba36.tar.bz2 rneovim-eab535e10edd69a2224a10f789bf3c2be6f0ba36.zip | |
Merge pull request #29315 from bfredl/staticinline
refactor(declarations): also generate prototypes for functions in headers
Diffstat (limited to 'src/nvim/os')
| -rw-r--r-- | src/nvim/os/fileio_defs.h | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/nvim/os/fileio_defs.h b/src/nvim/os/fileio_defs.h index 0f76fdb2aa..47f0629ccf 100644 --- a/src/nvim/os/fileio_defs.h +++ b/src/nvim/os/fileio_defs.h @@ -3,8 +3,6 @@ #include <stdbool.h> #include <stdint.h> -#include "nvim/func_attr.h" - /// Structure used to read from/write to file typedef struct { int fd; ///< File descriptor. Can be -1 if no backing file (file_open_buffer) @@ -17,8 +15,9 @@ typedef struct { uint64_t bytes_read; ///< total bytes read so far } FileDescriptor; -static inline bool file_eof(const FileDescriptor *fp) - REAL_FATTR_ALWAYS_INLINE REAL_FATTR_WARN_UNUSED_RESULT REAL_FATTR_NONNULL_ALL; +#ifdef INCLUDE_GENERATED_DECLARATIONS +# include "os/fileio_defs.h.inline.generated.h" +#endif /// Check whether end of file was encountered /// @@ -27,19 +26,18 @@ static inline bool file_eof(const FileDescriptor *fp) /// @return true if it was, false if it was not or read operation was never /// performed. static inline bool file_eof(const FileDescriptor *const fp) + FUNC_ATTR_ALWAYS_INLINE FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_NONNULL_ALL { return fp->eof && fp->read_pos == fp->write_pos; } -static inline int file_fd(const FileDescriptor *fp) - REAL_FATTR_ALWAYS_INLINE REAL_FATTR_WARN_UNUSED_RESULT REAL_FATTR_NONNULL_ALL; - /// Return the file descriptor associated with the FileDescriptor structure /// /// @param[in] fp File to check. /// /// @return File descriptor. static inline int file_fd(const FileDescriptor *const fp) + FUNC_ATTR_ALWAYS_INLINE FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_NONNULL_ALL { return fp->fd; } |