I have a source code that was written in C and therefore it uses a lot of macros as "templating" machanism. Although following code is C++ it illustrates this well:
#include <iostream>
#define IntType int
//#define IntType long
//#define IntType long long
#define CREATE_FUNCTION_NAME(it) function_for_it##_arg
#include "stdafx.h"
IntType CREATE_FUNCTION_NAME(IntType)(IntType x)
{
return x*x;
}
int _tmain(int argc, _TCHAR* argv[])
{
std::cout<<CREATE_FUNCTION_NAME(IntType)(2)<<std::endl;
getchar();
return 0;
}
My question is: How can I force Visual Studio (2010) to compile this for every required IntType and place all functions in DLL lib? In a standard manner I am able to create a project only for one IntType and get corresponding DLL. It is somewhat solution, but I would like to have all functions connected to this source in one DLL. Is it possible? A makefile project maybe? Example would be very useful.
Thanks in advance and Regards,
Misery