From: Andre Noll Date: Tue, 11 Jul 2017 19:41:47 +0000 (+0200) Subject: config_file.l: Change default prefix for global symbols. X-Git-Tag: v1.0.1~3 X-Git-Url: http://git.tue.mpg.de/?a=commitdiff_plain;h=825083ef841055965335996771b385e4cb9c62ca;p=lopsub.git config_file.l: Change default prefix for global symbols. Without this, applications which use flex for their own work might run into problems due to duplicate symbols when linking against liblopsub. Since this is an ABI change, we have to increment the ABI version number. No changes in the source code are necessary since flex provides macros which allow to still refer to the variables and functions with the usual yy prefixed names. However, the command nm -e liblopsub.a shows that the external symbols are now prefixed with lls_yy. Note that the patch only changes config_file.l. We don't bother to adjust lopsubgen.l in the same way because the object file which is derived from lopsubgen.l is not part of the library. It is only linked into the lopsubgen executable. --- diff --git a/config_file.l b/config_file.l index 0b84350..b6eff7c 100644 --- a/config_file.l +++ b/config_file.l @@ -4,6 +4,9 @@ * Licensed under the LGPL v3, see http://www.gnu.org/licenses/lgpl-3.0.html */ + /* We don't want symbols to clash with those of other flex users. */ +%option prefix="lls_yy" + %option stack %option never-interactive %option yylineno diff --git a/lopsub-internal.h b/lopsub-internal.h index 99366d3..bbc2963 100644 --- a/lopsub-internal.h +++ b/lopsub-internal.h @@ -6,7 +6,7 @@ #include -#define LLS_ABI_VERSION 1 +#define LLS_ABI_VERSION 2 /* * Concat "lls_abi_version" and the ABI version number to produce the name of a