[PD-dev] [ pure-data-Patches-3412977 ] replace MSW with _WIN32 (please please please)
SourceForge.net
noreply at sourceforge.net
Thu Sep 22 19:11:02 CEST 2011
Patches item #3412977, was opened at 2011-09-22 13:11
Message generated for change (Tracker Item Submitted) made by eighthave
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=478072&aid=3412977&group_id=55736
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: puredata
Group: None
Status: Open
Resolution: None
Priority: 9
Private: No
Submitted By: Hans-Christoph Steiner (eighthave)
Assigned to: Miller Puckette (millerpuckette)
Summary: replace MSW with _WIN32 (please please please)
Initial Comment:
We are starting to port Pd to another interesting platform, (Google Chrome Native Client NaCl) and yet again we'll have to wade thru the #ifdefs to figure out what we need. Especially painful are things like #ifndef MSW. Lots of people have wasted many hours on this stuff. This MSW macro is unnecessary since every compiler for Windows defines _WIN32 automatically. If _WIN32 ever disappears, we can easily add -D_WIN32, which is just as easy as doing -DMSW. Or just replace -DMSW with -D_WIN32.
Also, having the MSW as _WIN32 makes it easier to solve MinGW and Cygwin build issues where those platforms differ from MSVC++
This can be achieved with this one liner, which I've tested on Mac OS X, Ubuntu/Maverick, and Windows XP:
cd pure-data.git/src && sed -i 's|\(^\#.*if.*\) MSW|\1 _WIN32|' *.[ch]
You can see the lines that this regexp would change by running this:
cd pure-data.git/src && sed -n 's|\(^\#.*if.*\) MSW|\1 _WIN32|p' *.[ch]|less
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=478072&aid=3412977&group_id=55736
More information about the Pd-dev
mailing list