external/lua: fix warning in os.hostname

This commit is contained in:
Jeremy Baxter 2024-02-18 18:02:54 +13:00
parent c3a9b5d6d5
commit a0607346e7
2 changed files with 5 additions and 1 deletions

View file

@ -408,7 +408,9 @@ static int os_exit (lua_State *L) {
return 0; return 0;
} }
#ifndef HOST_NAME_MAX
#define HOST_NAME_MAX 256 /* according to POSIX */ #define HOST_NAME_MAX 256 /* according to POSIX */
#endif
/*** /***
* Returns the system hostname. * Returns the system hostname.

View file

@ -21,11 +21,13 @@
#include <time.h> #include <time.h>
#include "lua.h" #include "lua.h"
@@ -401,7 +408,26 @@ @@ -401,7 +408,28 @@
return 0; return 0;
} }
+#ifndef HOST_NAME_MAX
+#define HOST_NAME_MAX 256 /* according to POSIX */ +#define HOST_NAME_MAX 256 /* according to POSIX */
+#endif
+/*** +/***
+ * Returns the system hostname. + * Returns the system hostname.