summaryrefslogtreecommitdiff
path: root/digital/ai/src/fsm/angfsm.h
blob: 2934ec4e6a033167a4c972e6803095ceb0b683d7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/*
   AngFSM - Almost Non Generated Finite State Machine
   Copyright 2011, 2012 Jerome Jutteau

 This file is part of AngFSM.

 AngFSM is free software: you can redistribute it and/or modify
 it under the terms of the GNU Lesser General Public License as published by
 the Free Software Foundation, either version 3 of the License, or
 (at your option) any later version.

 AngFSM is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.

 You should have received a copy of the GNU Lesser General Public License
 along with AngFSM. If not, see <http://www.gnu.org/licenses/>.
 */

#include <inttypes.h>

#ifndef _ANGFSM_GEN_
#define _ANGFSM_GEN_

#ifndef ANGFSM_NAME
#define ANGFSM_NAME ANGFSM
#endif

/* Usefull macros. */
#define XSTR(s) STR(s)
#define STR(s) #s
#define ANGFSM_PASTE(a, b) a ## b
#define ANGFSM_PASTE_EXPAND(a, b) ANGFSM_PASTE (a, b)
#define ANGFSM_PASTE3_EXPAND(a, b, c)\
ANGFSM_PASTE_EXPAND (a, ANGFSM_PASTE_EXPAND (b, c))
#define FIRST(first, others...) first

#ifdef __HOST_ARCH__
/* Include generated header. */
#include XSTR (ANGFSM_PASTE_EXPAND (angfsm_gen_host_, ANGFSM_NAME).h)
#include "angfsm_generic.h"

#elif defined(__AVR_ARCH__)
/* Include generated header. */
#include XSTR (ANGFSM_PASTE_EXPAND (angfsm_gen_avr_, ANGFSM_NAME).h)
#include "angfsm_generic.h"

#elif defined(__arm__)
/* Include generated header. */
#include XSTR (ANGFSM_PASTE_EXPAND (angfsm_gen_arm_, ANGFSM_NAME).h)
#include "angfsm_generic.h"

#else
/* Compiling for HOST but for direct execution. */
#include "angfsm_host_exec.h"

#endif

#include "angfsm_renaming.h"

#endif /* #ifdef _ANGFSM_GEN_ */