AP_Scripting: remove dependency on tmpnam

tmpnam is never linked and not necessary, and naming it/redefining it
introduces problems on platforms that do have a definition.
This commit is contained in:
Thomas Watson 2024-09-23 10:55:49 -05:00 committed by Peter Barker
parent c058fb0c19
commit 8b63488431
1 changed files with 13 additions and 0 deletions

View File

@ -106,6 +106,19 @@ static time_t l_checktime (lua_State *L, int arg) {
** it uses mkstemp.
** ===================================================================
*/
#if defined(ARDUPILOT_BUILD)
/* os lib is not available in ArduPilot, and tmpnam is not available on some
platforms, so define useless but harmless lua_tmpnam to avoid needing it */
#define LUA_TMPNAMBUFSIZE 1
/* always report error */
#define lua_tmpnam(b, e) { e = 1; }
#endif // defined(ARDUPILOT_BUILD)
#if !defined(lua_tmpnam) /* { */
#if defined(LUA_USE_POSIX) /* { */