From d576df427e8556aeb4fa7b7a28f7decc907ade66 Mon Sep 17 00:00:00 2001 From: Karel Bilek Date: Fri, 26 Oct 2018 16:27:37 +0700 Subject: [PATCH] emulator: make buildable on macOS --- emulator/strl.c | 3 +++ emulator/strl.h | 2 ++ 2 files changed, 5 insertions(+) diff --git a/emulator/strl.c b/emulator/strl.c index 6c87be9320..26668b80a3 100644 --- a/emulator/strl.c +++ b/emulator/strl.c @@ -22,6 +22,7 @@ #include +#if (!defined __APPLE__) && (!defined HAVE_STRLCPY) size_t strlcpy(char *dst, const char *src, size_t size) { size_t ret = strlen(src); @@ -39,3 +40,5 @@ size_t strlcat(char *dst, const char *src, size_t size) { return n + strlcpy(&dst[n], src, size - n); } + +#endif diff --git a/emulator/strl.h b/emulator/strl.h index 8b44e0454e..c43fd4c72e 100644 --- a/emulator/strl.h +++ b/emulator/strl.h @@ -22,7 +22,9 @@ #include +#if (!defined __APPLE__) && (!defined HAVE_STRLCPY) size_t strlcpy(char *dst, const char *src, size_t size); size_t strlcat(char *dst, const char *src, size_t size); +#endif #endif