[ create a new paste ] login | about

Link: http://codepad.org/uP3pLEWd    [ raw code | output | fork ]

C++, pasted on Jul 24:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#define IMPLEMENT_MODULE_2(A, B) A##B
#define IMPLEMENT_MODULE(name) IMPLEMENT_MODULE_2(something, name)

#define PLUGIN_NAME SomePluginName
#define _STR(s) #s
#define STR(s) _STR(s)
#define PLUGIN_NAME_STR STR(PLUGIN_NAME)

int main()
{
    string expected = "somethingSomePluginName";
    string actual = STR(IMPLEMENT_MODULE(PLUGIN_NAME));

    printf("expected: %s || actual: %s\n", expected.c_str(), actual.c_str());
    assert(expected == actual);
}


Output:
1
expected: somethingSomePluginName || actual: somethingSomePluginName


Create a new paste based on this one


Comments: