@@ -40,6 +40,9 @@ extern "C"
4040
4141#if !defined(ERPC_TYPE_DEFINITIONS{$scopeNamePrefix}{$scopeNameC})
4242#define ERPC_TYPE_DEFINITIONS{$scopeNamePrefix}{$scopeNameC}
43+ {% if not cCommonHeaderFile %}
44+ {$fillNamespaceBegin()}
45+ {% endif -- not cCommonHeaderFile %}
4346{% if not empty(enums) %}
4447
4548// Enumerators data types declarations
@@ -67,6 +70,9 @@ typedef {$alias.unnamedType}
6770{% endfor -- alias.unnamed.members %}
6871} {$alias.unnamedName};
6972{% else -- alias.typenameName %}
73+ {% if alias.forwardDecl != "" %}
74+ {$alias.forwardDecl};
75+ {% endif -- alias.forwardDecl %}
7076typedef {$alias.typenameName};{$alias.ilComment}
7177{% endif -- alias.typenameName %}
7278{% endfor -- aliases %}
@@ -95,17 +101,24 @@ union {$us.name}
95101{% endif -- us.type == "union/struct" %}
96102{% endif -- !us.isExternal %}
97103{% endfor -- symbols %}
98-
99104{% endif -- nonExternalStruct || nonExternalUnion %}
100105{% if not empty(consts) %}
101106
102107// Constant variable declarations
103108{% for c in consts %}
104109{$> c.mlComment}
110+ {% if cCommonHeaderFile %}
105111extern const {$c.typeAndName};{$c.ilComment}{$loop.addNewLineIfNotLast}
112+ {% else -- not cCommonHeaderFile %}
113+ constexpr {$c.typeAndName} = {$c.value};{$c.ilComment}{$loop.addNewLineIfNotLast}
114+ {% endif -- cCommonHeaderFile %}
106115{% endfor -- consts %}
107116{% endif -- consts %}
117+ {% if not cCommonHeaderFile %}
118+
119+ {$fillNamespaceEnd()}
108120
121+ {% endif -- not cCommonHeaderFile %}
109122#endif // ERPC_TYPE_DEFINITIONS{$scopeNamePrefix}{$scopeNameC}
110123
111124{% if cCommonHeaderFile %}
0 commit comments