diff src/vim.h @ 33856:32bc4c71f8a6 v9.0.2138

patch 9.0.2138: Overflow logic requires long long Commit: https://github.com/vim/vim/commit/fda700cb04612fe2f9301a9ba820309175decabf Author: Ernie Rael <errael@raelity.com> Date: Thu Nov 30 18:20:00 2023 +0100 patch 9.0.2138: Overflow logic requires long long Problem: Overflow logic requires long long Solution: Define vimlong_T data type to make life easier for porters closes: #13598 Signed-off-by: Ernie Rael <errael@raelity.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Thu, 30 Nov 2023 18:30:03 +0100
parents 7d9d2404a3d4
children cb88e5c589d0
line wrap: on
line diff
--- a/src/vim.h
+++ b/src/vim.h
@@ -435,6 +435,12 @@ typedef unsigned short sattr_T;
  */
 typedef unsigned int u8char_T;	// int is 32 bits or more
 
+/*
+ * The vimlong_T has sizeof(vimlong_T) >= 2 * sizeof(int).
+ * One use is simple handling of overflow in int calculations.
+ */
+typedef long long vimlong_T;
+
 #ifndef UNIX		    // For Unix this is included in os_unix.h
 # include <stdio.h>
 # include <ctype.h>