Re: hashcash BSD vs GNU getopt bug (Re: documentation bug?)
Linus Nordberg <[email protected]>
| Newsgroups | gmane.mail.spam.hashcash |
|---|---|
| Message-ID | <[email protected]> |
[email protected] ("Hal Finney") wrote Sat, 28 Aug 2004 12:06:31 -0700 (PDT): | I often struggle with writing cross platform code. I wonder if anyone | has some good references or resources for this. I want to write command | line code, or libraries suitable for linking with GUI front ends, which | will compile on Linux, BSD, Windows and Macs. | | One useful piece of information would be symbols which are predefined | by the compiler (or preprocessor), for each architecture, that would | allow you to distinguish them reliably. I don't know a good source | for this. I have found that _WIN32 is good for identifying Windows | though. Why not use Autoconf for testing for a *capability* instead of relying on knowledge about some feature being present or not on a particular platform? This technique has the advantage of being "future safe" -- when platform X implements function Y your package will use it.