I am having problems with macros in IDL
The JacORB IDL compiler does not support preprocessor macros. Summary: Always use the Read below for a detailed explanation: The JacORB IDL compiler does not support preprocessor macros. This is a bad limitation of the IDL compiler (in our opinion not acceptable). With ACS 3.1 we have introduced a separate pre-processing step for idl files containing macros. You now have to put IDL code using macros in files with the The Makefile will automatically expand the macros generating a normal For example (see the module ACS/LGPL/CommonSoftware/enumprop), if you create the file myEnumprop.midl: #ifndef _MYENUMPROP_MIDL #define _MYENUMPROP_MIDL #include <baci.idl> #include <enumpropMACRO.idl> module TEST { enum Bool { testFALSE, testTRUE}; ACS_ENUM(Bool); }; #endif the Makefile will generate myEnumprop.idl with the macros expanded that you can use in any other file and that will load in the interface repository without troubles. Before ACS 3.1, to workaround this problem, the ACS Makefile was just preprocessing IDL files with the standard CPP pre-processor before passing them to the JacORB IDL compiler. This generally worked, but could still lead to problems in special cases. We have in particular discovered (see SPR ALMASW2003048) that if an IDL file contianing macros is included twice, the JacORB IDL compiler does not behave correctly. What happens is that the second time the file is included:
An easy workaround is to add one layer of include files to make sure JacORB does not try to parse the macros. For example:
#ifndef _ENUMPROP_MACRO_IDL_ #define _ENUMPROP_MACRO_IDL_ .... macros ....... #endif /* ENUMPROP_MACRO_IDL_ */
#ifndef _ENUMPROP_MACRO_IDL_ #define _ENUMPROP_MACRO_IDL_ #include "enumpropMACRO_included.idl" #endif /* ENUMPROP_MACRO_IDL_ */
#ifndef _ENUMPROP_MACRO_INCLUDED_IDL_ #define _ENUMPROP_MACRO_INCLUDED_IDL_ .... here the same macros previously in enumpropMACRO.idl #endif /* ENUMPROP_MACRO_INCLUDED_IDL_ */
|
Related articles appear here based on the labels you select. Click to edit the macro and add or change labels.
|