浏览代码

use the more modern _POSIX_C_SOURCE instead of older _POSIX_SOURCE

Roberto Ierusalimschy 22 年之前
父节点
当前提交
9a5bab82ff
共有 2 个文件被更改,包括 10 次插入3 次删除
  1. 8 1
      liolib.c
  2. 2 2
      lua.c

+ 8 - 1
liolib.c

@@ -1,5 +1,5 @@
 /*
 /*
-** $Id: liolib.c,v 2.28 2002/12/04 17:38:31 roberto Exp roberto $
+** $Id: liolib.c,v 2.29 2002/12/20 10:26:33 roberto Exp roberto $
 ** Standard I/O (and system) library
 ** Standard I/O (and system) library
 ** See Copyright Notice in lua.h
 ** See Copyright Notice in lua.h
 */
 */
@@ -28,6 +28,13 @@
 */
 */
 
 
 
 
+#ifdef _POSIX_C_SOURCE
+#if _POSIX_C_SOURCE >= 2
+#define USE_POPEN
+#endif
+#endif
+
+
 #ifndef USE_POPEN
 #ifndef USE_POPEN
 #define pclose(f)    (-1)
 #define pclose(f)    (-1)
 #endif
 #endif

+ 2 - 2
lua.c

@@ -1,5 +1,5 @@
 /*
 /*
-** $Id: lua.c,v 1.112 2002/12/04 17:28:27 roberto Exp roberto $
+** $Id: lua.c,v 1.113 2002/12/04 17:38:31 roberto Exp roberto $
 ** Lua stand-alone interpreter
 ** Lua stand-alone interpreter
 ** See Copyright Notice in lua.h
 ** See Copyright Notice in lua.h
 */
 */
@@ -26,7 +26,7 @@
 #endif
 #endif
 
 
 
 
-#ifdef _POSIX_SOURCE
+#ifdef _POSIX_C_SOURCE
 #include <unistd.h>
 #include <unistd.h>
 #else
 #else
 static int isatty (int x) { return x==0; }  /* assume stdin is a tty */
 static int isatty (int x) { return x==0; }  /* assume stdin is a tty */