scc

A fork of https://git.simple-cc.org/scc/ for Qute

git clone https://git.8pit.net/scc.git

 1#define a(x) #   x
 2
 3static char *s = a ( 3
 42);
 5
 6static int
 7cmp(char *s1, char *s2)
 8{
 9	while (*s1 && *s2 && *s1 == *s2)
10		++s1, ++s2;
11	return *s1 == '\0' && *s2 == '\0';
12}
13
14int
15main(void)
16{
17	if (!cmp(a(3), "3"))
18		return 1;
19	if (!cmp(a( 3 ), "3"))
20		return 2;
21	if (!cmp(a( 3  2 ), "3 2"))
22		return 3;
23	if (!cmp(s, "3 2"))
24		return 4;
25	if (!cmp(a("3 2  1\n"), "\"3 2  1\\n\""))
26		return 5;
27	if (!cmp(a('\n'), "'\\n'"))
28		return 6;
29	if (!cmp(a('"'), "'\"'"))
30		return 6;
31	if (!cmp(a(: @\n), ": @\n"))
32		return 7;
33
34	return 0;
35}