Hello,
I want to reverse engineere an existing C++ project.
This project makes intensive use of preprocessor macros, to keep the source code platform independent.
Sample:class DCFRAMEWORK_API MyClass
{
public:
…
virtual bool onInit (STD_STL(string) & strText);
…
private:
STD_STL(string) m_strStaticUuid;
STD_STL(string) m_strDynamicUuid;
STD_STL(string) m_strName;
typedef STD_STL(map)<STD_STL(string), DCParamPtr> DCParamMap;
typedef DCParamMap::iterator DCParamMapIter;
typedef DCParamMap::value_type DCParamMapEntry;
DCParamMap m_DCGlobalParameters;
}
Defines:#ifdef WIN32
#ifdef DCFRAMEWORKDLL_EXPORTS
#define DCFRAMEWORK_API __declspec(dllexport)
#elif DCFRAMEWORKDLL_IMPORTS
#define DCFRAMEWORK_API __declspec(dllimport)
#else
#define DCFRAMEWORK_API
#endif
#else // WIN32
#define DCFRAMEWORK_API
#endif // WIN32
Macros:#define USING_NAMESPACE_STD = using namespace std;
#define BEGIN_NAMESPACE(x) = namespace x;
#define END_NAMESPACE(x) = };
#define USING_NAMESPACE(x) = using namespace x;
#define NAMESPACE(ns,class) = ns::class
#define STD_STL(x) = std::x
#define STD_IO(x) = std::x
#define STD_IOMANIP(x) = std::x
When I try to import the source code into the EA, I get many error messages of this type:
There was an error parsing D:\Projects\AM\DCFramework\dev\Exported\impl\CounterBase_impl.h on line 67. Unexpected symbol: &
You may need to define a language macro.
There was an error parsing D:\Projects\AM\DCFramework\dev\Exported\impl\DCApp_impl.h on line 121. Unexpected symbol: &
You may need to define a language macro.
There was an error parsing D:\Projects\AM\DCFramework\dev\Exported\impl\DCBase_impl.h on line 64. Unexpected symbol: ;
You may need to define a language macro.
There was an error parsing D:\Projects\AM\DCFramework\dev\Exported\impl\GenericDCElement_impl.h on line 70. Unexpected symbol: ;
You may need to define a language macro.
There was an error parsing D:\Projects\AM\DCFramework\dev\Exported\impl\MOBase_impl.h on line 73. Unexpected symbol: ;
…
I have already read the help under
http://www.sparxsystems.com.au/EAUserGuide/index.html?languagemacros.htm, but there is not sufficiently explained how I can define preprocessor macros.
Can anyone help?
Thanks!