From dee86bd16eba1a6e80292da346964703bca3c134 Mon Sep 17 00:00:00 2001 From: Jerome Jutteau Date: Tue, 5 Mar 2013 19:48:42 +0100 Subject: digital/ai/src/fsm: new return system --- digital/ai/src/fsm/angfsm.h | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'digital/ai/src/fsm/angfsm.h') diff --git a/digital/ai/src/fsm/angfsm.h b/digital/ai/src/fsm/angfsm.h index 2934ec4e..12ce101a 100644 --- a/digital/ai/src/fsm/angfsm.h +++ b/digital/ai/src/fsm/angfsm.h @@ -1,6 +1,6 @@ /* AngFSM - Almost Non Generated Finite State Machine - Copyright 2011, 2012 Jerome Jutteau + Copyright 2011-2013 Jerome Jutteau This file is part of AngFSM. @@ -36,20 +36,33 @@ ANGFSM_PASTE_EXPAND (a, ANGFSM_PASTE_EXPAND (b, c)) #define FIRST(first, others...) first +#define IFELSE_ARG1(yes, no, params...) \ + IFELSE_ARG1_ (params, IFELSE_ARG1_SEQ_(yes, no)) +#define IFELSE_ARG1_(params...) \ + IFELSE_ARG1__ (params) +#define IFELSE_ARG1__( _a1, \ + _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, \ + _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + selector, ...) selector +#define IFELSE_ARG1_SEQ_(yes, no) \ + no, no, no, no, no, no, no, no, no, no, \ + no, no, no, no, no, no, no, no, no, no, \ + yes + #ifdef __HOST_ARCH__ /* Include generated header. */ -#include XSTR (ANGFSM_PASTE_EXPAND (angfsm_gen_host_, ANGFSM_NAME).h) #include "angfsm_generic.h" +#include XSTR (ANGFSM_PASTE_EXPAND (angfsm_gen_host_, ANGFSM_NAME).h) #elif defined(__AVR_ARCH__) /* Include generated header. */ -#include XSTR (ANGFSM_PASTE_EXPAND (angfsm_gen_avr_, ANGFSM_NAME).h) #include "angfsm_generic.h" +#include XSTR (ANGFSM_PASTE_EXPAND (angfsm_gen_avr_, ANGFSM_NAME).h) #elif defined(__arm__) /* Include generated header. */ -#include XSTR (ANGFSM_PASTE_EXPAND (angfsm_gen_arm_, ANGFSM_NAME).h) #include "angfsm_generic.h" +#include XSTR (ANGFSM_PASTE_EXPAND (angfsm_gen_arm_, ANGFSM_NAME).h) #else /* Compiling for HOST but for direct execution. */ -- cgit v1.2.3