/************************************************************/
Changes to the original code

kRadD / .tSCc. 2k6
/************************************************************/

/************************************************************/
/************************************************************/
lua
/************************************************************/
/************************************************************/

/************************************************************/
File: loslib.c
/************************************************************/

Original:
---------
static int os_clock (lua_State *L) {
  lua_pushnumber(L, ((lua_Number)clock())/(lua_Number)CLOCKS_PER_SEC);
  return 1;
}

Error:
------
CLOCKS_PER_SEC unknown

Replacement:
------------
static int os_clock (lua_State *L) {
  lua_pushnumber(L, ((lua_Number)clock())/(lua_Number)60);
  return 1;
}

/************************************************************/
File: lvm.c
/************************************************************/

Original:
---------
static int luaV_strcmp (const TString *ls, const TString *rs) {
  const char *l = getstr(ls);
  size_t ll = ls->tsv.len;
  const char *r = getstr(rs);
  size_t lr = rs->tsv.len;
  for (;;) {
    int temp = strcoll(l, r);

Error:
------
PureC dos not know the function strcoll, so I used strcmp

Replacement:
------------
static int luaV_strcmp (const TString *ls, const TString *rs) {
  const char *l = getstr(ls);
  size_t ll = ls->tsv.len;
  const char *r = getstr(rs);
  size_t lr = rs->tsv.len;
  for (;;) {
    int temp = strcmp(l, r);

/************************************************************/
loslib.c
/************************************************************/

Addition:
---------
/*
** No popen on ATARI
*/
#define USE_POPEN 0

Original:
---------
static int io_setloc (lua_State *L) {
  static const int cat[] = {LC_ALL, LC_COLLATE, LC_CTYPE, LC_MONETARY,
                      LC_NUMERIC, LC_TIME};
  static const char *const catnames[] = {"all", "collate", "ctype", "monetary",
     "numeric", "time", NULL};
  const char *l = lua_tostring(L, 1);
  int op = luaL_findstring(luaL_optstring(L, 2, "all"), catnames);
  luaL_argcheck(L, l || lua_isnoneornil(L, 1), 1, "string expected");
  luaL_argcheck(L, op != -1, 2, "invalid option");
  lua_pushstring(L, setlocale(cat[op], l));
  return 1;
}

Error:
------
PureC do not know the setlocale function. Use "C" as a fix return value.

Replacement:
------------
static int io_setloc (lua_State *L) {
  static const int cat[] = {LC_ALL, LC_COLLATE, LC_CTYPE, LC_MONETARY,
                      LC_NUMERIC, LC_TIME};
  static const char *const catnames[] = {"all", "collate", "ctype", "monetary",
     "numeric", "time", NULL};
  const char *l = lua_tostring(L, 1);
  int op = luaL_findstring(luaL_optstring(L, 2, "all"), catnames);
  luaL_argcheck(L, l || lua_isnoneornil(L, 1), 1, "string expected");
  luaL_argcheck(L, op != -1, 2, "invalid option");
 	/* ** lua_pushstring(L, setlocale(cat[op], l)); */
  lua_pushstring(L, "C");
  return 1;
}

/************************************************************/
/************************************************************/
luac
/************************************************************/
/************************************************************/

/************************************************************/
lopcodes.h
/************************************************************/

Original:
---------
#ifdef LUA_OPNAMES
extern const char *const luaP_opnames[];  /* opcode names */
#endif

Error:
------
undefined symbol luaP_opnames. Defined LUA_OPNAMES.

Replacement:
------------
#define LUA_OPNAMES

#ifdef LUA_OPNAMES
extern const char *const luaP_opnames[];  /* opcode names */
#endif