public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Ali Erdinc Koroglu <aekoroglu@fedoraproject.org>
To: git-commits@fedoraproject.org
Subject: [rpms/ispc] rawhide: Fix build with flex 2.7
Date: Tue, 01 Dec 2026 11:00:58 GMT	[thread overview]
Message-ID: <179612285863.1.17956819225438663910.rpms-ispc-70ae4fffb137@fedoraproject.org> (raw)

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

                 reply	other threads:[~2026-12-01 11:00 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179612285863.1.17956819225438663910.rpms-ispc-70ae4fffb137@fedoraproject.org \
    --to=aekoroglu@fedoraproject.org \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox