Re:Ask HN: Resources for developing multi-platform native co...
by ahpaja on Thursday September 15, 2016 @06:46AM
(#12504844)
Thanks very much for this! I have been poking around a bit this week and this is indeed what I need. :)
More importantly, where you say "A good starting point for a project..." is exactly the kind of know-how and practical advice that I have found hard to come by in this area of software engineering. Any idea on where to find more of it (blogs, articles) would be always welcome.
Re:Ask HN: Resources for developing multi-platform native co...
by panic on Thursday September 08, 2016 @05:09AM
(#12451400)
It's worth noting that Microsoft Visual Studio doesn't have very good C support: it still doesn't support all of C99. You can either use clang as a frontend on Windows (https://blogs.msdn.microsoft.com/vcblog/2015/12/04/clang-wit...) or use C++: almost all of C++11 is supported (https://msdn.microsoft.com/en-us/library/hh567368.aspx).
The goal of standardisation for C was in part to aid portability. That worked out to some degree. So thats the best place to start. The goal of POSIX was to standardize UNIX system interfaces across the various flavors. That worked out to some degree also. You also need to to get the interfaces for Windows, Linux and so forth because they all have various 'innovations' that have been created which are not adherent to any standard or portable.
At a minimum you should become familiar with the fallowing material.
* ISO/IEC 9899:1999 - ISO/IEC 9899:2011 http://www.open-std.org/jtc1/sc22/wg14/
* POSIX.1-2008 / IEEE Std 1003.1 http://pubs.opengroup.org/onlinepubs/9699919799/
* Linux system interfaces http://man7.org/linux/man-pages/
* Win API/Win32 API https://msdn.microsoft.com/en-us/library/windows/desktop/ff8...
Thats a lot of reading. A good starting point for a project is to code to the C standard and one abstract interface that wraps your main target OS. Then port portions of the implamentation for your interface to the various systems you need to run on. In reality there are a lot of specific factors that you need to take into account to design your portability strategy.