1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135
|
From: Sven Eckelmann <sven@narfation.org>
Date: Thu, 14 Sep 2023 15:31:04 +0200
Subject: imp_vrml: Disable yywrap
There is no definition anymore for yywrap - so just disable it to avoid the
loading error:
libg3d: plugins: failed to load /usr/lib/x86_64-linux-gnu/libg3d/plugins/import/imp_vrml.so: /usr/lib/x86_64-linux-gnu/libg3d/plugins/import/imp_vrml.so: undefined symbol: yywrap
Bug-Debian: #1051935
---
plugins/import/imp_vrml/imp_vrml.c | 3 ---
plugins/import/imp_vrml/imp_vrml_v1.c | 18 +++++++++++++++++-
plugins/import/imp_vrml/imp_vrml_v1.h | 16 ++++++++++++++++
plugins/import/imp_vrml/imp_vrml_v1.l | 1 +
4 files changed, 34 insertions(+), 4 deletions(-)
diff --git a/plugins/import/imp_vrml/imp_vrml.c b/plugins/import/imp_vrml/imp_vrml.c
index 5d694a7..83fa7b2 100644
--- a/plugins/import/imp_vrml/imp_vrml.c
+++ b/plugins/import/imp_vrml/imp_vrml.c
@@ -114,6 +114,3 @@ gchar **plugin_extensions(void)
return g_strsplit("vrml:iv", ":", 0);
}
-/* FIXME */
-extern int yywrap(yyscan_t yyscanner);
-int vrml_v1_yywrap(yyscan_t yyscanner) { return yywrap(yyscanner); }
diff --git a/plugins/import/imp_vrml/imp_vrml_v1.c b/plugins/import/imp_vrml/imp_vrml_v1.c
index 895efc7..b58138d 100644
--- a/plugins/import/imp_vrml/imp_vrml_v1.c
+++ b/plugins/import/imp_vrml/imp_vrml_v1.c
@@ -160,7 +160,15 @@ typedef void* yyscan_t;
/* Size of default input buffer. */
#ifndef YY_BUF_SIZE
+#ifdef __ia64__
+/* On IA-64, the buffer size is 16k, not 8k.
+ * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
+ * Ditto for the __ia64__ case accordingly.
+ */
+#define YY_BUF_SIZE 32768
+#else
#define YY_BUF_SIZE 16384
+#endif /* __ia64__ */
#endif
/* The state buf must be large enough to hold one state per character in the main buffer.
@@ -327,6 +335,9 @@ void vrml_v1_yyfree (void * ,yyscan_t yyscanner );
/* Begin user sect3 */
+#define vrml_v1_yywrap(n) 1
+#define YY_SKIP_YYWRAP
+
typedef unsigned char YY_CHAR;
typedef int yy_state_type;
@@ -907,7 +918,12 @@ static int input (yyscan_t yyscanner );
/* Amount of stuff to slurp up with each read. */
#ifndef YY_READ_BUF_SIZE
+#ifdef __ia64__
+/* On IA-64, the buffer size is 16k, not 8k */
+#define YY_READ_BUF_SIZE 16384
+#else
#define YY_READ_BUF_SIZE 8192
+#endif /* __ia64__ */
#endif
/* Copy whatever the last rule matched to the standard output. */
@@ -915,7 +931,7 @@ static int input (yyscan_t yyscanner );
/* This used to be an fputs(), but since the string might contain NUL's,
* we now use fwrite().
*/
-#define ECHO fwrite( yytext, yyleng, 1, yyout )
+#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
#endif
/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
diff --git a/plugins/import/imp_vrml/imp_vrml_v1.h b/plugins/import/imp_vrml/imp_vrml_v1.h
index 404f8f6..094e82c 100644
--- a/plugins/import/imp_vrml/imp_vrml_v1.h
+++ b/plugins/import/imp_vrml/imp_vrml_v1.h
@@ -153,7 +153,15 @@ typedef void* yyscan_t;
/* Size of default input buffer. */
#ifndef YY_BUF_SIZE
+#ifdef __ia64__
+/* On IA-64, the buffer size is 16k, not 8k.
+ * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
+ * Ditto for the __ia64__ case accordingly.
+ */
+#define YY_BUF_SIZE 32768
+#else
#define YY_BUF_SIZE 16384
+#endif /* __ia64__ */
#endif
#ifndef YY_TYPEDEF_YY_BUFFER_STATE
@@ -235,6 +243,9 @@ void vrml_v1_yyfree (void * ,yyscan_t yyscanner );
/* Begin user sect3 */
+#define vrml_v1_yywrap(n) 1
+#define YY_SKIP_YYWRAP
+
#define yytext_ptr yytext_r
#ifdef YY_HEADER_EXPORT_START_CONDITIONS
@@ -315,7 +326,12 @@ static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner);
/* Amount of stuff to slurp up with each read. */
#ifndef YY_READ_BUF_SIZE
+#ifdef __ia64__
+/* On IA-64, the buffer size is 16k, not 8k */
+#define YY_READ_BUF_SIZE 16384
+#else
#define YY_READ_BUF_SIZE 8192
+#endif /* __ia64__ */
#endif
/* Number of entries by which start-condition stack grows. */
diff --git a/plugins/import/imp_vrml/imp_vrml_v1.l b/plugins/import/imp_vrml/imp_vrml_v1.l
index 524cab5..89fe558 100644
--- a/plugins/import/imp_vrml/imp_vrml_v1.l
+++ b/plugins/import/imp_vrml/imp_vrml_v1.l
@@ -20,6 +20,7 @@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+%option noyywrap
%option reentrant nodefault
%option header-file="imp_vrml_v1.h"
%option prefix="vrml_v1_yy"
|