boot2

Playing with the boostrap
git clone https://git.ryansepassi.com/git/boot2.git
Log | Files | Refs | README

00083.c (445B)


      1 #define CALL(FUN, ...) FUN(__VA_ARGS__)
      2 
      3 int
      4 one(int a)
      5 {
      6 	if (a != 1)
      7 		return 1;
      8 	
      9 	return 0;
     10 }
     11 
     12 int
     13 two(int a, int b)
     14 {
     15 	if (a != 1)
     16 		return 1;
     17 	if (b != 2)
     18 		return 1;
     19 	
     20 	return 0;
     21 }
     22 
     23 int
     24 three(int a, int b, int c)
     25 {
     26 	if (a != 1)
     27 		return 1;
     28 	if (b != 2)
     29 		return 1;
     30 	if (c != 3)
     31 		return 1;
     32 	
     33 	return 0;
     34 }
     35 
     36 int
     37 main()
     38 {
     39 	if (CALL(one, 1))
     40 		return 2;
     41 	if (CALL(two, 1, 2))
     42 		return 3;
     43 	if (CALL(three, 1, 2, 3))
     44 		return 4;
     45 	
     46 	return 0;
     47 }