summaryrefslogtreecommitdiff
path: root/src/loslib.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/loslib.c')
-rw-r--r--src/loslib.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/loslib.c b/src/loslib.c
index c721e711..b72ce961 100644
--- a/src/loslib.c
+++ b/src/loslib.c
@@ -1,9 +1,14 @@
/*
-** $Id: loslib.c,v 1.49 2014/10/17 16:28:21 roberto Exp $
+** $Id: loslib.c,v 1.53 2014/12/10 15:42:42 roberto Exp $
** Standard Operating System library
** See Copyright Notice in lua.h
*/
+#define loslib_c
+#define LUA_LIB
+
+#include "lprefix.h"
+
#include <errno.h>
#include <locale.h>
@@ -11,9 +16,6 @@
#include <string.h>
#include <time.h>
-#define loslib_c
-#define LUA_LIB
-
#include "lua.h"
#include "lauxlib.h"
@@ -25,9 +27,9 @@
** list of valid conversion specifiers for the 'strftime' function
*/
-#if !defined(LUA_USE_POSIX)
+#if defined(LUA_USE_C89)
#define LUA_STRFTIMEOPTIONS { "aAbBcdHIjmMpSUwWxXyYz%", "" }
-#else
+#else /* C99 specification */
#define LUA_STRFTIMEOPTIONS \
{ "aAbBcCdDeFgGhHIjmMnprRStTuUVwWxXyYzZ%", "", \
"E", "cCxXyY", \
@@ -74,7 +76,7 @@
#else /* }{ */
-/* ANSI definitions */
+/* ISO C definitions */
#define LUA_TMPNAMBUFSIZE L_tmpnam
#define lua_tmpnam(b,e) { e = (tmpnam(b) == NULL); }
@@ -97,7 +99,7 @@
#else /* }{ */
-/* ANSI definitions */
+/* ISO C definitions */
#define l_gmtime(t,r) ((void)r, gmtime(t))
#define l_localtime(t,r) ((void)r, localtime(t))
@@ -227,7 +229,7 @@ static int os_date (lua_State *L) {
struct tm tmr, *stm;
if (*s == '!') { /* UTC? */
stm = l_gmtime(&t, &tmr);
- s++; /* skip `!' */
+ s++; /* skip '!' */
}
else
stm = l_localtime(&t, &tmr);