[vlc-devel] [PATCH 1/3] WinRT: define a simple WINRT define than WINAPI_FAMILY_APP

Rémi Denis-Courmont remi at remlab.net
Tue Jan 8 15:14:57 CET 2013

On Tue, 08 Jan 2013 14:51:24 +0100, Rafaël Carré <funman at videolan.org>
> Le 08/01/2013 14:31, Rémi Denis-Courmont a écrit :
>> On Tue,  8 Jan 2013 13:44:34 +0100, Jean-Baptiste Kempf
<jb at videolan.org>
>> wrote:
>>> This will allow us to use #ifdef(WINRT) in the code
> [1]
>> Comment is wrong.
>>> +     *
>>> +     **/
>>> +#      define VLC_WINRT
>> What's the point anyway? 
> I think the obvious point is to #ifdef specific code present and/or
> absent from WinRT (see [1])
>> We don't define VLC_WINDOWS and VLC_MACOS...
> Well we use compiler defines for these platforms.

You are presuming that there will be code that enabled or disabled only on
WinRT in cross-platform files.

Experience has shown that:

*) Developers confuse platform subset defines.
For instance, "#if defined(WIN32) && defined(UNDER_CE)" was complete
non-sense since UNDER_CE implied WIN32.

*) Custom helpers (macros or functions) tend to get redefined ("extended",
"improved") recklessly since there is no authority on their semantic. This
has caused bugs and further confusion.

*) Custom helpers need to be learnt on a per-project basis, unlike
standard ones.

*) In the source code, the distinction will most typically be between
Windows desktop and Windows store, rather than between Windows store and
everything else. Thus, this macro brings very little benefits over the
standard "#if (FAMILY == APP)".

*) A Makefile condition will almost certainly be needed anyway. This will
superset the preprocessor macro. Basically, I don't see the urge to define
a macro that is yet to be used anywhere...

Rémi Denis-Courmont
Sent from my collocated server

More information about the vlc-devel mailing list