mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-16 06:05:58 -06:00
143 lines
No EOL
4.5 KiB
C
143 lines
No EOL
4.5 KiB
C
#define __Expand1(x) x(1)
|
|
#define __Expand2(x) __Expand1(x) x(2)
|
|
#define __Expand3(x) __Expand2(x) x(3)
|
|
#define __Expand4(x) __Expand3(x) x(4)
|
|
#define __Expand5(x) __Expand4(x) x(5)
|
|
#define __Expand6(x) __Expand5(x) x(6)
|
|
#define __Expand7(x) __Expand6(x) x(7)
|
|
#define __Expand8(x) __Expand7(x) x(8)
|
|
#define __Expand9(x) __Expand8(x) x(9)
|
|
#define __Expand10(x) __Expand9(x) x(10)
|
|
#define __Expand11(x) __Expand10(x) x(11)
|
|
#define __Expand12(x) __Expand11(x) x(12)
|
|
#define __Expand13(x) __Expand12(x) x(13)
|
|
#define __Expand14(x) __Expand13(x) x(14)
|
|
#define __Expand15(x) __Expand14(x) x(15)
|
|
#define __Expand16(x) __Expand15(x) x(16)
|
|
#define __Expand17(x) __Expand16(x) x(17)
|
|
#define __Expand18(x) __Expand17(x) x(18)
|
|
#define __Expand19(x) __Expand18(x) x(19)
|
|
#define __Expand20(x) __Expand19(x) x(20)
|
|
#define __Expand21(x) __Expand20(x) x(21)
|
|
#define __Expand22(x) __Expand21(x) x(22)
|
|
#define __Expand23(x) __Expand22(x) x(23)
|
|
#define __Expand24(x) __Expand23(x) x(24)
|
|
#define __Expand25(x) __Expand24(x) x(25)
|
|
#define __Expand26(x) __Expand25(x) x(26)
|
|
#define __Expand27(x) __Expand26(x) x(27)
|
|
#define __Expand28(x) __Expand27(x) x(28)
|
|
#define __Expand29(x) __Expand28(x) x(29)
|
|
#define __Expand30(x) __Expand29(x) x(30)
|
|
#define __Expand31(x) __Expand30(x) x(31)
|
|
#define __Expand32(x) __Expand31(x) x(32)
|
|
#define __Expand33(x) __Expand32(x) x(33)
|
|
#define __Expand34(x) __Expand33(x) x(34)
|
|
#define __Expand35(x) __Expand34(x) x(35)
|
|
#define __Expand36(x) __Expand35(x) x(36)
|
|
#define __Expand37(x) __Expand36(x) x(37)
|
|
#define __Expand38(x) __Expand37(x) x(38)
|
|
#define __Expand39(x) __Expand38(x) x(39)
|
|
#define __Expand40(x) __Expand39(x) x(40)
|
|
|
|
#define __Expand(x) __Expand40(x)
|
|
|
|
#define __List1(x) x(1)
|
|
#define __List2(x) __List1(x), x(2)
|
|
#define __List3(x) __List2(x), x(3)
|
|
#define __List4(x) __List3(x), x(4)
|
|
#define __List5(x) __List4(x), x(5)
|
|
#define __List6(x) __List5(x), x(6)
|
|
#define __List7(x) __List6(x), x(7)
|
|
#define __List8(x) __List7(x), x(8)
|
|
#define __List9(x) __List8(x), x(9)
|
|
#define __List10(x) __List9(x), x(10)
|
|
#define __List11(x) __List10(x), x(11)
|
|
#define __List12(x) __List11(x), x(12)
|
|
#define __List13(x) __List12(x), x(13)
|
|
#define __List14(x) __List13(x), x(14)
|
|
#define __List15(x) __List14(x), x(15)
|
|
#define __List16(x) __List15(x), x(16)
|
|
#define __List17(x) __List16(x), x(17)
|
|
#define __List18(x) __List17(x), x(18)
|
|
#define __List19(x) __List18(x), x(19)
|
|
#define __List20(x) __List19(x), x(20)
|
|
#define __List21(x) __List20(x), x(21)
|
|
#define __List22(x) __List21(x), x(22)
|
|
#define __List23(x) __List22(x), x(23)
|
|
#define __List24(x) __List23(x), x(24)
|
|
#define __List25(x) __List24(x), x(25)
|
|
#define __List26(x) __List25(x), x(26)
|
|
#define __List27(x) __List26(x), x(27)
|
|
#define __List28(x) __List27(x), x(28)
|
|
#define __List29(x) __List28(x), x(29)
|
|
#define __List30(x) __List29(x), x(30)
|
|
#define __List31(x) __List30(x), x(31)
|
|
#define __List32(x) __List31(x), x(32)
|
|
#define __List33(x) __List32(x), x(33)
|
|
#define __List34(x) __List33(x), x(34)
|
|
#define __List35(x) __List34(x), x(35)
|
|
#define __List36(x) __List35(x), x(36)
|
|
#define __List37(x) __List36(x), x(37)
|
|
#define __List38(x) __List37(x), x(38)
|
|
#define __List39(x) __List38(x), x(39)
|
|
#define __List40(x) __List39(x), x(40)
|
|
|
|
#define E__p(I) p##I
|
|
|
|
#define ASSTRING_(x) #x
|
|
#define ASSTRING(x) ASSTRING_(x)
|
|
|
|
#define COMBINE__(a, b) a##b
|
|
#define COMBINE(a, b) COMBINE__(a, b)
|
|
|
|
#define COMBINE3__(a, b, c) a##b##c
|
|
#define COMBINE3(a, b, c) COMBINE3__(a, b, c)
|
|
|
|
#define COMBINE4__(a, b, c, d) a##b##c##d
|
|
#define COMBINE4(a, b, c, d) COMBINE4__(a, b, c, d)
|
|
|
|
#define COMBINE5__(a, b, c, d, e) a##b##c##d##e
|
|
#define COMBINE5(a, b, c, d, e) COMBINE5__(a, b, c, d, e)
|
|
|
|
#define E__NFValue(I) const Value& COMBINE(p, I)
|
|
#define E__NFBody(I) String Format(const char *fmt, __List##I(E__NFValue));
|
|
|
|
EXPAND: __Expand2(E__NFBody)
|
|
|
|
ASSTRING(Just a test)
|
|
|
|
COMBINE(aaaa, bbbb)
|
|
|
|
|
|
#define TEST(x, y) %x%y%
|
|
#define TESTS(x) #x
|
|
#define TEST2(x, y) x ## y
|
|
#define TEST4 alfa x ## y.r #hahaha
|
|
#define TESTX x
|
|
#define TESTY haha
|
|
#define TESTZ haha
|
|
|
|
TEST('\1', "\2")
|
|
TEST( 1 +1 , 3 )
|
|
TEST( "1" "2" ",", ',')
|
|
TESTS(a)
|
|
TESTS(a x y)
|
|
TESTS("A")
|
|
TEST2(a, 3)
|
|
TEST2(3, a)
|
|
TEST2(a, #)
|
|
TEST2(a, "X")
|
|
TEST2("Y", "X")
|
|
TESTX
|
|
TESTY
|
|
TESTZ
|
|
TEST4
|
|
|
|
#define pow2(x) (x) * (x)
|
|
#define dist(a, b) pow2(a.x - b.x) + pow2(a.y - b.y)
|
|
|
|
dist(x, y);
|
|
|
|
#define __countof(a) int(sizeof(a) / sizeof(a[0]))
|
|
|
|
__countof(bla) |