From f4b9073b11e14acab8cee2ac6d0305e10321dade Mon Sep 17 00:00:00 2001 From: NIIBE Yutaka Date: Thu, 28 Sep 2017 15:09:21 +0900 Subject: [PATCH] stdlib fixes. --- ChangeLog | 2 ++ src/stdlib.h | 13 ++++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 8403f46..7913082 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2017-09-28 NIIBE Yutaka + * src/stdlib.h: Update for GNU/Linux emulation. + * src/Makefile: Support GNU/Linux emulation. * src/configure: Support GNU/Linux emulation. * emulation: Remove. diff --git a/src/stdlib.h b/src/stdlib.h index 886794e..7dcaf03 100644 --- a/src/stdlib.h +++ b/src/stdlib.h @@ -1,8 +1,13 @@ /* * stdlib.h replacement to replace malloc functions + * + * The intention is that no dependency to C library. But since RSA + * routines uses malloc/free, we provide malloc and free. + * + * For GNU/Linux emulation, we can use C library. */ -typedef unsigned int size_t; +typedef unsigned long int size_t; #include /* NULL */ @@ -11,3 +16,9 @@ typedef unsigned int size_t; void *gnuk_malloc (size_t); void gnuk_free (void *); + +#ifdef GNU_LINUX_EMULATION +long int random(void); +void srandom(unsigned int seed); +void exit(int status); +#endif