$NetBSD: patch-ak,v 1.3 2017/01/04 12:20:07 jperkin Exp $

Ensure the local yywrap is used.

--- lex.l.orig	1993-03-10 20:57:51.000000000 +0000
+++ lex.l
@@ -37,12 +37,35 @@
  ***********************************************************************/
 
 /* #include <stdio.h> */		/* lex already includes stdio.h */
+#include "twm.h"
 #include "gram.h"
 #include "parse.h"
+#undef yywrap
 extern char *ProgramName;
 
 extern int ParseError;
 
+#if defined(__NetBSD__)
+#undef YY_INPUT
+#define YY_INPUT(buf,result,size) ((result) = doinput((buf),(size)))
+int
+doinput (buf, size)
+char *buf;
+int size;
+{
+        int c;
+
+        if (size == 0)
+                return (0);
+
+        if ((c = (*twmInputFunc)()) <= 0)
+                return (0);
+
+        buf[0] = c;
+        return (1);
+}
+#endif
+
 %}
 
 string				\"([^"]|\\.)*\"
@@ -94,7 +117,10 @@ number				[0-9]+
 				}
 %%
 #ifndef yywrap
-yywrap() { return(1);}
+int yywrap() { return(1);}
+#endif
+#if defined(__NetBSD__) || defined(__APPLE__)
+int yylineno;
 #endif
 
 #undef unput
