A "wrapper" function is a function that "hides the name" of a non-portable function, e.g. we have the functions linuxfunc (which is also available on other Unix) and WindowsFunc, which takes different arguments, and return different return values, but otherwise does the same thing, so we could do something like this:
Code:
int wrappedfunc(int a)
{
#if defined(WINDOWS)
BOOL res;
res = WindwosFunc(a, NULL);
if (res) return 0; // Success.
else return -1; // Fail
#elseif defined(LINUX) || defined(UNIX)
return linuxfunc(a * 10); // Returns -1 for fail, 0 for success.
#else
// We don't know what to do if it's not LINUX/UNIX, so let the compiler tell us
#error "This only works for only Linux, Unix and Windows - please add code here to support other OS's"
#endif
}
--
Mats