"__inline" is undefined, "int32_t" has already been declared

When compiling BufferAllocation2.c

I get several errors:

BufferAllocation_2.c
Error[Pe020]: identifier “__inline” is undefined C:\dev\bootloader\Bootloader\FreeRTOSv202012.00\FreeRTOS-IP\include\FreeRTOS_IP.h 203
Error[Pe101]: “int32_t” has already been declared in the current scope (at line 29 of “C:\Program Files (x86)\IAR Systems\Embedded Workbench 8.1\arm\inc\c\stdint.h”) C:\dev\bootloader\Bootloader\FreeRTOSv202012.00\FreeRTOS-IP\include\FreeRTOS_IP.h 203
Error[Pe065]: expected a “;” C:\dev\bootloader\Bootloader\FreeRTOSv202012.00\FreeRTOS-IP\include\FreeRTOS_IP.h 203
Error[Pe020]: identifier “__inline” is undefined C:\dev\bootloader\Bootloader\FreeRTOSv202012.00\FreeRTOS-IP\include\FreeRTOS_IP.h 205

THe errors seem to originate in FreeRTOS_IP.h:
#if ( ipconfigHAS_INLINE_FUNCTIONS == 1 )

    static portINLINE int32_t FreeRTOS_max_int32( int32_t a,
                                                  int32_t b );
    static portINLINE uint32_t FreeRTOS_max_uint32( uint32_t a,

This happens with other files.

Any ideas?

In your project portINLINE is defined as __inline, which is the default. Could it be that IAR wants a different name for this prefix, maybe just “inline”?

Error[Pe101]: “int32_t” has already been declared

I would expect that type being defined in stdint.h, and I assume that this header file can be included multiple times?
Where else is it defined for a second time?

I also think it’s just inline for IAR. Maybe the int32_t issue is just a follow up problem und disappears after fixing portINLINE.

I just changed __line to inline as it is just shown on the next line and it compiled fine.
I still have some other errors but I think the inline and int32 errors have gone.
It seems that portmacro.h needs to be corrected for IAR…
I took this file from:
FreeRTOSv202012.00\FreeRTOS\portable\IAR\r0p1
so it should be the right one.

#define portNOP()

**#define portINLINE              inline //__inline**

#ifndef portFORCE_INLINE
    #define portFORCE_INLINE    **inline** __attribute__( ( always_inline ) )
#endif