2 ms·
It's customary in software engineering to "wrap" and augment system infrastructure with your own portability layer. You can see this everywhere; the Linux kerne
by mahmud 16y ago
It's customary in software engineering to "wrap" and augment system infrastructure with your own portability layer. You can see this everywhere; the Linux kernel, for example, bundles its own little library for emulating floating-point processing, for x86 systems that don't have x87 (very rare!).
The whole point of the C compiler -D argument is to allow you to enable features at compile time. GNU Autotools exploit this by inspecting the host environment and enumerating the available "features", allowing the build scripts to selectively compile your portability layers when a feature is missing.
With Android, you can use runtime reflection to instantiate the right objects, based on system parameters. I.e. your compiled APK can behave differently on two systems, say, by enabling extra functionality on older OS versions.