public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/ispc] rawhide: Fix build with flex 2.7
@ 2026-12-01 11:00 Ali Erdinc Koroglu
0 siblings, 0 replies; only message in thread
From: Ali Erdinc Koroglu @ 2026-12-01 11:00 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : rpms/ispc
Branch : rawhide
Commit : 70ae4fffb13700151951e68d9a8575f732bf459b
Author : Ali Erdinc Koroglu <aekoroglu@fedoraproject.org>
Date : 2026-12-01T13:00:44+02:00
Stats : +65/-0 in 2 file(s)
URL : https://src.fedoraproject.org/rpms/ispc/c/70ae4fffb13700151951e68d9a8575f732bf459b?branch=rawhide
Log:
Fix build with flex 2.7
---
diff --git a/flex-2.7.patch b/flex-2.7.patch
new file mode 100644
index 0000000..76953d6
--- /dev/null
+++ b/flex-2.7.patch
@@ -0,0 +1,62 @@
+--- a/src/lex.ll
++++ b/src/lex.ll
+@@ -1130,3 +1130,10 @@
+ else
+ return TOKEN_IDENTIFIER;
+ }
++
++/* Wrappers that hide the flex buffer type, which changed in flex 2.7. */
++void *ispc_yy_scan_string(const char *str) { return yy_scan_string(str); }
++
++void ispc_yy_switch_to_file(FILE *f, int size) { yy_switch_to_buffer(yy_create_buffer(f, size)); }
++
++void ispc_yy_delete_buffer(void *b) { yy_delete_buffer(static_cast<decltype(yy_scan_string(""))>(b)); }
+--- a/src/module.cpp
++++ b/src/module.cpp
+@@ -346,10 +346,7 @@
+
+ extern FILE *yyin;
+ extern int yyparse();
+-typedef struct yy_buffer_state *YY_BUFFER_STATE;
+-extern void yy_switch_to_buffer(YY_BUFFER_STATE);
+-extern YY_BUFFER_STATE yy_create_buffer(FILE *, int);
+-extern void yy_delete_buffer(YY_BUFFER_STATE);
++extern void ispc_yy_switch_to_file(FILE *, int);
+ extern void ParserInit();
+
+ int Module::parse() {
+@@ -365,7 +362,7 @@
+ }
+ }
+ yyin = f;
+- yy_switch_to_buffer(yy_create_buffer(yyin, 4096));
++ ispc_yy_switch_to_file(yyin, 4096);
+ yyparse();
+ fclose(f);
+
+--- a/src/preprocessor.cpp
++++ b/src/preprocessor.cpp
+@@ -71,9 +71,8 @@
+ using namespace ispc;
+
+ extern int yyparse();
+-typedef struct yy_buffer_state *YY_BUFFER_STATE;
+-extern YY_BUFFER_STATE yy_scan_string(const char *);
+-extern void yy_delete_buffer(YY_BUFFER_STATE);
++extern void *ispc_yy_scan_string(const char *);
++extern void ispc_yy_delete_buffer(void *);
+
+ static void lInitializeSourceManager(clang::FrontendInputFile &input, clang::DiagnosticsEngine &diag,
+ clang::FileManager &fileMgr, clang::SourceManager &srcMgr) {
+@@ -633,9 +632,9 @@
+
+ /** Helper function to parse internal CPP buffer. **/
+ static void lParseCPPBuffer(std::unique_ptr<CPPBuffer> &bufferCPP) {
+- YY_BUFFER_STATE strbuf = yy_scan_string(bufferCPP->str.c_str());
++ void *strbuf = ispc_yy_scan_string(bufferCPP->str.c_str());
+ yyparse();
+- yy_delete_buffer(strbuf);
++ ispc_yy_delete_buffer(strbuf);
+ }
+
+ /** Helper function to clean internal CPP buffer. **/
diff --git a/ispc.spec b/ispc.spec
index e632fab..73f2994 100644
--- a/ispc.spec
+++ b/ispc.spec
@@ -10,6 +10,9 @@ License: BSD-3-Clause
URL: https://ispc.github.io/
Source0: https://github.com/%{name}/%{name}/archive/v%{version}/%{name}-%{version}.tar.gz
+# Fix link failure with flex 2.7 (yy_buffer_state type changed)
+Patch0: flex-2.7.patch
+
# Build dependencies
BuildRequires: bison
BuildRequires: cmake
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-12-01 11:00 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-12-01 11:00 [rpms/ispc] rawhide: Fix build with flex 2.7 Ali Erdinc Koroglu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox