Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12745 Discussions

Bug in generated eCos <sys/endian.h>

Altera_Forum
Honored Contributor II
1,815 Views

I added some code that needed to do a little byte-swapping, and it refused to compile. First it coughed up a set of errors like: 

 

${INSTALL_DIR}/include/sys/endian.h:183: error: `cyg_uint32&#39; does not name a type 

 

So I added# include <cyg/infra/cyg_type.h>, wondering why the header file didn&#39;t do it itself. Then I got errors on the same line of the form: 

 

${INSTALL_DIR}/include/sys/endian.h:183: error: `htobe32&#39; does not name a type 

 

So I went and looked at the header, and lo and behold, starting at line 183 it looks like: 

 

cyg_uint32    htobe32 __P((cyg_uint32)); cyg_uint16    htobe16 __P((cyg_uint16)); cyg_uint32    betoh32 __P((cyg_uint32)); cyg_uint16    betoh16 __P((cyg_uint16)); cyg_uint32    htole32 __P((cyg_uint32)); cyg_uint16    htole16 __P((cyg_uint16)); cyg_uint32    letoh32 __P((cyg_uint32)); cyg_uint16    letoh16 __P((cyg_uint16)); # if BYTE_ORDER == LITTLE_ENDIAN /* Can be overridden by machine/endian.h before inclusion of this file.  */# ifndef _QUAD_HIGHWORD# define _QUAD_HIGHWORD 1# endif# ifndef _QUAD_LOWWORD# define _QUAD_LOWWORD 0# endif # define htobe16 swap16# define htobe32 swap32# define betoh16 swap16# define betoh32 swap32 # define htole16(x) (x)# define htole32(x) (x)# define letoh16(x) (x)# define letoh32(x) (x) # endif /* BYTE_ORDER */ 

etc. 

 

Commenting out those 8 lines starting with "cyg_" fixed the problem, and it built fine. 

 

So my question is, where did that come from, and how to fix it?
0 Kudos
0 Replies
Reply