-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmacro.cpp
45 lines (31 loc) · 830 Bytes
/
macro.cpp
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
41
42
43
44
45
#include <iostream>
#include <stdio.h>
#define FUN_IN std::cout << "In " << __FUNCTION__ << std::endl;
#define FUN_OUT std::cout << "Out " << __FUNCTION__ << std::endl << std::endl;
#define MULTI_LINE { std::cout << "Line 1" << std::endl; \
std::cout << "Line 2" << std::endl; \
std::cout << "Line 3" << std::endl; \
}
// DEBUG_LOG(str)
// INFO_LOG(...)
#define FOO(...) printf(__VA_ARGS__)
void Test()
{
FUN_IN;
std::cout << "This is " << __FUNCTION__ << " functionality" << std::endl;
FUN_OUT;
}
void Test2()
{
FUN_IN;
std::cout << "This is " << __FUNCTION__ << " functionality" << std::endl;
FUN_OUT;
}
int main()
{
Test();
Test2();
MULTI_LINE;
FOO("[%s %d, %d] Hello World", "March", 26, 2009);
return 0;
}