[config] disabling _MSC_EXTENSIONS disables win32

View: New views
4 Messages — Rating Filter:   Alert me  

[config] disabling _MSC_EXTENSIONS disables win32

by Igor R :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

In visualc.hpp I found the following:

#if !defined(_MSC_EXTENSIONS) && !defined(BOOST_DISABLE_WIN32)
#  define BOOST_DISABLE_WIN32
#endif

I.e., disabling MSVC-specific exnetions (/Za) disables also WIN32,
which, in turn, leads to undefined BOOST_WINDOWS.
So if I try to compile my project with /Za, nothing compiles, because
there're lot of places where BOOST_WINDOWS is used to select
platform-dependant implementation (eg., in ASIO).
But if I understand correctly, the purpose of disabling MSVC
*language* extenstions is to ensure that the code is portable &
standard-complient. So it seems to be incorrect to imply from this
BOOST_DISABLE_WIN32.

Am I wrong?


Thanks.
_______________________________________________
Boost-users mailing list
Boost-users@...
http://lists.boost.org/mailman/listinfo.cgi/boost-users

Re: [config] disabling _MSC_EXTENSIONS disables win32

by John Maddock :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> In visualc.hpp I found the following:
>
> #if !defined(_MSC_EXTENSIONS) && !defined(BOOST_DISABLE_WIN32)
> #  define BOOST_DISABLE_WIN32
> #endif
>
> I.e., disabling MSVC-specific exnetions (/Za) disables also WIN32,
> which, in turn, leads to undefined BOOST_WINDOWS.
> So if I try to compile my project with /Za, nothing compiles, because
> there're lot of places where BOOST_WINDOWS is used to select
> platform-dependant implementation (eg., in ASIO).
> But if I understand correctly, the purpose of disabling MSVC
> *language* extenstions is to ensure that the code is portable &
> standard-complient. So it seems to be incorrect to imply from this
> BOOST_DISABLE_WIN32.

The point is that with /Za you can't #include windows.h or use any platform
specific features, so that makes it very hard (impossible?) to compile code
that is binary compatible between /Za and not /Za.  I realize there are
exceptions to this - particularly for libraries where the implementation is
confined to an external binary - but given that most of Boost is header
only, what did you expect?

Regards, John

_______________________________________________
Boost-users mailing list
Boost-users@...
http://lists.boost.org/mailman/listinfo.cgi/boost-users

Re: [config] disabling _MSC_EXTENSIONS disables win32

by Igor R :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> The point is that with /Za you can't #include windows.h or use any platform specific features, so that makes it very hard (impossible?) to compile code that is binary compatible between /Za and not /Za.


Ok, I see now, I jumped to conclusions too quickly...
So it turns out that /Za is absolutely useless for any win-based
development, which is very frustrating.
_______________________________________________
Boost-users mailing list
Boost-users@...
http://lists.boost.org/mailman/listinfo.cgi/boost-users

Re: [config] disabling _MSC_EXTENSIONS disables win32

by Paul A. Bristow-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> -----Original Message-----
> From: boost-users-bounces@...
[mailto:boost-users-bounces@...]
> On Behalf Of Igor R
> Sent: Wednesday, November 11, 2009 1:57 PM
> To: boost-users@...
> Subject: Re: [Boost-users] [config] disabling _MSC_EXTENSIONS disables win32
>
> > The point is that with /Za you can't #include windows.h or use any platform
specific
> features, so that makes it very hard (impossible?) to compile code that is
binary
> compatible between /Za and not /Za.
>
> Ok, I see now, I jumped to conclusions too quickly...
> So it turns out that /Za is absolutely useless for any win-based
> development, which is very frustrating.

But NOT useless for detecting potential problems with *other* platforms.

So *testing* it using /Za isn't useless, for the tiny cost (and admittedly
modest likelihood of finding problems).

If /Za isn't possible, then it warns that there is a significant risk it won't
work on other platforms.

(But not *certain* to fail because the coding may carefully cope with multiple
platforms - like Boost.Filesystem).

Paul



---
Paul A. Bristow
Prizet Farmhouse
Kendal, UK   LA8 8AB
+44 1539 561830, mobile +44 7714330204
pbristow@...






_______________________________________________
Boost-users mailing list
Boost-users@...
http://lists.boost.org/mailman/listinfo.cgi/boost-users