summaryrefslogtreecommitdiff
path: root/src/utils/paths.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils/paths.cpp')
-rw-r--r--src/utils/paths.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/utils/paths.cpp b/src/utils/paths.cpp
index e3992cd72..dbe0cccce 100644
--- a/src/utils/paths.cpp
+++ b/src/utils/paths.cpp
@@ -30,11 +30,18 @@
#include "resources/resourcemanager.h"
+#ifdef __native_client__
+#include <limits.h>
+#define realpath(N, R) strcpy(R, N)
+#endif
+
#ifdef WIN32
#include "utils/specialfolder.h"
#define realpath(N, R) _fullpath((R), (N), _MAX_PATH)
#elif defined __OpenBSD__
#include <limits>
+#elif defined __native_client__
+#include <limits.h>
#endif
#ifdef ANDROID
@@ -47,7 +54,7 @@
std::string getRealPath(const std::string &str)
{
-#if defined(__OpenBSD__) || defined(__ANDROID__)
+#if defined(__OpenBSD__) || defined(__ANDROID__) || defined(__native_client__)
char *realPath = reinterpret_cast<char*>(calloc(PATH_MAX, sizeof(char)));
realpath(str.c_str(), realPath);
#else