I'm trying to compile some MSC code that contains the following pragma:
void myFunc(int a, double b)
#pragma comment(linker, "/EXPORT:"__FUNCTION__"="__FUNCDNAME__",PRIVATE")
which handy to define a function alias for an exported function (it's a simpler alternative than creating a MSC .def file which is difficult to maintain).
However the Intel compiler (Version 126.96.36.199) can't concatenate "/EXPORT" with __FUNCTION__
E.g. if you compile the following
int _tmain(int argc, _TCHAR* argv)
the output is
1>------ Build started: Project: ConsoleApplication1 (Intel C++ 15.0), Configuration: Debug Win32 ------
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
I did see an another forum item on the same topic, namely https://software.intel.com/en-us/articles/treating-func-and-function-as-string-literals , however that appears to only solve the problem when a string literal is appended to __FUNCTION__ but not when __FUNCTION__ is appended to string literal.
Is there a work-around?
For more complete information about compiler optimizations, see our Optimization Notice.