[coreboot-gerrit] New patch to review for coreboot: fmd: Use _fileno() on MINGW
Stefan Reinauer (stefan.reinauer@coreboot.org)
gerrit at coreboot.org
Mon Sep 14 18:02:27 CET 2015
Stefan Reinauer (stefan.reinauer at coreboot.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/11637
-gerrit
commit 71589f7dbf1b4d280e4f55a8b0051111070d247b
Author: Stefan Reinauer <reinauer at chromium.org>
Date: Mon Sep 14 11:01:12 2015 -0700
fmd: Use _fileno() on MINGW
fileno() is not available on non-Posix systems (like MINGW),
so use the Windows specific _fileno() in those cases.
Change-Id: If1e5f0b6834fb5b9b2b3dfbaf0ce36c46661907c
Signed-off-by: Stefan Reinauer <stefan.reinauer at coreboot.org>
---
util/cbfstool/fmd_scanner.c_shipped | 32 ++++++++++++++++++--------------
util/cbfstool/fmd_scanner.l | 4 ++++
2 files changed, 22 insertions(+), 14 deletions(-)
diff --git a/util/cbfstool/fmd_scanner.c_shipped b/util/cbfstool/fmd_scanner.c_shipped
index b22011d..a414bf1 100644
--- a/util/cbfstool/fmd_scanner.c_shipped
+++ b/util/cbfstool/fmd_scanner.c_shipped
@@ -496,9 +496,13 @@ char *yytext;
#include <assert.h>
#include <string.h>
+#ifdef __MINGW32__
+#define fileno(x) _fileno(x)
+#endif
+
int parse_integer(char *src, int base);
int copy_string(const char *src);
-#line 502 "<stdout>"
+#line 506 "<stdout>"
#define INITIAL 0
@@ -712,10 +716,10 @@ YY_DECL
}
{
-#line 34 "fmd_scanner.l"
+#line 38 "fmd_scanner.l"
-#line 719 "<stdout>"
+#line 723 "<stdout>"
while ( 1 ) /* loops until end-of-file is reached */
{
@@ -775,7 +779,7 @@ do_action: /* This label is used only to access EOF actions. */
case 1:
/* rule 1 can match eol */
YY_RULE_SETUP
-#line 36 "fmd_scanner.l"
+#line 40 "fmd_scanner.l"
/* Eat whitespace. */
YY_BREAK
case 2:
@@ -783,42 +787,42 @@ case 2:
(yy_c_buf_p) = yy_cp -= 1;
YY_DO_BEFORE_ACTION; /* set up yytext again */
YY_RULE_SETUP
-#line 37 "fmd_scanner.l"
+#line 41 "fmd_scanner.l"
/* Eat comments. */
YY_BREAK
case 3:
-#line 39 "fmd_scanner.l"
+#line 43 "fmd_scanner.l"
case 4:
YY_RULE_SETUP
-#line 39 "fmd_scanner.l"
+#line 43 "fmd_scanner.l"
return parse_integer(yytext, 10);
YY_BREAK
case 5:
YY_RULE_SETUP
-#line 40 "fmd_scanner.l"
+#line 44 "fmd_scanner.l"
return OCTAL;
YY_BREAK
case 6:
YY_RULE_SETUP
-#line 41 "fmd_scanner.l"
+#line 45 "fmd_scanner.l"
return parse_integer(yytext + 2, 16);
YY_BREAK
case 7:
YY_RULE_SETUP
-#line 42 "fmd_scanner.l"
+#line 46 "fmd_scanner.l"
return copy_string(yytext);
YY_BREAK
case 8:
YY_RULE_SETUP
-#line 43 "fmd_scanner.l"
+#line 47 "fmd_scanner.l"
return *yytext;
YY_BREAK
case 9:
YY_RULE_SETUP
-#line 45 "fmd_scanner.l"
+#line 49 "fmd_scanner.l"
ECHO;
YY_BREAK
-#line 822 "<stdout>"
+#line 826 "<stdout>"
case YY_STATE_EOF(INITIAL):
yyterminate();
@@ -1813,7 +1817,7 @@ void yyfree (void * ptr )
#define YYTABLES_NAME "yytables"
-#line 44 "fmd_scanner.l"
+#line 48 "fmd_scanner.l"
diff --git a/util/cbfstool/fmd_scanner.l b/util/cbfstool/fmd_scanner.l
index 439548e..13e1df1 100644
--- a/util/cbfstool/fmd_scanner.l
+++ b/util/cbfstool/fmd_scanner.l
@@ -23,6 +23,10 @@
#include <assert.h>
#include <string.h>
+#ifdef __MINGW32__
+#define fileno(x) _fileno(x)
+#endif
+
int parse_integer(char *src, int base);
int copy_string(const char *src);
%}
More information about the coreboot-gerrit
mailing list