Skip to content

Commit a2d1724

Browse files
committed
Introduced the m4_include_once macro.
1 parent 894dadb commit a2d1724

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/utilities.m4

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,15 @@
1-
m4_include([list.m4])
1+
2+
m4_set_delete([__FILES_ALREADY_INCLUDED__])
3+
m4_set_add([__FILES_ALREADY_INCLUDED__], __file__)
4+
dnl
5+
dnl $1: The filename to include
6+
m4_define([m4_include_once], [m4_do(
7+
[m4_set_contains([__FILES_ALREADY_INCLUDED__], [$1], [],
8+
[m4_set_add([__FILES_ALREADY_INCLUDED__], [$1])m4_include([$1])])],
9+
)])
10+
11+
12+
m4_include_once([list.m4])
213

314

415
m4_define([_ENDL_],

0 commit comments

Comments
 (0)