Skip to content

Commit e23f9a1

Browse files
committed
fix(Data/SQLParser): restore Windows unistd guard in flex_lexer.h #5377
The bison/flex regen in 01f7ec2 overwrote a POCO-local hand-patch in the generated flex_lexer.h that wrapped the unistd.h include in a Windows guard. MSVC has no unistd.h, so clang-cl Windows builds fail with: flex_lexer.h(470): fatal error: 'unistd.h' file not found Re-apply the same conditional, with a POCO-LOCAL comment so the next person who regens the lexer knows it has to be re-applied. flex's %option set in flex_lexer.l has no equivalent for this - nounistd would drop the include on every platform but flex's emitted runtime calls (read/write/close/isatty) need either unistd.h or io.h, so the conditional has to live in the generated header.
1 parent 13ebc04 commit e23f9a1

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

Data/SQLParser/src/parser/flex_lexer.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -467,8 +467,17 @@ void yyfree ( void * , yyscan_t yyscanner );
467467
* down here because we want the user's section 1 to have been scanned first.
468468
* The user has a chance to override it with an option.
469469
*/
470+
/* POCO-LOCAL: io.h provides the POSIX-ish I/O declarations flex's runtime
471+
* uses (read/write/isatty/close) on MSVC; unistd.h does not exist there.
472+
* Re-apply this conditional after every flex regen - it lives in the
473+
* generated header, not in flex_lexer.l.
474+
*/
475+
#if defined(_WIN32) || defined(_WIN64)
476+
#include <io.h>
477+
#else
470478
#include <unistd.h>
471479
#endif
480+
#endif
472481

473482
#ifndef YY_EXTRA_TYPE
474483
#define YY_EXTRA_TYPE void *

0 commit comments

Comments
 (0)