Patches item #3412977, was opened at 2011-09-22 13:11 Message generated for change (Comment added) made by eighthave You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=478072&aid=3412977...
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: 8 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
----------------------------------------------------------------------
Comment By: Hans-Christoph Steiner (eighthave)
Date: 2011-11-03 14:39
Message: so just to highlight the key point, this change has little risk, and a big impact in future porting activities, like porting Pd to the Chrome native code, Windows Mobile, etc.
----------------------------------------------------------------------
Comment By: Hans-Christoph Steiner (eighthave) Date: 2011-11-03 14:37
Message:
I can't log onto sourceforge right now but thought I whould ask you a
quick
question about _WIN32 - would it be a good or a bad idea to try to
sneak
this into 0.43-1? I could either do that now or hold off for 0.44,
depending
on which you think would cause less wreckage.
I checked out all the changes that the sed replacement does, and did some build tests. I think this is really a low risk change that would be great to have in 0.43.1,
And by the way, would it not be adequate just to put
#ifdef _WIN32 #define MSW #endif
in m_pd.h?
This will only help a little, and could confuse things. It is not very clear what exactly MSW means. It is some combination of _MSC_VER (MS compilers) and _WIN32 (Win32 platform SDKs) and even some other things. When doing things like porting to Cygwin or other Windows things, it'll be much easier to be able to submit fixes if _WIN32 is there. Also, when changing things to use specific macros like HAVE_ALLOCA_H, it'll make things more understandable.
----------------------------------------------------------------------
Comment By: Hans-Christoph Steiner (eighthave) Date: 2011-11-03 10:06
Message: putting the priority back since its an easy change that can save people a lot of work.
----------------------------------------------------------------------
Comment By: IOhannes m zmölnig (zmoelnig) Date: 2011-11-03 05:46
Message: i'm all for doing this
----------------------------------------------------------------------
You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=478072&aid=3412977...