With this fix it is possible to nest the WINE_TRY_SHLIB_FLAGS macro.
Example: WINE_TRY_SHLIB_FLAGS([first set of flags], [ac_cv_c_dll_flags="first set of flags"], [WINE_TRY_SHLIB_FLAGS([second set of flags], [ac_cv_c_dll_flags="second set of flags"], [ac_cv_c_dll_flags="third set of flags"])]) --- aclocal.m4 | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/aclocal.m4 b/aclocal.m4 index ed0c3a8317..194b3a9d93 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -178,10 +178,14 @@ dnl dnl Usage: WINE_TRY_SHLIB_FLAGS(flags,[action-if-yes,[action-if-no]]) dnl AC_DEFUN([WINE_TRY_SHLIB_FLAGS], -[ac_wine_try_cflags_saved=$CFLAGS +[AS_VAR_PUSHDEF([ac_var], ac_cv_cflags_[[$1]])dnl +ac_wine_try_cflags_saved=$CFLAGS CFLAGS="$CFLAGS $1" -AC_LINK_IFELSE([AC_LANG_SOURCE([void myfunc() {}])],[$2],[$3]) -CFLAGS=$ac_wine_try_cflags_saved]) +AC_LINK_IFELSE([AC_LANG_SOURCE([[void myfunc() {}]])], + [AS_VAR_SET(ac_var,yes)], [AS_VAR_SET(ac_var,no)]) +CFLAGS=$ac_wine_try_cflags_saved +AS_VAR_IF([ac_var],[yes], [$2], [$3])dnl +AS_VAR_POPDEF([ac_var])])
dnl **** Check whether we need to define a symbol on the compiler command line **** dnl
All included headers must be able to react on defines in config.h. Also this removes gcc's warning messages - 'warning: "XYZ" redefined'. --- tools/widl/parser.l | 9 ++++++++- tools/wrc/parser.l | 10 ++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/tools/widl/parser.l b/tools/widl/parser.l index 3cbf4ff2d2..ca355a11c9 100644 --- a/tools/widl/parser.l +++ b/tools/widl/parser.l @@ -40,9 +40,16 @@ double [0-9]+.[0-9]+([eE][+-]?[0-9]+)* %x PP_PRAGMA %x SQUOTE
+%top{ +/** + * config.h must be included as the very first line of your code after comments, + * so that all other header files can react on the defines. + */ +#include "config.h" +} + %{
-#include "config.h" #include "wine/port.h"
#include <stdio.h> diff --git a/tools/wrc/parser.l b/tools/wrc/parser.l index f456c626d1..5687ab2086 100644 --- a/tools/wrc/parser.l +++ b/tools/wrc/parser.l @@ -91,12 +91,18 @@ /* Some shortcut definitions */ ws [ \f\t\r]
+%top{ +/** + * config.h must be included as the very first line of your code after comments, + * so that all other header files can react on the defines. + */ +#include "config.h" +} + %{
/*#define LEX_DEBUG*/
-#include "config.h" - #include <stdio.h> #include <stdlib.h> #include <string.h>
Evgeny Litvinenko evgeny.v.litvinenko@gmail.com writes:
All included headers must be able to react on defines in config.h. Also this removes gcc's warning messages - 'warning: "XYZ" redefined'.
Where do you see that?
Hi Alexandre.
On 9/5/19, Alexandre Julliard julliard@winehq.org wrote:
Evgeny Litvinenko evgeny.v.litvinenko@gmail.com writes:
All included headers must be able to react on defines in config.h. Also this removes gcc's warning messages - 'warning: "XYZ" redefined'.
Where do you see that?
-- Alexandre Julliard julliard@winehq.org
On OpenIndiana Hipster 2019.04. with flex 2.6.4
I am trying to build wine-4.15 and get messages like this ------------[ build log snippet ]------------ /usr/gcc/6/bin/gcc -c -o xslpattern.yy.o xslpattern.yy.c -I. \ -I/home/src/oi-userland/components/runtime/wine/wine-4.15/dlls/msxml3 -I../../include \ -I/home/src/oi-userland/components/runtime/wine/wine-4.15/include -I/usr/include/libxml2 \ -D__WINESRC__ -D_REENTRANT -fPIC -Wall -pipe -fno-strict-aliasing -Wdeclaration-after-statement \ -Wempty-body -Wignored-qualifiers -Wshift-overflow=2 -Wstrict-prototypes -Wtype-limits \ -Wunused-but-set-parameter -Wvla -Wwrite-strings -Wpointer-arith -Wlogical-op \ -fno-omit-frame-pointer -m32 -O3 In file included from /home/src/oi-userland/components/runtime/wine/wine-4.15/dlls/msxml3/xslpattern.l:22:0: ../../include/config.h:1485:0: warning: "_FILE_OFFSET_BITS" redefined #define _FILE_OFFSET_BITS 64
In file included from /usr/include/stdio.h:37:0, from xslpattern.yy.c:241: /usr/include/sys/feature_tests.h:231:0: note: this is the location of the previous definition #define _FILE_OFFSET_BITS 32 ------------[ end build log snippet ]------------
I see that the patch needs more work as there are other places (e.g. dlls/msxml3/xslpattern.l) where I get 'redefined' messages too.
Thanks, Evgeny.