diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2018-01-20 17:18:32 +0100 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2018-01-20 17:18:32 +0100 |
commit | 0daaa49586ff49584946cdf96549e1331f055103 (patch) | |
tree | adbf6bce58de5f8280ecf496728edd6f38bdfa58 /src/nvim/macros.h | |
parent | ee84da358c27b9c0a6bbd49424bc9d04bb98d662 (diff) | |
parent | 10b1738f590fe08675173071b35fface324f4048 (diff) | |
download | rneovim-0daaa49586ff49584946cdf96549e1331f055103.tar.gz rneovim-0daaa49586ff49584946cdf96549e1331f055103.tar.bz2 rneovim-0daaa49586ff49584946cdf96549e1331f055103.zip |
Merge #7863 'mingw64: fix gcc warnings'
Diffstat (limited to 'src/nvim/macros.h')
-rw-r--r-- | src/nvim/macros.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/nvim/macros.h b/src/nvim/macros.h index 26d4f74b6a..a98c1e05a0 100644 --- a/src/nvim/macros.h +++ b/src/nvim/macros.h @@ -148,6 +148,10 @@ /// zero in those cases (-Wdiv-by-zero in GCC). #define ARRAY_SIZE(arr) ((sizeof(arr)/sizeof((arr)[0])) / ((size_t)(!(sizeof(arr) % sizeof((arr)[0]))))) +// Duplicated in os/win_defs.h to avoid include-order sensitivity. +#if defined(WIN32) && defined(RGB) +# undef RGB +#endif #define RGB(r, g, b) ((r << 16) | (g << 8) | b) #define STR_(x) #x @@ -183,4 +187,19 @@ /// @return ((Type *)obj). #define STRUCT_CAST(Type, obj) ((Type *)(obj)) +// Type of uv_buf_t.len is platform-dependent. +// Related: https://github.com/libuv/libuv/pull/1236 +#if defined(WIN32) +# define UV_BUF_LEN(x) (ULONG)(x) +#else +# define UV_BUF_LEN(x) (x) +#endif + +// Type of read()/write() `count` param is platform-dependent. +#if defined(WIN32) +# define IO_COUNT(x) (unsigned)(x) +#else +# define IO_COUNT(x) (x) +#endif + #endif // NVIM_MACROS_H |