diff options
Diffstat (limited to 'src/vim.h')
-rw-r--r-- | src/vim.h | 17 |
1 files changed, 15 insertions, 2 deletions
@@ -2132,8 +2132,21 @@ typedef struct _stat64 stat_T; typedef struct stat stat_T; #endif -#if defined(__GNUC__) && !defined(__MINGW32__) -# define USE_PRINTF_FORMAT_ATTRIBUTE +#if (defined(__GNUC__) || defined(__clang__)) && !defined(__MINGW32__) +# define ATTRIBUTE_FORMAT_PRINTF(fmt_idx, arg_idx) \ + __attribute__((format(printf, fmt_idx, arg_idx))) +#else +# define ATTRIBUTE_FORMAT_PRINTF(fmt_idx, arg_idx) +#endif + +#if defined(__GNUC__) || defined(__clang__) +# define likely(x) __builtin_expect((x), 1) +# define unlikely(x) __builtin_expect((x), 0) +# define ATTRIBUTE_COLD __attribute__((cold)) +#else +# define unlikely(x) (x) +# define likely(x) (x) +# define ATTRIBUTE_COLD #endif typedef enum { |