K.S. Bhaskar on 26 Jul 2006 18:23:27 -0000 |
It all depends on how large and complex the application is. Ifdefs dont' scale well to large code bases. In GT.M (http://www.sanchez-gtm.com), which is between a quarter million and a half million lines of code that implements a high performance transaction processing database engine and associated compiled scripting language, we try to abstract out platform dependencies into header files wherever possible, e.g., by encapsulating functionality in macros. Where warranted (e.g., in the compiler), we have platform dependent versions of source files. Source code for the implemnentations of GT.M on x86 GNU/Linux and HP Alpha/AXP Tru64 UNIX are GPL'd at Source Forge (http://sourceforge.net/projects/sanchez-gtm) and you can compare the two code bases to see how it's done. [This is a real-world database engine that runs tens of millions of bank accounts around the globe.] Of course, if your application is small, ifdef away... -- Bhaskar On 7/26/06, Daniel K. Spicer <spicer@linuxmania.com> wrote: I'm doing a code port from Solaris to Suse Linux. The ported code will need to run on both so I need a preproccessor directive in the .c files like: ___________________________________________________________________________ Philadelphia Linux Users Group -- http://www.phillylinux.org Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce General Discussion -- http://lists.phillylinux.org/mailman/listinfo/plug
|
|