From f8ff9ffda5613b4b85d9e7412d3a40710baeaf75 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Tue, 10 Jan 2017 18:40:01 +0100 Subject: [PATCH] compiles with gcc on rpi --- src/kernel/jsonconf.test.c | 2 +- src/kernel/save.c | 2 +- src/platform.h | 4 ---- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/kernel/jsonconf.test.c b/src/kernel/jsonconf.test.c index 76784ed56..950868046 100644 --- a/src/kernel/jsonconf.test.c +++ b/src/kernel/jsonconf.test.c @@ -448,7 +448,7 @@ static void test_configs(CuTest * tc) CuAssertPtrEquals(tc, 0, buildingtypes); json_config(json); CuAssertPtrNotNull(tc, buildingtypes); - if (unlink("test.json")!=0 && errno==ENOENT) { + if (remove("test.json")!=0 && errno==ENOENT) { errno = 0; } cJSON_Delete(json); diff --git a/src/kernel/save.c b/src/kernel/save.c index de6f8aac1..9825a5b55 100644 --- a/src/kernel/save.c +++ b/src/kernel/save.c @@ -1830,7 +1830,7 @@ int writegame(const char *filename) join_path(datapath(), filename, path, sizeof(path)); #ifdef HAVE_UNISTD_H /* make sure we don't overwrite an existing file (hard links) */ - if (unlink(path)!=0) { + if (remove(path)!=0) { if (errno==ENOENT) { errno = 0; } diff --git a/src/platform.h b/src/platform.h index 88bff8ad5..355b995d2 100644 --- a/src/platform.h +++ b/src/platform.h @@ -9,7 +9,6 @@ #endif #define NO_STRDUP #define NO_MKDIR -#define NO_UNLINK #define _CRT_SECURE_NO_WARNINGS #pragma warning(disable: 4710 4820) #pragma warning(disable: 4100) // unreferenced formal parameter @@ -38,7 +37,4 @@ char * strdup(const char *s); int mkdir(const char *pathname, int mode); #endif -#ifdef NO_UNLINK -int unlink(const char *pathname); -#endif #endif