[cfe-commits] Preliminary patch to support MSVC __declspec(property)

endlessroad1991 at gmail.com endlessroad1991 at gmail.com
Sat Apr 20 04:45:39 PDT 2013

Quick fix: modify the atlbase.h header. Change type of m_csStaticDataInit

The problem is, type of m_csStaticDataInit is deduced as CRITICAL_SECTION,
not CRITICAL_SECTION&, thus the error.
I will look into this.

On Sat, Apr 20, 2013 at 7:26 PM, Will Wilson <will at indefiant.com> wrote:

> Hi All,
> Firstly, a huge thanks to everyone that got this patch in. It's certainly
> improved MSVC compatibility by a significant margin. I've been busy testing
> it against various windows code bases with positive results. However, it's
> not all good news, MFC is fighting back:
>   In file included from atlmfc\include\afxwin.h:70:
>   In file included from atlmfc\include\atlhandler.h:22:
>   In file included from atlmfc\include\atlstr.h:19:
>   atlmfc\include\atlbase.h(4546,23): error : cannot take the address of an
> rvalue of type 'CRITICAL_SECTION'
>                   EnterCriticalSection(&m_csStaticDataInit);
> The problem source is:
> __declspec(property(get  = get_m_csStaticDataInit)) CRITICAL_SECTION
> m_csStaticDataInit;
> CRITICAL_SECTION& get_m_csStaticDataInit() throw();
>  void EnterStaticDataCriticalSection() throw()
> {
> EnterCriticalSection(&m_csStaticDataInit);
>  }
> Any easy fixes? If not, I might have a chance to look at it later in the
> week.
> Cheers,
> Will.

Best Regards, Tong Shen (沈彤)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130420/550652e6/attachment.html>

More information about the cfe-commits mailing list