mescc: Mes C Library: Support gcc-4.6.4: Allow larger qsort entries.

* lib/stdlib/qsort.c (qswap): Increase buffer to 128 bytes (gmp needs
36) and add assert.
This commit is contained in:
Jan Nieuwenhuizen 2019-02-09 19:47:21 +01:00
parent 225baf2527
commit b429c4c4d4
No known key found for this signature in database
GPG Key ID: F3C1A0D9C1D65273
1 changed files with 4 additions and 2 deletions

View File

@ -1,6 +1,6 @@
/* -*-comment-start: "//";comment-end:""-*-
* GNU Mes --- Maxwell Equations of Software
* Copyright © 2017,2018 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
* Copyright © 2017,2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
*
* This file is part of GNU Mes.
*
@ -18,13 +18,15 @@
* along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
*/
#include <assert.h>
#include <stdlib.h>
#include <string.h>
void
qswap (void *a, void *b, size_t size)
{
char *buf[8];
char buf[128];
assert (size <= sizeof (buf));
memcpy (buf, a, size);
memcpy (a, b, size);
memcpy (b, buf, size);