#ifndef PRL_TASKING_FI_H
#define PRL_TASKING_FI_H

/* Compilers may use another function within the assert macro to exit the 
 * program. QAC thus does not see an "exit" function and assumes the 
 * function returns, which it does not.
 * The below pragma tells QAC the compiler supplied function does not
 * return.
 */

/* Depending on the code that the compiler maker uses within the assert macro,
 * QAC may issue warnings. It is also possible that when the NDEBUG macro is used
 * to suppress the assertion code, QAC may issue a "no side-effects" warning.
 * To eliminate these, we turn off all warnings for the assert macro.
 */
#pragma PRQA_MACRO_MESSAGES_OFF "assert"

#if __QAC_MAJOR__ < 96
/* C99 */
#define _Pragma _ignore_paren
#endif

#if __QAC_MAJOR__ < 95
#define __noreturn__
#else
/*
Note that TASKING compilers expect __noreturn__ after the parameter list e.g.
extern  void                    exit     ( int ) __noreturn__;
so we can't define it to _Noreturn
*/
#define __noreturn__
#endif

/* Any other items that may be required in a "force-include" file should be placed below. */

#ifdef __CMCS__
#define __aru
#define __aei
#define __oreg
#define __xoreg
#define __wxreg

#define __channel _ignore_paren

#define __aei_t int 
typedef unsigned long long __uint72_t;
typedef long long __int72_t;

typedef struct {
  unsigned int acb; unsigned int data_l; unsigned int data_h;
} __aru_t;
typedef enum { __WUCE_FWD, __WUCE_BWD } __wuce_dir_t;

#elif defined(__CARM__)
/* Section numbers from carm user guide v5.2 July 24, 2015 */
/* 1.2 */
#define __unaligned
#define __packed__
#define __align _ignore_paren
/* 1.3 */
#define __at _ignore_paren
/* 1.7 */
#define __attribute__ _ignore_paren
#define __alias__ _ignore_paren
#define __const__
#define __export__
#define __flatten__
#define __format__ _ignore_paren
#define __leaf__
#define __malloc__
#define __noinline
#define __noinline__
#define __always_inline__
#define __noreturn__
#define __protect__
#define __pure__
#define __section__ _ignore_paren
#define __used__
#define __unused__
#define __weak__
/* 1.11.3.1 */
#define __interrupt_und
#define __interrupt_svc
#define __interrupt_iabt
#define __interrupt_dabt
#define __interrupt_irq
#define __interrupt_fiq
#define __interrupt _ignore_paren
#define __novector
/* 1.11.3.2 */
#define __frame _ignore_paren
/* 1.11.4 */
#define __data
/* undocumented */
#define __reentrant
#endif

#else
#error "Multiple include"
#endif  /* ifndef PRL_TASKING_FI_H */

