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:
parent
544540d332
commit
44add95226
|
@ -1,6 +1,6 @@
|
||||||
/* -*-comment-start: "//";comment-end:""-*-
|
/* -*-comment-start: "//";comment-end:""-*-
|
||||||
* GNU Mes --- Maxwell Equations of Software
|
* 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.
|
* This file is part of GNU Mes.
|
||||||
*
|
*
|
||||||
|
@ -18,13 +18,15 @@
|
||||||
* along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
|
* along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
void
|
void
|
||||||
qswap (void *a, void *b, size_t size)
|
qswap (void *a, void *b, size_t size)
|
||||||
{
|
{
|
||||||
char *buf[8];
|
char buf[128];
|
||||||
|
assert (size <= sizeof (buf));
|
||||||
memcpy (buf, a, size);
|
memcpy (buf, a, size);
|
||||||
memcpy (a, b, size);
|
memcpy (a, b, size);
|
||||||
memcpy (b, buf, size);
|
memcpy (b, buf, size);
|
||||||
|
|
Loading…
Reference in New Issue