aboutsummaryrefslogtreecommitdiffstats
path: root/src/alloc.c
diff options
context:
space:
mode:
authorPaul Eggert2016-12-01 23:13:31 -0800
committerPaul Eggert2016-12-01 23:17:26 -0800
commitc49198967ae90f97e315dde5a4d1b234200f13df (patch)
treea620d6880df853e20564e8589ef490d818c83aa2 /src/alloc.c
parent95eb641404adca84e71959a98369a30f1cadb7b6 (diff)
downloademacs-c49198967ae90f97e315dde5a4d1b234200f13df.tar.gz
emacs-c49198967ae90f97e315dde5a4d1b234200f13df.zip
Port to Sun C 5.14
Backport from master. Sun C 5.14 supports C11 but not GCC extensions, and so refuses to compile Emacs without this patch. * src/alloc.c (lmalloc, lrealloc): Don't use INT_ADD_WRAPV on size_t, as in general this macro is restricted to signed types.
Diffstat (limited to 'src/alloc.c')
-rw-r--r--src/alloc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/alloc.c b/src/alloc.c
index d58532b97ff..6be0263a816 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -1415,8 +1415,8 @@ lmalloc (size_t size)
1415 if (laligned (p, size)) 1415 if (laligned (p, size))
1416 break; 1416 break;
1417 free (p); 1417 free (p);
1418 size_t bigger; 1418 size_t bigger = size + GCALIGNMENT;
1419 if (! INT_ADD_WRAPV (size, GCALIGNMENT, &bigger)) 1419 if (size < bigger)
1420 size = bigger; 1420 size = bigger;
1421 } 1421 }
1422 1422
@@ -1432,8 +1432,8 @@ lrealloc (void *p, size_t size)
1432 p = realloc (p, size); 1432 p = realloc (p, size);
1433 if (laligned (p, size)) 1433 if (laligned (p, size))
1434 break; 1434 break;
1435 size_t bigger; 1435 size_t bigger = size + GCALIGNMENT;
1436 if (! INT_ADD_WRAPV (size, GCALIGNMENT, &bigger)) 1436 if (size < bigger)
1437 size = bigger; 1437 size = bigger;
1438 } 1438 }
1439 1439