On 18/09/2010 17:50, Peter Stuge wrote:
Xiaofan Chen wrote:
Win32 build with MinGW.org 32bit compiler is okay.
I got build error with MinGW-w64.
..

../../../../git/openocd/src/jtag/drivers/ft2232.c:138:22: error: redeclaration 
of enumerator 'TYPE_2232H'
/home/mcuee/mingw-w64/bin/../lib/gcc/x86_64-w64-mingw32/4.5.2/../../../../x86_64-w64-mingw32/include/ftdi.h:25:80:
 note: previous definition of 'TYPE_2232H' was here

Your MinGW-w64 gcc is version 4.5.2, maybe your MinGW.org gcc version
is an older version which is less strict about overlapping enums?


ft2232.c:

#define LIBFTDI_READ_RETRY_COUNT                2000

#ifndef BUILD_FT2232_HIGHSPEED
  #if BUILD_FT2232_FTD2XX == 1
        enum { FT_DEVICE_2232H = 6, FT_DEVICE_4232H };
  #elif BUILD_FT2232_LIBFTDI == 1
        enum { TYPE_2232H = 4, TYPE_4232H = 5 };
  #endif
#endif

ftdi.h from libftdi-0.18
/** FTDI chip type */
enum ftdi_chip_type { TYPE_AM=0, TYPE_BM=1, TYPE_2232C=2, TYPE_R=3,
TYPE_2232H=4, TYPE_4232H=5 };

Commenting out the following two lines seems to solve the issues.
But I am not so sure if this is the proper fix and why these two
lines are there (an older version of libftdi?)
  #elif BUILD_FT2232_LIBFTDI == 1
        enum { TYPE_2232H = 4, TYPE_4232H = 5 };

The enums seem to be actually refering to the same thing; ie. OpenOCD
has only copied them from ftdi.h. They were added to OpenOCD by:

commit ef30f22fd3355f668b23905f50bab4671f803ab1
Author: ntfreak<ntfr...@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Date:   Thu Aug 20 07:54:49 2009 +0000

     - remove enable-ft2232-highspeed configure option, high speed ftdi support 
is now detected during the configure stage
     - warning now issued if high speed ftdi device found and openocd was built 
using an old driver

     git-svn-id: svn://svn.berlios.de/openocd/tr...@2599 
b42882b7-edfa-0310-969c-e2dbd0fdcd60

and it seems that they were simply copypaste. The enums were used in
OpenOCD also before this commit; so they aren't really required
within OpenOCD.


This code was added for cases where high speed support is not detected by configure and BUILD_FT2232_HIGHSPEED is not defined.

If this is failing it looks more like a autoconf issue - what is the output of configure?

Cheers
Spen
_______________________________________________
Openocd-development mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to