summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Manura <dm.git@math2.org>2011-03-24 01:56:15 -0400
committerDavid Manura <dm.git@math2.org>2011-03-24 01:56:15 -0400
commit717638b3e6a7dacc55dcb51d5d337f88cfe5d316 (patch)
treede210896d30e3975ad92b4af7771c19b8c930f1c
parent7bf3f1411507859e51d62d285f777938780d42e7 (diff)
downloadlua-717638b3e6a7dacc55dcb51d5d337f88cfe5d316.tar.gz
loadlib_rel.c - Fix implicit declaration of readlink (on clang/linux).
This error was observed in clang/Linux: loadlib_rel.c- warning: implicit declaration of function 'readlink' is invalid in C99 [-Wimplicit-function-declaration] n = readlink("/proc/self/exe", progdir, nsize); ^
-rw-r--r--src/loadlib_rel.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/loadlib_rel.c b/src/loadlib_rel.c
index 8f5820b..cc21a3d 100644
--- a/src/loadlib_rel.c
+++ b/src/loadlib_rel.c
@@ -55,6 +55,9 @@ static void setprogdir (lua_State *L);
#else
#define _PATH_MAX PATH_MAX
#endif
+#if defined(__linux__)
+ #include <unistd.h> /* readlink */
+#endif
static void setprogdir (lua_State *L) {
char progdir[_PATH_MAX + 1];