forked from open-mpi/ompi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ompi_cplusplus.sed
41 lines (35 loc) · 1.26 KB
/
ompi_cplusplus.sed
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
#
# Best attempt at a sed script to remove (almost) all combinations
# of C++ namespace occurences: While std. 3-line occurences with any
# combination of spaces and ordering of [c_plusplus,__cplusplus] can
# be detected, sed does not allow multi-line (here >3 lines) parsing.
# This all depends on the number of "N" the macro swallows.
#
# C_PLUSPLUS || __CPLUSPLUS
/#if *defined *(c_plusplus) *|| *defined *(__cplusplus)/{
N
N
s/\#if *defined *(c_plusplus) *|| *defined *(__cplusplus) *\n}\n#endif */END_C_DECLS/
s/\#if *defined *(c_plusplus) *|| *defined *(__cplusplus) *\n *extern *"C" *{ *\n\#endif */BEGIN_C_DECLS/
}
# __CPLUSPLUS || C_PLUSPLUS
/#if *defined *(__cplusplus) *|| *defined *(c_plusplus)/{
N
N
s/\#if *defined *(__cplusplus) *|| *defined *(c_plusplus) *\n}\n#endif */END_C_DECLS/
s/\#if *defined *(__cplusplus) *|| *defined *(c_plusplus) *\n *extern *"C" *{ *\n\#endif */BEGIN_C_DECLS/
}
# C_PLUSPLUS
/#if *defined *(c_plusplus)/{
N
N
s/\#if *defined *(c_plusplus) *\n}\n#endif */END_C_DECLS/
s/\#if *defined *(c_plusplus) *\n *extern *"C" *{ *\n\#endif *\n/BEGIN_C_DECLS/
}
# __CPLUSPLUS
/#if *defined *(__cplusplus)/{
N
N
s/\#if *defined *(__cplusplus) *\n}\n#endif */END_C_DECLS/
s/\#if *defined *(__cplusplus) *\n *extern *"C" *{ *\n\#endif */BEGIN_C_DECLS/
}