From eb8b73d6ae15a80ef5e16be3e82b97750fd5a1c6 Mon Sep 17 00:00:00 2001 From: Jung-uk Kim Date: Wed, 22 May 2013 17:47:45 +0000 Subject: [PATCH] Improve compatibility with old flex and fix build with GCC. --- sbin/hastd/hast.h | 3 --- sbin/hastd/parse.y | 2 ++ sbin/hastd/token.l | 3 +++ 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/sbin/hastd/hast.h b/sbin/hastd/hast.h index b757994a19b5..381e19574e6b 100644 --- a/sbin/hastd/hast.h +++ b/sbin/hastd/hast.h @@ -259,7 +259,4 @@ struct hast_resource { struct hastd_config *yy_config_parse(const char *config, bool exitonerror); void yy_config_free(struct hastd_config *config); -void yyerror(const char *); -int yylex(void); - #endif /* !_HAST_H_ */ diff --git a/sbin/hastd/parse.y b/sbin/hastd/parse.y index bd0690a02abf..6bfb537c79cb 100644 --- a/sbin/hastd/parse.y +++ b/sbin/hastd/parse.y @@ -75,6 +75,8 @@ static char depth1_provname[PATH_MAX]; static char depth1_localpath[PATH_MAX]; static int depth1_metaflush; +extern void yyerror(const char *); +extern int yylex(void); extern void yyrestart(FILE *); static int isitme(const char *name); diff --git a/sbin/hastd/token.l b/sbin/hastd/token.l index a20efd7d0b30..e8f676094ef0 100644 --- a/sbin/hastd/token.l +++ b/sbin/hastd/token.l @@ -42,6 +42,9 @@ int depth; int lineno; #define DP do { } while (0) +#define YY_DECL int yylex(void) + +extern int yylex(void); %} %option noinput