Daniel May wrote: > What is the APR standard for utilizing functions that may or may not be > present in a specific version of an OS ? > For example, there are two ways, at run time, to detect the presence of > InterlockedIncrement64() under Windows. > > A. You could call a LoadLibrary/GetProcAddress combination on the function, > and use it if you succeed in getting a valid function pointer. > B. You can make Kernel32.dll delayload, and only attempt to call > InterlockedIncrement64() if the proper OS version is detected at run time > that is known to support InterlockedIncrement64().
We've implemented A. above, along with the opportunity to test the osver. Beginning to think we need an apr_os_ call to identify if we are on some minimal version of a given OS or OS family (say either generic BSD, or rather test FreeBSD, OpenBSD, NetBSD). Complimentary to this might be an interface to ask if a particular patch/patch level is installed. This idea is still pretty fuzzy, but I've noted plenty of XXX Doesn't work prior to rev XXX of FooOS comments throughout the ifdef tests. These are really not useful since you don't gain the functionality by upgrading until you have rebuilt for the new OS level or patch level.
