Hi Peter,
 
While I am in favour of your proposed change, could you postphone the submission for a couple of days and let me make the 1.17.0 release. I planned to make this release by the end of June and big code change only makes this process longer. Maybe not many people jumped on the VS2012 ship and VS2012RC is not the final release. Thanks.
 
Lianqing Yu
 
> Date: Thu, 28 Jun 2012 15:34:21 +0100
> From: peter_vanroose@yahoo.co.uk
> To: vxl-maintainers@lists.sourceforge.net
> CC: cpvxl@stellarscience.com
> Subject: Re: [Vxl-maintainers] Building VXL with VS 2012 Release Candidate
>
>
>
> Dear maintainers,
>
> I'm very much in favour of the proposed introduction of a VCL_TEMPLATE_EXPORT macro.
> If no objections, I would suggest to check in those changes and see what the dashboard thinks of it...
>
> --    Peter.
>
>
> From: Conrad Poelman <cpvxl@stellarscience.com>
> To: vxl-users@lists.sourceforge.net
> Date: torsdag, 28 juni 2012 8:14
> Subj: [Vxl-users] Building VXL with VS 2012 Release Candidate (formerly known as VS 2011 beta)
>
> I've successfully built VXL on Microsoft Visual Studio 2012 Release Candidate and found it only needed one fix - for such a complex library, that's a tribute to VXL's overall excellent cross-platform design. Details are explained below and a patch file is attached, for incorporation into VXL or just for use by the next person who needs to build VXL on VS 2012.
>
> If there's a publicly accessible bug tracker for VXL, please point me to it - I'd be happy to enter this there.
>
> -- Conrad
>
>
> vcl/vcl_compiler.h has a section:
>   // if the compiler doesn't understand "export", we just leave it out.
>   // gcc and SunPro 5.0 understand it, but they ignore it noisily.
>   #if !VCL_HAS_EXPORT||defined(VCL_EGCS)||defined(VCL_GCC_295)||defined(VCL_GCC_3)||defined(VCL_GCC_4)||defined(VCL_SUNPRO_CC_5)
>   # define export /* ignore */
>   #endif
>
> The issue is that redefining keywords is not a terribly good practice and Visual Studio 2012 Release Candidate (formerly known as VS 2011 beta) explicitly forbids it by checking for any #defined keywords in a standard header file called xkeycheck.h which gets included by most other standard header files. (Redefining keywords is also arguably a violation of the C++ spec. There's some debate about that at http://stackoverflow.com/questions/2726204/c-preprocessor-define-ing-a-keyword-is-it-standards-conforming - it may only be illegal when standard headers are included, which nonetheless covers most C++ files.)
>
> So all I did was change the above lines to:
>   // if the compiler doesn't understand "export", we just leave it out.
>   // gcc and SunPro 5.0 understand it, but they ignore it noisily.
>   #if !VCL_HAS_EXPORT||defined(VCL_EGCS)||defined(VCL_GCC_295)||defined(VCL_GCC_3)||defined(VCL_GCC_4)||defined(VCL_SUNPRO_CC_5)
>   # define VCL_TEMPLATE_EXPORT /* ignore */
>   #else
>   # define VCL_TEMPLATE_EXPORT export
>   #endif
>
> This makes the above code section nicely look like the other #if sections in vcl/vcl_compiler.h. I then changed instances of the "export" keyword to VCL_TEMPLATE_EXPORT throughout VXL, which trivially changed about 23 header files.
>
> This problem was evidently previously noticed and reported within ITK: http://www.itk.org/pipermail/insight-users/2011-December/043178.html. Personally I think VCL_TEMPLATE_EXPORT is a better name than __export but I believe this solution is otherwise equivalent to the fix they describe.
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> --
>
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Vxl-maintainers mailing list
> Vxl-maintainers@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/vxl-maintainers