On Sat, Dec 28, 2019 at 12:23:18AM +0300, Alexander Voropay wrote:
> Hi!

Hi,

> 
> Bugreport: current git urjrag compilation fail
> System: current MSYS2/mingw32
> File: /urjtag/src/tap/cable/dirtyjtag.c
> Error: re-defines function min() defined in the
>   /mingw32/i686-w64-mingw32/include/minwindef.h
>  included from /mingw32/include/libusb-1.0/libusb.h
>  -> /mingw32/i686-w64-mingw32/include/windows.h
>  -> mingw32/i686-w64-mingw32/include/windef.h
>  (part of Mingw Win32 SDK).
> Packages: libusb 1.0 installed
> 
> make[3]: Entering directory '/c/build/urjtag-git/urjtag/src/tap'
> depbase=`echo cable/dirtyjtag.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\
> /bin/sh ../../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H
> -I. -I../.. -I../../include/urjtag   -I../.. -I../../include
> -DNO_W32_PSEUDO_MODIFIERS -D_NO_W32_PSEUDO_MODIFIERS
> -IC:/msys32/mingw32/include/libusb-1.0 -Wall -Wmissing-prototypes
> -Wstrict-prototypes -Wpointer-arith -g -O2 -MT cable/dirtyjtag.lo -MD
> -MP -MF $depbase.Tpo -c -o cable/dirtyjtag.lo cable/dirtyjtag.c &&\
> mv -f $depbase.Tpo $depbase.Plo
> libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I../..
> -I../../include/urjtag -I../.. -I../../include
> -DNO_W32_PSEUDO_MODIFIERS -D_NO_W32_PSEUDO_MODIFIERS
> -IC:/msys32/mingw32/include/libusb-1.0 -Wall -Wmissing-prototypes
> -Wstrict-prototypes -Wpointer-arith -g -O2 -MT cable/dirtyjtag.lo -MD
> -MP -MF cable/.deps/dirtyjtag.Tpo -c cable/dirtyjtag.c  -DDLL_EXPORT
> -DPIC -o cable/.libs/dirtyjtag.o
> In file included from C:/msys32/mingw32/i686-w64-mingw32/include/windef.h:8,
>                  from C:/msys32/mingw32/i686-w64-mingw32/include/windows.h:69,
>                  from C:/msys32/mingw32/include/libusb-1.0/libusb.h:76,
>                  from ./usbconn/libusb.h:31,
>                  from cable/dirtyjtag.c:8:
> cable/dirtyjtag.c:113:16: error: expected identifier or '(' before 'int'
>   113 | static int min(int a, int b) {
>       |                ^~~
> cable/dirtyjtag.c:113:12: error: expected ')' before '<' token
>   113 | static int min(int a, int b) {
>       |            ^~~
> cable/dirtyjtag.c:113:12: error: expected ')' before '?' token
>   113 | static int min(int a, int b) {
>       |            ^~~
> make[3]: *** [Makefile:778: cable/dirtyjtag.lo] Error 1
> 
> 
> I do not have /not need a dirtyjtag, just a bugreport.

Thanks for making the effort to report it.
Active mingw32 users are becoming rare.
 
> Unfortunately, I can't provide patch. Should I completely remove
> min() function or just rename it to something like dirty_min() ?

At https://travis-ci.org/stappersg/urjtag is a succesfull build on Linux.

See if #IFDEF  MINGW32    can help.



Groeten
Geert Stappers
-- 
Leven en laten leven


_______________________________________________
UrJTAG-development mailing list
UrJTAG-development@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/urjtag-development

Reply via email to