diff libinterp/parse-tree/lex.ll @ 21910:4d723ba06b4a

provide wrappers for some unistd.h functions * liboctave/wrappers/unistd-wrappers.c, liboctave/wrappers/unistd-wrappers.h: New files. * liboctave/wrappers/module.mk: Update. * gl2ps-print.cc, oct-hist.cc, oct-procbuf.cc, oct-tex-lexer.in.ll, sysdep.cc, octave.cc, parse-tree/lex.ll, file-ops.cc, lo-sysdep.cc, oct-env.cc, oct-syscalls.cc, cmd-edit.cc, kpse.cc: Use wrappers instead of calling unistd.h functions directly.
author John W. Eaton <jwe@octave.org>
date Tue, 14 Jun 2016 18:10:04 -0400
parents 0b5fd19477fd
children d92dcbcd7691
line wrap: on
line diff
--- a/libinterp/parse-tree/lex.ll	Tue Jun 14 16:31:34 2016 -0400
+++ b/libinterp/parse-tree/lex.ll	Tue Jun 14 18:10:04 2016 -0400
@@ -89,12 +89,10 @@
 #include <string>
 #include <stack>
 
-#include <sys/types.h>
-#include <unistd.h>
-
 #include "cmd-edit.h"
+#include "lo-mappers.h"
 #include "quit.h"
-#include "lo-mappers.h"
+#include "unistd-wrappers.h"
 
 // These would be alphabetical, but oct-parse.h must be included before
 // oct-gperf.h and oct-parse.h must be included after token.h and the tree
@@ -131,13 +129,15 @@
 #  define YYSTYPE OCTAVE_STYPE
 #endif
 
+#define YY_NO_UNISTD_H 1
+#define isatty octave_isatty_wrapper
+
 #if defined (GNULIB_NAMESPACE)
 // Calls to the following functions appear in the generated output from
 // flex without the namespace tag.  Redefine them so we will use them
 // via the gnulib namespace.
 #  define fprintf GNULIB_NAMESPACE::fprintf
 #  define fwrite GNULIB_NAMESPACE::fwrite
-#  define isatty GNULIB_NAMESPACE::isatty
 #  define malloc GNULIB_NAMESPACE::malloc
 #  define realloc GNULIB_NAMESPACE::realloc
 #endif